Everything besides VLC.table is basically write-only and even VLC.table can be removed by accessing the underlying table directly.
Unified · Split
| @@ -60,7 +60,7 @@ typedef struct LagarithContext { · 59 unmodified lines | |||
| 60 | int zeros_rem; /**< number of zero bytes remaining to output */ | 60 | int zeros_rem; /**< number of zero bytes remaining to output */ |
| 61 | } LagarithContext; | 61 | } LagarithContext; |
| 62 | 62 | ||
| 63 | static VLC lag_tab; | 63 | static VLCElem lag_tab[1 << VLC_BITS]; |
| 64 | 64 | ||
| 65 | static const uint8_t lag_bits[] = { | 65 | static const uint8_t lag_bits[] = { |
| 66 | 7, 7, 2, 7, 3, 4, 5, 6, 7, 7, 7, 7, 7, 6, 7, 4, 5, 7, 7, 7, 7, | 66 | 7, 7, 2, 7, 3, 4, 5, 6, 7, 7, 7, 7, 7, 6, 7, 4, 5, 7, 7, 7, 7, |
| @@ -85,8 +85,8 @@ static const uint8_t lag_symbols[] = { · 18 unmodified lines | |||
| 85 | 85 | ||
| 86 | static av_cold void lag_init_static_data(void) | 86 | static av_cold void lag_init_static_data(void) |
| 87 | { | 87 | { |
| 88 | VLC_INIT_SPARSE_STATIC(&lag_tab, VLC_BITS, FF_ARRAY_ELEMS(lag_bits), | 88 | VLC_INIT_STATIC_SPARSE_TABLE(lag_tab, VLC_BITS, FF_ARRAY_ELEMS(lag_bits), |
| 89 | lag_bits, 1, 1, lag_codes, 1, 1, lag_symbols, 1, 1, 128); | 89 | lag_bits, 1, 1, lag_codes, 1, 1, lag_symbols, 1, 1, 0); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | /** | 92 | /** |
| @@ -136,7 +136,7 @@ static int lag_decode_prob(GetBitContext *gb, uint32_t *value) · 43 unmodified lines | |||
| 136 | { | 136 | { |
| 137 | unsigned val, bits; | 137 | unsigned val, bits; |
| 138 | 138 | ||
| 139 | bits = get_vlc2(gb, lag_tab.table, VLC_BITS, 1); | 139 | bits = get_vlc2(gb, lag_tab, VLC_BITS, 1); |
| 140 | if (bits > 31) { | 140 | if (bits > 31) { |
| 141 | *value = 0; | 141 | *value = 0; |
| 142 | return AVERROR_INVALIDDATA; | 142 | return AVERROR_INVALIDDATA; |