Commit fb7359a6 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

fixed-point: Fixed a "shift too large" warning by using a 16-bit mul instead

of 32-bit in find_spectral_pitch()
parent 15b9be3a
...@@ -131,10 +131,10 @@ void find_spectral_pitch(kiss_fftr_cfg fft, const struct PsyDecay *decay, const ...@@ -131,10 +131,10 @@ void find_spectral_pitch(kiss_fftr_cfg fft, const struct PsyDecay *decay, const
can help save memory */ can help save memory */
for (i=0;i<overlap/2;i++) for (i=0;i<overlap/2;i++)
{ {
X[2*bitrev[i]] = MULT16_32_Q15(window[2*i], X[2*bitrev[i]]); X[2*bitrev[i]] = MULT16_16_Q15(window[2*i], X[2*bitrev[i]]);
X[2*bitrev[i]+1] = MULT16_32_Q15(window[2*i+1], X[2*bitrev[i]+1]); X[2*bitrev[i]+1] = MULT16_16_Q15(window[2*i+1], X[2*bitrev[i]+1]);
X[2*bitrev[L2-i-1]] = MULT16_32_Q15(window[2*i+1], X[2*bitrev[L2-i-1]]); X[2*bitrev[L2-i-1]] = MULT16_16_Q15(window[2*i+1], X[2*bitrev[L2-i-1]]);
X[2*bitrev[L2-i-1]+1] = MULT16_32_Q15(window[2*i], X[2*bitrev[L2-i-1]+1]); X[2*bitrev[L2-i-1]+1] = MULT16_16_Q15(window[2*i], X[2*bitrev[L2-i-1]+1]);
} }
normalise16(X, lag, 8192); normalise16(X, lag, 8192);
/*for (i=0;i<lag;i++) printf ("%d ", X[i]);printf ("\n");*/ /*for (i=0;i<lag;i++) printf ("%d ", X[i]);printf ("\n");*/
Supports Markdown
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