Commit 00d2e621 authored by Karl Tomlinson's avatar Karl Tomlinson Committed by Ralph Giles

fixed-point resample: remove 1-bit shift right before interpolation

This was added in
to address truncation reported at

Truncation of the most-signficant bit was occuring on conversion to
spx_word16_t in MULT16_32_Q15().  Changes to MULT16_32_Q15() mean this will no
longer occur.

The associated adjustment to the bit-shift before saturation was accidentally
removed in
which caused the output to have half the intended amplitude when the
interpolating resampler was used.

Reported by Andreas Pehrson.
parent 9617cea1
......@@ -473,7 +473,7 @@ static int resampler_basic_interpolate_single(SpeexResamplerState *st, spx_uint3
cubic_coef(frac, interp);
sum = MULT16_32_Q15(interp[0],SHR32(accum[0], 1)) + MULT16_32_Q15(interp[1],SHR32(accum[1], 1)) + MULT16_32_Q15(interp[2],SHR32(accum[2], 1)) + MULT16_32_Q15(interp[3],SHR32(accum[3], 1));
sum = MULT16_32_Q15(interp[0],accum[0]) + MULT16_32_Q15(interp[1],accum[1]) + MULT16_32_Q15(interp[2],accum[2]) + MULT16_32_Q15(interp[3],accum[3]);
sum = SATURATE32PSHR(sum, 15, 32767);
cubic_coef(frac, interp);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment