From 76406cfcd9adf55fcf5a17e2e5992e29bacf79fd Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sat, 1 Mar 2025 21:32:51 +0100 Subject: [PATCH 08/40] avcodec/h261dec: Don't call ff_set_qscale() Most of what it does is unneeded for H.261. Signed-off-by: Andreas Rheinhardt --- libavcodec/h261dec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 8a2c4d35b4..c32ddd2ddf 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -155,6 +155,7 @@ static int h261_decode_gob_header(H261DecContext *h) av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n"); if (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_COMPLIANT)) return -1; + s->qscale = 1; } /* For the first transmitted macroblock in a GOB, MBA is the absolute @@ -380,8 +381,11 @@ static int h261_decode_mb(H261DecContext *h) } // Read mquant - if (IS_QUANT(com->mtype)) - ff_set_qscale(s, get_bits(&s->gb, 5)); + if (IS_QUANT(com->mtype)) { + s->qscale = get_bits(&s->gb, 5); + if (!s->qscale) + s->qscale = 1; + } s->mb_intra = IS_INTRA4x4(com->mtype); @@ -511,8 +515,6 @@ static int h261_decode_gob(H261DecContext *h) { MpegEncContext *const s = &h->s; - ff_set_qscale(s, s->qscale); - /* decode mb's */ while (h->current_mba <= MBA_STUFFING) { int ret; -- 2.45.2