diff --git a/libcelt/celt.c b/libcelt/celt.c index 26bf0c44..acdcead0 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -940,7 +940,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c target=target+st->vbr_offset-(50<vbr_count < 990) { @@ -951,7 +951,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c alpha = QCONST16(.001f,15); /* By how much did we "miss" the target on that frame */ - delta = (8<vbr_reservoir += delta; /*printf ("%d\n", st->vbr_reservoir);*/ @@ -970,8 +970,8 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c target += adjust; /*printf ("+%d\n", adjust);*/ } - if (target < nbAvailableBytes) - nbAvailableBytes = target; + if (nbAvailableBytes > target>>(BITRES+3)) + nbAvailableBytes = target>>(BITRES+3); nbCompressedBytes = nbAvailableBytes + nbFilledBytes; /* This moves the raw bits to take into account the new compressed size */