summaryrefslogtreecommitdiffstats
path: root/src/codec_fr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/codec_fr.c')
-rw-r--r--src/codec_fr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/codec_fr.c b/src/codec_fr.c
index 3b1bb7c..1bda210 100644
--- a/src/codec_fr.c
+++ b/src/codec_fr.c
@@ -18,6 +18,7 @@
*/
#include <gapk/codecs.h>
+#include <gapk/benchmark.h>
#include "config.h"
@@ -54,7 +55,9 @@ codec_fr_encode(void *state, uint8_t *cod, const uint8_t *pcm)
gsm gh = (gsm)state;
uint8_t pcm_b[2*160]; /* local copy as libgsm src isn't const ! */
memcpy(pcm_b, pcm, 2*160);
+ BENCHMARK_START;
gsm_encode(gh, (gsm_signal*)pcm, (gsm_byte*)cod);
+ BENCHMARK_STOP(CODEC_FR, 1);
return 0;
}
@@ -63,8 +66,12 @@ codec_fr_decode(void *state, uint8_t *pcm, const uint8_t *cod)
{
gsm gh = (gsm)state;
uint8_t cod_b[33]; /* local copy as libgsm src isn't const ! */
+ int rc;
memcpy(cod_b, cod, 33);
- return gsm_decode(gh, (gsm_byte*)cod_b, (gsm_signal*)pcm);
+ BENCHMARK_START;
+ rc = gsm_decode(gh, (gsm_byte*)cod_b, (gsm_signal*)pcm);
+ BENCHMARK_STOP(CODEC_FR, 1);
+ return rc;
}
#endif /* HAVE_LIBGSM */