Trying to prevent PVQ-level splits

We prevent as many as possible, but they can still occur if we
manage to reach the LN limit
This commit is contained in:
Jean-Marc Valin 2010-05-14 07:47:30 -04:00
parent c803ee1959
commit eb926680f6

View file

@ -457,7 +457,7 @@ void quant_band(const CELTMode *m, int i, celt_norm *X, celt_norm *Y, int N, int
split = stereo = Y != NULL; split = stereo = Y != NULL;
if (b>(32<<BITRES) && !stereo && LM>0) if (!stereo && LM>0 && !fits_in32(N, get_pulses(bits2pulses(m, m->bits[LM][i], N, b))))
{ {
N /= 2; N /= 2;
Y = X+N; Y = X+N;
@ -667,7 +667,7 @@ void unquant_band(const CELTMode *m, int i, celt_norm *X, celt_norm *Y, int N, i
split = stereo = Y != NULL; split = stereo = Y != NULL;
if (b>(32<<BITRES) && !stereo && LM>0) if (!stereo && LM>0 && !fits_in32(N, get_pulses(bits2pulses(m, m->bits[LM][i], N, b))))
{ {
N /= 2; N /= 2;
Y = X+N; Y = X+N;