summaryrefslogtreecommitdiffstats
path: root/contrib/benchmark.sh
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-05-08 19:18:01 +0200
committerHarald Welte <laforge@gnumonks.org>2014-05-08 19:18:01 +0200
commit7a04624563ac72b7237e39d6fcee5dab96f4d948 (patch)
treee97aa7567abe2c3f205c327ff3ef5d5d160fbd2e /contrib/benchmark.sh
parent8b5e0c7b81cba9f064bed97dc743e5a9a13818f1 (diff)
Add cycle benchmarking support
This enables benchmarking of the codec. It will print the amount of CPU cycles needed for encoding/decoding a single 20ms frame on average.
Diffstat (limited to 'contrib/benchmark.sh')
-rwxr-xr-xcontrib/benchmark.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/benchmark.sh b/contrib/benchmark.sh
new file mode 100755
index 0000000..0148667
--- /dev/null
+++ b/contrib/benchmark.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+GAPK=./src/gapk
+PCMFILE=$1
+BASE=`basename $PCMFILE`
+
+echo
+echo Encoder Benchmark:
+$GAPK -i "$PCMFILE" -f rawpcm-s16le -o "$BASE.fr" -g gsm
+$GAPK -i "$PCMFILE" -f rawpcm-s16le -o "$BASE.efr" -g amr-efr
+$GAPK -i "$PCMFILE" -f rawpcm-s16le -o "$BASE.hr" -g ti-hr
+
+echo
+echo Decoder Benchmark:
+$GAPK -i "$BASE.fr" -g rawpcm-s16le -o /dev/null -f gsm
+$GAPK -i "$BASE.efr" -g rawpcm-s16le -o /dev/null -f amr-efr
+$GAPK -i "$BASE.hr" -g rawpcm-s16le -o /dev/null -f ti-hr