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

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

band
parent 4117ff02
......@@ -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
......
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