diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-03 05:02:37 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-03 05:02:37 +0400 |
commit | 96408b62958bb7b337311103a5bbb6cd5613cf5a (patch) | |
tree | dbc28833cf939225c9606cca309b8b166f7651a9 | |
parent | 086ea7c7e567b68e01ea15561e8b825ecfc78606 (diff) |
Fixes Opus-custom preemphasis
Also adds denorm avoidance for non-48 kHz rates
-rw-r--r-- | celt/celt_decoder.c | 4 | ||||
-rw-r--r-- | celt/celt_encoder.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c index e34b4c6d..830398ee 100644 --- a/celt/celt_decoder.c +++ b/celt/celt_decoder.c @@ -213,7 +213,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c opus_val16 coef3 = coef[3]; for (j=0;j<N;j++) { - celt_sig tmp = x[j] + m; + celt_sig tmp = x[j] + m + VERY_SMALL; m = MULT16_32_Q15(coef0, tmp) - MULT16_32_Q15(coef1, x[j]); tmp = SHL32(MULT16_32_Q15(coef3, tmp), 2); @@ -227,7 +227,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c /* Shortcut for the standard (non-custom modes) case */ for (j=0;j<N;j++) { - celt_sig tmp = x[j] + m; + celt_sig tmp = x[j] + m + VERY_SMALL; m = MULT16_32_Q15(coef0, tmp); scratch[j] = tmp; } diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c index 1ceb75e2..ffff0775 100644 --- a/celt/celt_encoder.c +++ b/celt/celt_encoder.c @@ -508,7 +508,7 @@ void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RES opus_val16 coef2 = coef[2]; for (i=0;i<N;i++) { - opus_val16 x, tmp; + celt_sig x, tmp; x = inp[i]; /* Apply pre-emphasis */ tmp = MULT16_16(coef2, x); |