History

avcodec/vqcdec: 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 36e7f9b1 parent 99ed5101 file · +7 −6Browse files

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

Unified · Split

libavcodec/vqcdec.c+7−6
@@ -49,14 +49,15 @@ static const int8_t vector_symbols[] = { · 48 unmodified lines
49 2, 3, 4, SIGNED_8BIT, -2, -3, -4, SIGNED_6BIT49 2, 3, 4, SIGNED_8BIT, -2, -3, -4, SIGNED_6BIT
50};50};
51 51
52static VLC vector_vlc;52static VLCElem vector_vlc[1 << VECTOR_VLC_BITS];
53 53
54static av_cold void vqc_init_static_data(void)54static av_cold void vqc_init_static_data(void)
55{55{
56 VLC_INIT_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits),56 VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vector_vlc, VECTOR_VLC_BITS,
57 vector_nbits, 1,57 FF_ARRAY_ELEMS(vector_nbits),
58 vector_symbols, 1, 1,58 vector_nbits, 1,
59 0, 0, 1 << VECTOR_VLC_BITS);59 vector_symbols, 1, 1,
60 0, 0);
60}61}
61 62
62typedef struct VqcContext {63typedef struct VqcContext {
@@ -171,7 +172,7 @@ static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int wid · 108 unmodified lines
171 continue;172 continue;
172 }173 }
173 174
174 symbol = get_vlc2(&gb, vector_vlc.table, VECTOR_VLC_BITS, 1);175 symbol = get_vlc2(&gb, vector_vlc, VECTOR_VLC_BITS, 1);
175 switch(symbol) {176 switch(symbol) {
176 case SKIP_3: dst += 3; break;177 case SKIP_3: dst += 3; break;
177 case SKIP_4: dst += 4; break;178 case SKIP_4: dst += 4; break;

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