[FFmpeg-devel] [PATCH 2/7] avcodec/h261dec, vc1dec: Don't set write-only macroblock dimensions
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Sat Oct 7 03:40:26 EEST 2023
They are generally set in ff_mpv_init_context_frame()
(mostly called by ff_mpv_common_init()); setting them
somewhere else should be avoided.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavcodec/h261dec.c | 6 ------
libavcodec/vc1dec.c | 3 ---
2 files changed, 9 deletions(-)
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 447e168c4f..a4e0bf9cf2 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -530,17 +530,11 @@ static int h261_decode_picture_header(H261DecContext *h)
if (format == 0) { // QCIF
s->width = 176;
s->height = 144;
- s->mb_width = 11;
- s->mb_height = 9;
} else { // CIF
s->width = 352;
s->height = 288;
- s->mb_width = 22;
- s->mb_height = 18;
}
- s->mb_num = s->mb_width * s->mb_height;
-
skip_bits1(&s->gb); /* still image mode off */
skip_bits1(&s->gb); /* Reserved */
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 534128d6ee..58a50f085d 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -741,9 +741,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if (v->matrix_coef == 1 || v->matrix_coef == 6 || v->matrix_coef == 7)
avctx->colorspace = v->matrix_coef;
- s->mb_width = (avctx->coded_width + 15) >> 4;
- s->mb_height = (avctx->coded_height + 15) >> 4;
-
if (v->profile == PROFILE_ADVANCED || v->res_fasttx) {
ff_vc1_init_transposed_scantables(v);
} else {
--
2.34.1
More information about the ffmpeg-devel
mailing list