1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/h261dec: Don't call ff_set_qscale()

Most of what it does is unneeded for H.261.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-01 21:32:51 +01:00
parent 0c7e34856d
commit 7abc9c5e3d

View File

@ -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"); av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n");
if (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_COMPLIANT)) if (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_COMPLIANT))
return -1; return -1;
s->qscale = 1;
} }
/* For the first transmitted macroblock in a GOB, MBA is the absolute /* 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 // Read mquant
if (IS_QUANT(com->mtype)) if (IS_QUANT(com->mtype)) {
ff_set_qscale(s, get_bits(&s->gb, 5)); s->qscale = get_bits(&s->gb, 5);
if (!s->qscale)
s->qscale = 1;
}
s->mb_intra = IS_INTRA4x4(com->mtype); s->mb_intra = IS_INTRA4x4(com->mtype);
@ -511,8 +515,6 @@ static int h261_decode_gob(H261DecContext *h)
{ {
MpegEncContext *const s = &h->s; MpegEncContext *const s = &h->s;
ff_set_qscale(s, s->qscale);
/* decode mb's */ /* decode mb's */
while (h->current_mba <= MBA_STUFFING) { while (h->current_mba <= MBA_STUFFING) {
int ret; int ret;