diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-14 11:07:13 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-14 11:07:13 -0500 |
commit | e0f26246b08122cef31c1ac85f7ed228e2daca61 (patch) | |
tree | cb8ea9a36698ee1ea24ac150ce08dc67530288d5 /celt/vq.c | |
parent | 4a168eb343af95be4b3a00ef2c5cf40da1d6b7e0 (diff) | |
download | libopus-e0f26246b08122cef31c1ac85f7ed228e2daca61.tar.gz |
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/vq.c')
-rw-r--r-- | celt/vq.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -49,8 +49,8 @@ static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_ celt_norm x1, x2; x1 = Xptr[0]; x2 = Xptr[stride]; - Xptr[stride] = EXTRACT16(SHR32(MULT16_16(c,x2) + MULT16_16(s,x1), 15)); - *Xptr++ = EXTRACT16(SHR32(MULT16_16(c,x1) - MULT16_16(s,x2), 15)); + Xptr[stride] = EXTRACT16(PSHR32(MULT16_16(c,x2) + MULT16_16(s,x1), 15)); + *Xptr++ = EXTRACT16(PSHR32(MULT16_16(c,x1) - MULT16_16(s,x2), 15)); } Xptr = &X[len-2*stride-1]; for (i=len-2*stride-1;i>=0;i--) @@ -58,8 +58,8 @@ static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_ celt_norm x1, x2; x1 = Xptr[0]; x2 = Xptr[stride]; - Xptr[stride] = EXTRACT16(SHR32(MULT16_16(c,x2) + MULT16_16(s,x1), 15)); - *Xptr-- = EXTRACT16(SHR32(MULT16_16(c,x1) - MULT16_16(s,x2), 15)); + Xptr[stride] = EXTRACT16(PSHR32(MULT16_16(c,x2) + MULT16_16(s,x1), 15)); + *Xptr-- = EXTRACT16(PSHR32(MULT16_16(c,x1) - MULT16_16(s,x2), 15)); } } |