1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00

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@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-06-11 06:26:07 +02:00
parent 85cc6478b6
commit f8b8f16163

View File

@ -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);