History

avcodec/mpeg4videodec: Use VLC symbol table

Possible now that MB_TYPE_L1 (which does not fit into an int16_t) is no longer used).

Andreas Rheinhardt committed 2 years ago

Commit e7d63001 parent f161d941 file · +5 −5Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mpeg4videodec.c+5−5
@@ -67,7 +67,7 @@ static VLCElem studio_chroma_dc[528]; · 66 unmodified lines
6767
6868 static const uint8_t mpeg4_block_count[4] = { 0, 6, 8, 12 };
6969
70−static const int mb_type_b_map[4] = {
70+static const int16_t mb_type_b_map[4] = {
7171 MB_TYPE_DIRECT2 | MB_TYPE_BIDIR_MV,
7272 MB_TYPE_BIDIR_MV | MB_TYPE_16x16,
7373 MB_TYPE_BACKWARD_MV | MB_TYPE_16x16,
@@ -1845,7 +1845,6 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 1771 unmodified lines
18451845 av_log(s->avctx, AV_LOG_ERROR, "illegal MB_type\n");
18461846 return AVERROR_INVALIDDATA;
18471847 }
1848− mb_type = mb_type_b_map[mb_type];
18491848 if (modb2) {
18501849 cbp = 0;
18511850 } else {
@@ -3794,9 +3793,10 @@ static av_cold void mpeg4_init_static(void) · 1942 unmodified lines
37943793 VLC_INIT_STATIC_TABLE_FROM_LENGTHS(sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
37953794 ff_sprite_trajectory_lens, 1,
37963795 NULL, 0, 0, 0, 0);
3797− VLC_INIT_STATIC_TABLE(mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
3798− &ff_mb_type_b_tab[0][1], 2, 1,
3799− &ff_mb_type_b_tab[0][0], 2, 1, 0);
3796+ VLC_INIT_STATIC_SPARSE_TABLE(mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
3797+ &ff_mb_type_b_tab[0][1], 2, 1,
3798+ &ff_mb_type_b_tab[0][0], 2, 1,
3799+ mb_type_b_map, 2, 2, 0);
38003800 }
38013801
38023802 static av_cold int decode_init(AVCodecContext *avctx)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t