[FFmpeg-cvslog] avcodec/h261dec: Don't call ff_set_qscale()
Andreas Rheinhardt
git at videolan.org
Fri Mar 7 16:21:19 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Mar 1 21:32:51 2025 +0100| [7abc9c5e3d120ffa48d7312e0351cf7627bea9c8] | committer: Andreas Rheinhardt
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 at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7abc9c5e3d120ffa48d7312e0351cf7627bea9c8
---
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;
More information about the ffmpeg-cvslog
mailing list