From f4b1f8408fd37bdddcf66bf6ff4526f293a1c007 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 1 Jul 2024 19:18:06 +0200 Subject: [PATCH 12/30] avcodec/msmpeg4dec: Don't process unnecessarily many coefficients This code has been added in f5957f3fe2b8dfda13a9750acc3e3a03cd5d39c9 when support for WMV1 has been added. It was needed for decoding inter macroblocks, as WMV1 uses a different scantable and the ScanTable and ScanTable.raster_end was not yet introduced (the H263 unquantize function instead used a hardcoded version of ff_zigzag_direct's raster_end). In other words, there is no reason to continue to do so for WMV1 inter blocks. (Apart from that: WMV1 inter blocks don't use dct_unquantize_h263_inter any more, as unquantizing happens when parsing the block via specialized RL VLC tables.) It is also not needed for WMV1/2 intra blocks (for non-ac_pred it uses the correct ScanTable used by the h263 unquantize intra function; for ac_pred, the number is overridden) as well as for WMV2 inter-blocks (raster_end is not really used in this case; the ordinary ScanTable is used in case abt_type is zero, otherwise there are two different ScanTables and block_last_index is overridden in wmv2dec.c). Signed-off-by: Andreas Rheinhardt --- libavcodec/msmpeg4dec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index 12bef4f506..da65ea797f 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -806,7 +806,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, i = 63; /* XXX: not optimal */ } } - if (s->msmpeg4_version >= MSMP4_WMV1 && i > 0) i=63; //FIXME/XXX optimize s->block_last_index[n] = i; return 0; -- 2.45.2