Minor tweaks to the max allocation

This commit is contained in:
Jean-Marc Valin 2010-12-22 01:03:43 -05:00
parent 20e4c6a611
commit cf874373c0
2 changed files with 3 additions and 6 deletions

View file

@ -1028,9 +1028,6 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end,
} else { } else {
b = 0; b = 0;
} }
/* Prevents ridiculous bit depths */
if (b > C*16*N<<BITRES)
b = C*16*N<<BITRES;
if (M*eBands[i]-N >= M*eBands[start] && (update_lowband || lowband_offset==-1)) if (M*eBands[i]-N >= M*eBands[start] && (update_lowband || lowband_offset==-1))
lowband_offset = M*eBands[i]; lowband_offset = M*eBands[i];

View file

@ -328,9 +328,9 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int
if (C*ebits[j] > (bits[j]>>BITRES)) if (C*ebits[j] > (bits[j]>>BITRES))
ebits[j] = bits[j] >> stereo >> BITRES; ebits[j] = bits[j] >> stereo >> BITRES;
/* More than 7 is useless because that's about as far as PVQ can go */ /* More than 8 is useless because that's about as far as PVQ can go */
if (ebits[j]>7) if (ebits[j]>8)
ebits[j]=7; ebits[j]=8;
} else { } else {
/* For N=1, all bits go to fine energy except for a single sign bit */ /* For N=1, all bits go to fine energy except for a single sign bit */