shithub: opus

Download patch

ref: e949b720495fa9d11fdb189ffe38a7e115c1c426
parent: ce4dd367c2b9ffc2b079cde28dd724b94776376d
author: Jean-Marc Valin <[email protected]>
date: Fri May 7 03:48:07 EDT 2010

Fixed pitchEnd wrt to variable frame size. It should (sort of) all work now

--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -227,7 +227,7 @@
    celt_word16 delta;
    const int C = CHANNELS(_C);
    celt_word32 Sxy=0, Sxx=0, Syy=0;
-   int len = m->pitchEnd;
+   int len = M*m->pitchEnd;
    int N = M*m->eBands[m->nbEBands+1];
 #ifdef FIXED_POINT
    int shift = 0;
@@ -319,7 +319,7 @@
    celt_word16 gain;
    celt_word16 delta;
    const int C = CHANNELS(_C);
-   int len = m->pitchEnd;
+   int len = M*m->pitchEnd;
 
    N = M*m->eBands[m->nbEBands+1];
    gain = ADD16(QCONST16(.5f,14), MULT16_16_16(QCONST16(.05f,14),gain_id));
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -343,7 +343,7 @@
    if (mode->eBands==NULL)
       goto failure;
 
-   mode->pitchEnd = 4000*(celt_int32)frame_size/Fs;
+   mode->pitchEnd = 4000*(celt_int32)mode->shortMdctSize/Fs;
    
    /* Overlap must be divisible by 4 */
    if (mode->nbShortMdcts > 1)