[FFmpeg-cvslog] avcodec/h261dec: Don't use MpegEncContext.block
Andreas Rheinhardt
git at videolan.org
Thu Jul 3 21:55:28 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Jun 15 22:49:01 2025 +0200| [21c88b29f7ff662c26f15a63f551e594519a9b22] | committer: Andreas Rheinhardt
avcodec/h261dec: Don't use MpegEncContext.block
Instead put it into H261DecContext. This is in preparation
for removing MpegEncContext.block.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21c88b29f7ff662c26f15a63f551e594519a9b22
---
libavcodec/h261dec.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 50fc375c26..e47bc00a71 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -25,6 +25,7 @@
* H.261 decoder.
*/
+#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec_internal.h"
@@ -62,6 +63,8 @@ typedef struct H261DecContext {
int current_mv_y;
int gob_number;
int gob_start_code_skipped; // 1 if gob start code is already read before gob header is read
+
+ DECLARE_ALIGNED_32(int16_t, block)[6][64];
} H261DecContext;
static av_cold void h261_decode_init_static(void)
@@ -213,7 +216,7 @@ static int h261_decode_mb_skipped(H261DecContext *h, int mba1, int mba2)
s->cur_pic.motion_val[0][b_xy][1] = s->mv[0][0][1];
}
- ff_mpv_reconstruct_mb(s, s->block);
+ ff_mpv_reconstruct_mb(s, h->block);
}
return 0;
@@ -446,9 +449,9 @@ static int h261_decode_mb(H261DecContext *h)
intra:
/* decode each block */
if (s->mb_intra || HAS_CBP(com->mtype)) {
- s->bdsp.clear_blocks(s->block[0]);
+ s->bdsp.clear_blocks(h->block[0]);
for (i = 0; i < 6; i++) {
- if (h261_decode_block(h, s->block[i], i, cbp & 32) < 0)
+ if (h261_decode_block(h, h->block[i], i, cbp & 32) < 0)
return SLICE_ERROR;
cbp += cbp;
}
@@ -457,7 +460,7 @@ intra:
s->block_last_index[i] = -1;
}
- ff_mpv_reconstruct_mb(s, s->block);
+ ff_mpv_reconstruct_mb(s, h->block);
return SLICE_OK;
}
More information about the ffmpeg-cvslog
mailing list