Merge pull request #323 from marcan/opus-bugfix

opus: fix equivalent bitrate calculation for <20ms frame sizes
This commit is contained in:
Volker Fischer 2020-06-04 09:36:32 +02:00 committed by GitHub
commit 667c2cc461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1571,7 +1571,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
(tmp+4*mode->Fs)/(8*mode->Fs)-!!st->signalling)); (tmp+4*mode->Fs)/(8*mode->Fs)-!!st->signalling));
effectiveBytes = nbCompressedBytes - nbFilledBytes; effectiveBytes = nbCompressedBytes - nbFilledBytes;
} }
equiv_rate = ((opus_int32)nbCompressedBytes*8*50 >> (3-LM)) - (40*C+20)*((400>>LM) - 50); equiv_rate = ((opus_int32)nbCompressedBytes*8*50 << (3-LM)) - (40*C+20)*((400>>LM) - 50);
if (st->bitrate != OPUS_BITRATE_MAX) if (st->bitrate != OPUS_BITRATE_MAX)
equiv_rate = IMIN(equiv_rate, st->bitrate - (40*C+20)*((400>>LM) - 50)); equiv_rate = IMIN(equiv_rate, st->bitrate - (40*C+20)*((400>>LM) - 50));