[FFmpeg-cvslog] avcodec/aacpsy: clip global_quality within the psy_vbr_map array boundaries

James Almer git at videolan.org
Sun Apr 16 17:40:16 EEST 2023


ffmpeg | branch: release/5.1 | James Almer <jamrial at gmail.com> | Thu Apr 13 09:58:25 2023 -0300| [58912f665ba317abb13dedd8c00432496afd76a4] | committer: James Almer

avcodec/aacpsy: clip global_quality within the psy_vbr_map array boundaries

Fixes ticket #10317.

Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 5cda6b94f45c347805cbd5a0c7ed1d712b5722d7)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58912f665ba317abb13dedd8c00432496afd76a4
---

 libavcodec/aacpsy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index 4c5ab2c9d5..933369e445 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -267,7 +267,7 @@ static av_cold void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx)
         AacPsyChannel *pch = &ctx->ch[i];
 
         if (avctx->flags & AV_CODEC_FLAG_QSCALE)
-            pch->attack_threshold = psy_vbr_map[avctx->global_quality / FF_QP2LAMBDA].st_lrm;
+            pch->attack_threshold = psy_vbr_map[av_clip(avctx->global_quality / FF_QP2LAMBDA, 0, 10)].st_lrm;
         else
             pch->attack_threshold = lame_calc_attack_threshold(avctx->bit_rate / avctx->ch_layout.nb_channels / 1000);
 



More information about the ffmpeg-cvslog mailing list