mirror of https://gerrit.osmocom.org/gapk
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
This commit is contained in:
parent
9e997267f6
commit
30493c78b3
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue