Fixed a long-standing rare mismatch
In cases where the coarse energy quantizer wasn't able to go down fast enough, we could have a negative error that didn't get clamped.
This commit is contained in:
parent
40e993c029
commit
c4ac57023c
1 changed files with 2 additions and 0 deletions
|
@ -164,6 +164,8 @@ void quant_fine_energy(const CELTMode *m, int start, celt_ener *eBands, celt_wor
|
||||||
#endif
|
#endif
|
||||||
if (q2 > frac-1)
|
if (q2 > frac-1)
|
||||||
q2 = frac-1;
|
q2 = frac-1;
|
||||||
|
if (q2<0)
|
||||||
|
q2 = 0;
|
||||||
ec_enc_bits(enc, q2, fine_quant[i]);
|
ec_enc_bits(enc, q2, fine_quant[i]);
|
||||||
#ifdef FIXED_POINT
|
#ifdef FIXED_POINT
|
||||||
offset = SUB16(SHR16(SHL16(q2,DB_SHIFT)+QCONST16(.5,DB_SHIFT),fine_quant[i]),QCONST16(.5f,DB_SHIFT));
|
offset = SUB16(SHR16(SHL16(q2,DB_SHIFT)+QCONST16(.5,DB_SHIFT),fine_quant[i]),QCONST16(.5f,DB_SHIFT));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue