diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-14 20:07:13 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-14 20:07:13 +0400 |
commit | e0f26246b08122cef31c1ac85f7ed228e2daca61 (patch) | |
tree | cb8ea9a36698ee1ea24ac150ce08dc67530288d5 /celt/bands.c | |
parent | 4a168eb343af95be4b3a00ef2c5cf40da1d6b7e0 (diff) |
fixed-point: adds rounding to some shifts to eliminate bias
This reduces the peak decoding error by removing small (inaudible) spikes in
the error at the frame boundaries. These were due to the frequency-domain bias
ending up as a small pulse in the middle of the IMDCT overlap. None of this
was ever audible, but fixing it is still cleaner.
Diffstat (limited to 'celt/bands.c')
-rw-r--r-- | celt/bands.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/celt/bands.c b/celt/bands.c index c6b5f0b8..73346445 100644 --- a/celt/bands.c +++ b/celt/bands.c @@ -430,7 +430,7 @@ static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT { celt_norm r, l; /* Apply mid scaling (side is already scaled) */ - l = MULT16_16_Q15(mid, X[j]); + l = MULT16_16_P15(mid, X[j]); r = Y[j]; X[j] = EXTRACT16(PSHR32(MULT16_16(lgain, SUB16(l,r)), kl+1)); Y[j] = EXTRACT16(PSHR32(MULT16_16(rgain, ADD16(l,r)), kr+1)); @@ -600,8 +600,8 @@ void haar1(celt_norm *X, int N0, int stride) opus_val32 tmp1, tmp2; tmp1 = MULT16_16(QCONST16(.70710678f,15), X[stride*2*j+i]); tmp2 = MULT16_16(QCONST16(.70710678f,15), X[stride*(2*j+1)+i]); - X[stride*2*j+i] = EXTRACT16(SHR32(ADD32(tmp1, tmp2), 15)); - X[stride*(2*j+1)+i] = EXTRACT16(SHR32(SUB32(tmp1, tmp2), 15)); + X[stride*2*j+i] = EXTRACT16(PSHR32(ADD32(tmp1, tmp2), 15)); + X[stride*(2*j+1)+i] = EXTRACT16(PSHR32(SUB32(tmp1, tmp2), 15)); } } |