prevent busting at ridiculously low bit-rate VBR

This commit is contained in:
Jean-Marc Valin 2009-10-22 00:23:56 -04:00
parent 45f1110583
commit 7a047ea096

View file

@ -770,7 +770,9 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig * pcm, celt_sig
celt_int32 vbr_bound, max_allowed; celt_int32 vbr_bound, max_allowed;
vbr_bound = st->vbr_rate; vbr_bound = st->vbr_rate;
max_allowed = (st->vbr_rate + vbr_bound - st->vbr_reservoir)>>(BITRES+3); max_allowed = (st->vbr_rate + vbr_bound - st->vbr_reservoir)>>(BITRES+3);
if (max_allowed < 4)
max_allowed = 4;
if (max_allowed < nbCompressedBytes) if (max_allowed < nbCompressedBytes)
nbCompressedBytes = max_allowed; nbCompressedBytes = max_allowed;
} }