[FFmpeg-cvslog] avcodec/mpegvideo_enc: Don't update qscale unnecessarily
Andreas Rheinhardt
git at videolan.org
Thu Jun 20 20:00:14 EEST 2024
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Jun 11 06:26:07 2024 +0200| [f8b8f161634c5917b7cddbb3dd37440afd9105f9] | committer: Andreas Rheinhardt
avcodec/mpegvideo_enc: Don't update qscale unnecessarily
The new value will be overwritten in ff_set_qscale() below.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8b8f161634c5917b7cddbb3dd37440afd9105f9
---
libavcodec/mpegvideo_enc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 6d26b2d619..125d16e694 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2163,11 +2163,11 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
const int mb_xy = mb_x + mb_y * s->mb_stride;
s->lambda = s->lambda_table[mb_xy];
- update_qscale(s);
+ s->lambda2 = (s->lambda * s->lambda + FF_LAMBDA_SCALE / 2) >>
+ FF_LAMBDA_SHIFT;
if (!(s->mpv_flags & FF_MPV_FLAG_QP_RD)) {
- s->qscale = s->cur_pic.qscale_table[mb_xy];
- s->dquant = s->qscale - last_qp;
+ s->dquant = s->cur_pic.qscale_table[mb_xy] - last_qp;
if (s->out_format == FMT_H263) {
s->dquant = av_clip(s->dquant, -2, 2);
More information about the ffmpeg-cvslog
mailing list