[FFmpeg-devel] [PATCH 10/48] avcodec/mpegvideodec: Remove size expectation from ff_mpv_reconstruct_mb

Andreas Rheinhardt ffmpegagent at gmail.com
Mon Jun 23 16:36:10 EEST 2025


From: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

In the common case of decoding 420 content, only six blocks are used
and it makes perfect sense for the caller to only have that many.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/mpegvideo_dec.c | 2 +-
 libavcodec/mpegvideodec.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index 928464d6c1..c4831bf85b 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -1083,7 +1083,7 @@ static av_cold void debug_dct_coeffs(MPVContext *s, const int16_t block[][64])
     }
 }
 
-void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64])
+void ff_mpv_reconstruct_mb(MPVContext *s, int16_t block[][64])
 {
     const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
     uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy];
diff --git a/libavcodec/mpegvideodec.h b/libavcodec/mpegvideodec.h
index 8bc70b02c0..5b2a38d1c8 100644
--- a/libavcodec/mpegvideodec.h
+++ b/libavcodec/mpegvideodec.h
@@ -56,7 +56,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx);
  * Ensure that the dummy frames are allocated according to pict_type if necessary.
  */
 int ff_mpv_alloc_dummy_frames(MpegEncContext *s);
-void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]);
+void ff_mpv_reconstruct_mb(MPVContext *s, int16_t block[][64]);
 void ff_mpv_frame_end(MpegEncContext *s);
 
 int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f,
-- 
ffmpeg-codebot



More information about the ffmpeg-devel mailing list