shithub: opus

Download patch

ref: b4ce40cb5542d4a6d643458411ccba86e13c3b61
parent: abf5c8ed64b7e59a434ed0f35babe61579242d20
author: Jean-Marc Valin <[email protected]>
date: Fri Sep 19 07:50:50 EDT 2008

Fixing the manual stack handling code

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -670,6 +670,7 @@
    int j, ret;
    const int C = CHANNELS(st->mode);
    const int N = st->block_size;
+   VARDECL(celt_int16_t, in);
    ALLOC(in, C*N, celt_int16_t);
 
    for (j=0;j<C*N;j++)
@@ -1027,6 +1028,7 @@
    int j, ret;
    const int C = CHANNELS(st->mode);
    const int N = st->block_size;
+   VARDECL(celt_int16_t, out);
    ALLOC(out, C*N, celt_int16_t);
 
    ret=celt_decode(st, data, len, out);
--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -259,8 +259,8 @@
          for (i=0;i<m->nbEBands;i++)
             E[i] = eBands[C*i+c];
          quant_coarse_energy_mono(m, E, oldEBands+c*m->nbEBands, budget/C, prob, error+c*m->nbEBands, enc);
+         RESTORE_STACK;
       }
-      RESTORE_STACK;
    }
 }
 
@@ -284,8 +284,8 @@
          quant_fine_energy_mono(m, E, oldEBands+c*m->nbEBands, error+c*m->nbEBands, fine_quant, enc);
          for (i=0;i<m->nbEBands;i++)
             eBands[C*i+c] = E[i];
+         RESTORE_STACK;
       }
-      RESTORE_STACK;
    }
 }
 
--- a/tests/cwrs32-test.c
+++ b/tests/cwrs32-test.c
@@ -24,7 +24,6 @@
         celt_uint32_t u[NMAX>MMAX+2?NMAX:MMAX+2];
         int           y[NMAX];
         celt_uint32_t v;
-        int           k;
         memcpy(u,uu,n*sizeof(*u));
         cwrsi32(n,m,i,nc,y,u);
         /*printf("%6u of %u:",i,nc);