Solved an encoder/decoder mismatch happening when there's no pulse in the first

band
This commit is contained in:
Jean-Marc Valin 2008-08-06 23:06:31 -04:00
parent 4117ff0275
commit 5eef264f3e

View file

@ -286,9 +286,14 @@ static void fold(const CELTMode *m, int N, celt_norm_t *Y, celt_norm_t * restric
const int C = CHANNELS(m);
int id = N0 % (C*B);
/* Here, we assume that id will never be greater than N0, i.e. that
no band is wider than N0. */
for (j=0;j<C*N;j++)
P[j] = Y[id++];
no band is wider than N0. In the unlikely case it happens, we set
everything to zero */
if (id+C*N>N0)
for (j=0;j<C*N;j++)
P[j] = 0;
else
for (j=0;j<C*N;j++)
P[j] = Y[id++];
}
#define KGAIN 6