Solved an encoder/decoder mismatch happening when there's no pulse in the first
band
This commit is contained in:
parent
4117ff0275
commit
5eef264f3e
1 changed files with 8 additions and 3 deletions
11
libcelt/vq.c
11
libcelt/vq.c
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue