Proper use of logN and logM for the offsets

This commit is contained in:
Jean-Marc Valin 2010-05-11 07:34:24 -04:00
parent c40d6f97a2
commit aead79b133
3 changed files with 7 additions and 4 deletions

View file

@ -639,7 +639,7 @@ void quant_bands_stereo(const CELTMode *m, int start, celt_norm *_X, const celt_
if (b<0)
b = 0;
qb = (b-2*(N-1)*(QTHETA_OFFSET-log2_frac(N,BITRES)))/(32*(N-1));
qb = (b-2*(N-1)*(QTHETA_OFFSET-m->logN[i]-(LM<<BITRES)))/(32*(N-1));
if (qb > (b>>BITRES)-1)
qb = (b>>BITRES)-1;
if (qb<0)
@ -835,7 +835,7 @@ void unquant_bands_stereo(const CELTMode *m, int start, celt_norm *_X, const cel
if (b<0)
b = 0;
qb = (b-2*(N-1)*(QTHETA_OFFSET-log2_frac(N,BITRES)))/(32*(N-1));
qb = (b-2*(N-1)*(QTHETA_OFFSET-m->logN[i]-(LM<<BITRES)))/(32*(N-1));
if (qb > (b>>BITRES)-1)
qb = (b>>BITRES)-1;
if (qb>14)