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
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-12-16 21:01:20 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-12-20 12:02:35 +0300
commite9de8b0be9072730a8f68dde1ae524c343dab414 (patch)
tree3b71e9e4cbdade51cfca063bd2a3b121932275e2
parentad8c441403a545073c082772f043b57e3a9a8a13 (diff)
divide max payload tooexp_multiframe_cleanup3
-rw-r--r--src/opus_encoder.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 5b73d639..cf9aaf86 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1569,8 +1569,9 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
frame_to_celt = to_celt && i==nb_frames-1;
frame_redundancy = redundancy && (frame_to_celt || (!to_celt && i==0));
- curr_max = 3*st->bitrate_bps/(3*8*st->Fs/enc_frame_size);
+ curr_max = IMIN(3*st->bitrate_bps/(3*8*st->Fs/enc_frame_size), max_len_sum/nb_frames);
#ifdef ENABLE_DRED
+ curr_max = IMIN(curr_max, (max_len_sum-3*dred_bitrate_bps/(3*8*st->Fs/frame_size))/nb_frames);
if (first_frame) curr_max += 3*dred_bitrate_bps/(3*8*st->Fs/frame_size);
#endif
curr_max = IMIN(max_len_sum-tot_size, curr_max);