In CVBR mode the rate selection was failing to add bytes which were about to fall off the end of the bitres and never be reusable, causing undershoot.
This commit is contained in:
parent
5677e34fde
commit
d85018cb54
1 changed files with 3 additions and 4 deletions
|
@ -1164,9 +1164,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
|
|||
|
||||
nbAvailableBytes = target+(1<<(BITRES+2))>>(BITRES+3);
|
||||
nbAvailableBytes = IMAX(min_allowed,nbAvailableBytes);
|
||||
|
||||
nbCompressedBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes);
|
||||
nbAvailableBytes = nbCompressedBytes - nbFilledBytes;
|
||||
nbAvailableBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes) - nbFilledBytes;
|
||||
|
||||
target=nbAvailableBytes<<(BITRES+3);
|
||||
|
||||
|
@ -1194,6 +1192,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
|
|||
st->vbr_reservoir = 0;
|
||||
/*printf ("+%d\n", adjust);*/
|
||||
}
|
||||
nbCompressedBytes = IMIN(nbCompressedBytes,nbAvailableBytes+nbFilledBytes);
|
||||
|
||||
/* This moves the raw bits to take into account the new compressed size */
|
||||
ec_byte_shrink(&buf, nbCompressedBytes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue