History

avcodec/lagarith: Avoid unnecessary VLC structure

Everything besides VLC.table is basically write-only and even VLC.table can be removed by accessing the underlying table directly.

Andreas Rheinhardt committed 3 years ago

Commit 0a610e21 parent e3ad5b91 file · +4 −4Browse files

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

Unified · Split

libavcodec/lagarith.c+4−4
@@ -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
63static VLC lag_tab;63static VLCElem lag_tab[1 << VLC_BITS];
64 64
65static const uint8_t lag_bits[] = {65static 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
86static av_cold void lag_init_static_data(void)86static 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;

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