shithub: opus

Download patch

ref: 730c6e392d2ce8cd370f0bf42517c76f502354fe
parent: ddb181b75e776ec0792e97cbabd847c5277969cc
author: Jean-Marc Valin <[email protected]>
date: Mon Mar 3 11:38:29 EST 2008

Applying the window properly in find_spectral_pitch()

--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -77,8 +77,8 @@
    {
       X[2*fft->substate->bitrev[i]] = MULT16_32_Q15(window[2*i], X[2*fft->substate->bitrev[i]]);
       X[2*fft->substate->bitrev[i]+1] = MULT16_32_Q15(window[2*i+1], X[2*fft->substate->bitrev[i]+1]);
-      X[2*fft->substate->bitrev[len-i-1]] = MULT16_32_Q15(window[2*i], X[2*fft->substate->bitrev[len-i-1]]);
-      X[2*fft->substate->bitrev[len-i-1]+1] = MULT16_32_Q15(window[2*i+1], X[2*fft->substate->bitrev[len-i-1]+1]);
+      X[2*fft->substate->bitrev[L2-i-1]] = MULT16_32_Q15(window[2*i+1], X[2*fft->substate->bitrev[L2-i-1]]);
+      X[2*fft->substate->bitrev[L2-i-1]+1] = MULT16_32_Q15(window[2*i], X[2*fft->substate->bitrev[L2-i-1]+1]);
    }
 
    kf_work((kiss_fft_cpx*)X, NULL, 1,1, fft->substate->factors,fft->substate, 1, 1, 1);