diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-05-28 16:16:21 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-05-28 16:18:09 +0200 |
commit | 526fc6e5e906937c3227b88c238d2a6d7e520434 (patch) | |
tree | 39b28bf096b8460de25b6126087e35b4d1a25758 /src | |
parent | bd42eba35dca8ae23013ad0825d007a0a5f69091 (diff) |
Fix HR codec block sizes
The ETSI reference codec actually uses an array of 20/22 16bit values
rather than a "canonical" format. The conversion is what fmt_hr_ref.c
is doing. However, codec_hr.c must then subsequently not check for the
canonical input/output sizes, but those specific to it.
Diffstat (limited to 'src')
-rw-r--r-- | src/codec_hr.c | 4 | ||||
-rw-r--r-- | src/fmt_hr_ref.c | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/codec_hr.c b/src/codec_hr.c index 0b16985..b3247e0 100644 --- a/src/codec_hr.c +++ b/src/codec_hr.c @@ -53,7 +53,7 @@ codec_hr_encode(void *_state, uint8_t *cod, const uint8_t *pcm, unsigned int pcm BENCHMARK_STOP(CODEC_HR, 1); if (rc < 0) return rc; - return HR_CANON_LEN; + return HR_REF_ENC_LEN; } static int @@ -61,7 +61,7 @@ codec_hr_decode(void *_state, uint8_t *pcm, const uint8_t *cod, unsigned int cod { struct gsmhr *state = _state; int rc; - assert(cod_len == HR_CANON_LEN); + assert(cod_len == HR_REF_DEC_LEN); BENCHMARK_START; rc = gsmhr_decode(state, (int16_t *)pcm, (const int16_t *)cod); BENCHMARK_STOP(CODEC_HR, 0); diff --git a/src/fmt_hr_ref.c b/src/fmt_hr_ref.c index 32e8d48..d64918b 100644 --- a/src/fmt_hr_ref.c +++ b/src/fmt_hr_ref.c @@ -26,9 +26,6 @@ #include <gapk/formats.h> #include <gapk/utils.h> -#define HR_REF_DEC_LEN (22 * sizeof(uint16_t)) -#define HR_REF_ENC_LEN (20 * sizeof(uint16_t)) - static const int params_unvoiced[] = { 5, /* R0 */ 11, /* k1Tok3 */ |