[FFmpeg-cvslog] avcodec/msmpeg4dec: Don't process unnecessarily many coefficients
Andreas Rheinhardt
git at videolan.org
Tue Mar 4 14:35:15 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Jul 1 19:18:06 2024 +0200| [4912a2d88ea242baf966eaa7d55dd547d4785d0f] | committer: Andreas Rheinhardt
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 <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4912a2d88ea242baf966eaa7d55dd547d4785d0f
---
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;
More information about the ffmpeg-cvslog
mailing list