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.
This commit is contained in:
Harald Welte 2017-05-28 16:16:21 +02:00
parent bd42eba35d
commit 526fc6e5e9
3 changed files with 4 additions and 5 deletions

View File

@ -26,6 +26,8 @@
#define HR_CANON_LEN 14
#define EFR_CANON_LEN 31
#define PCM_CANON_LEN (160*sizeof(uint16_t))
#define HR_REF_ENC_LEN (20 * sizeof(uint16_t))
#define HR_REF_DEC_LEN (22 * sizeof(uint16_t))
enum codec_type {
CODEC_INVALID = 0,

View File

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

View File

@ -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 */