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:
Vadim Yanitskiy 2017-09-03 17:16:27 +07:00
parent 9e997267f6
commit 30493c78b3
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;