aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-09-03 17:16:27 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-01-08 23:44:50 +0600
commit30493c78b3579b562b4d71224857d11fbf1b56b6 (patch)
tree44d09fbccede6f38dc33b91bb18c813ab2e69790
parent9e997267f643a8234e341f281a7b57165513b440 (diff)
Fix BENCHMARK_STOP call for both AMR and FR codecs
The BENCHMARK_STOP should be called with a correct codec type and a correct operation type (encode or decode). Otherwise the results could be incorrect. Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608
-rw-r--r--src/codec_amr.c4
-rw-r--r--src/codec_fr.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/codec_amr.c b/src/codec_amr.c
index 4aae733..ca614ed 100644
--- a/src/codec_amr.c
+++ b/src/codec_amr.c
@@ -78,7 +78,7 @@ codec_amr_encode(void *state, uint8_t *cod, const uint8_t *pcm, unsigned int pcm
(unsigned char*) cod,
1
);
- BENCHMARK_STOP(CODEC_EFR, 1);
+ BENCHMARK_STOP(CODEC_AMR, 1);
return rv;
}
@@ -95,7 +95,7 @@ codec_amr_decode(void *state, uint8_t *pcm, const uint8_t *cod, unsigned int cod
(short *) pcm,
0
);
- BENCHMARK_STOP(CODEC_EFR, 0);
+ BENCHMARK_STOP(CODEC_AMR, 0);
return PCM_CANON_LEN;
}
diff --git a/src/codec_fr.c b/src/codec_fr.c
index 2ce44b4..917f34b 100644
--- a/src/codec_fr.c
+++ b/src/codec_fr.c
@@ -74,7 +74,7 @@ codec_fr_decode(void *state, uint8_t *pcm, const uint8_t *cod, unsigned int cod_
memcpy(cod_b, cod, FR_CANON_LEN);
BENCHMARK_START;
rc = gsm_decode(gh, (gsm_byte*)cod_b, (gsm_signal*)pcm);
- BENCHMARK_STOP(CODEC_FR, 1);
+ BENCHMARK_STOP(CODEC_FR, 0);
if (rc < 0)
return rc;
return PCM_CANON_LEN;