diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-03 05:07:44 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-20 18:58:38 +0200 |
commit | 010951239c6de2d32d6572d1390cdaf8f6c63452 (patch) | |
tree | da35b8220ee940039c13f488af0b7960c3bb6f32 /libavcodec/mpeg12dec.c | |
parent | e7d6300c10834b782a2e2b274d4a9f1fc4cf8efe (diff) | |
download | ffmpeg-010951239c6de2d32d6572d1390cdaf8f6c63452.tar.gz |
avcodec/mpeg12dec: Use VLC symbol table
Possible by using MB_TYPE_CODEC_SPECIFIC for MB_TYPE_ZERO_MV
and due to the MB_TYPE_*_MV flags fitting into an int16_t.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpeg12dec.c')
-rw-r--r-- | libavcodec/mpeg12dec.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 601106138e..e0e9a8fb1e 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -93,32 +93,6 @@ typedef struct Mpeg1Context { int64_t timecode_frame_start; /*< GOP timecode frame start number, in non drop frame format */ } Mpeg1Context; -#define MB_TYPE_ZERO_MV 0x20000000 - -static const uint32_t ptype2mb_type[7] = { - MB_TYPE_INTRA, - MB_TYPE_FORWARD_MV | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, - MB_TYPE_FORWARD_MV, - MB_TYPE_FORWARD_MV | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_INTRA, - MB_TYPE_QUANT | MB_TYPE_FORWARD_MV | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, - MB_TYPE_QUANT | MB_TYPE_FORWARD_MV | MB_TYPE_CBP, -}; - -static const uint32_t btype2mb_type[11] = { - MB_TYPE_INTRA, - MB_TYPE_BACKWARD_MV, - MB_TYPE_BACKWARD_MV | MB_TYPE_CBP, - MB_TYPE_FORWARD_MV, - MB_TYPE_FORWARD_MV | MB_TYPE_CBP, - MB_TYPE_BIDIR_MV, - MB_TYPE_BIDIR_MV | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_INTRA, - MB_TYPE_QUANT | MB_TYPE_BACKWARD_MV | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_FORWARD_MV | MB_TYPE_CBP, - MB_TYPE_QUANT | MB_TYPE_BIDIR_MV | MB_TYPE_CBP, -}; - /* as H.263, but only 17 codes */ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred) { @@ -483,7 +457,6 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) "Invalid mb type in P-frame at %d %d\n", s->mb_x, s->mb_y); return AVERROR_INVALIDDATA; } - mb_type = ptype2mb_type[mb_type]; break; case AV_PICTURE_TYPE_B: mb_type = get_vlc2(&s->gb, ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 1); @@ -492,7 +465,6 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) "Invalid mb type in B-frame at %d %d\n", s->mb_x, s->mb_y); return AVERROR_INVALIDDATA; } - mb_type = btype2mb_type[mb_type]; break; } ff_tlog(s->avctx, "mb_type=%x\n", mb_type); |