Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/celt
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-07-11 00:43:33 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-07-13 00:06:59 +0300
commit1736ae3f5e3a2772190f72f8ad29778b20235304 (patch)
treee0045ec9f4d38d1ef77b45ef3538163ba5c56edf /celt
parentaa8b99cbc3f52d7e0916fb503993d44f7c0c7553 (diff)
Properly account for SILK bits in CELT CBR code
CELT encoding would just fail when setting CELT to CBR in hybrid mode. It was never a problem because hybrid CBR was always used with OPUS_BITRATE_MAX.
Diffstat (limited to 'celt')
-rw-r--r--celt/celt_encoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c
index 637d442c..d8df7e78 100644
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1565,7 +1565,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
vbr_rate = 0;
tmp = st->bitrate*frame_size;
if (tell>1)
- tmp += tell;
+ tmp += tell*mode->Fs;
if (st->bitrate!=OPUS_BITRATE_MAX)
nbCompressedBytes = IMAX(2, IMIN(nbCompressedBytes,
(tmp+4*mode->Fs)/(8*mode->Fs)-!!st->signalling));