From 9bd7c1908421485aa05f353242739d0e7871325f Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 21 May 2025 15:22:39 +0200 Subject: [PATCH 19/19] avcodec/mpeg4videodec: Use union to save space At most one of block32 and dpcm_macroblock is used at any given time. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg4videodec.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpeg4videodec.h b/libavcodec/mpeg4videodec.h index 593c8ab290..ae8428fd2b 100644 --- a/libavcodec/mpeg4videodec.h +++ b/libavcodec/mpeg4videodec.h @@ -99,10 +99,12 @@ typedef struct Mpeg4DecContext { void (*dct_unquantize_h263_intra)(MpegEncContext *s, int16_t *block, int n, int qscale); - DECLARE_ALIGNED(8, int32_t, block32)[12][64]; + union { + DECLARE_ALIGNED(8, int32_t, block32)[12][64]; + int16_t dpcm_macroblock[3][256]; + }; // 0 = DCT, 1 = DPCM top to bottom scan, -1 = DPCM bottom to top scan int dpcm_direction; - int16_t dpcm_macroblock[3][256]; } Mpeg4DecContext; int ff_mpeg4_decode_picture_header(MpegEncContext *s); -- 2.45.2