History

avcodec/atrac3plus: Perform reusing of VLCs during init

Andreas Rheinhardt committed 6 years ago

Commit 5f8de7b1 parent 38afc681 file · +3 −7Browse files

Unified · Split

libavcodec/atrac3plus.c+3−7
@@ -192,12 +192,12 @@ av_cold void ff_atrac3p_init_vlcs(void) · 191 unmodified lines
192192
193193 /* build huffman tables for spectrum decoding */
194194 for (i = 0; i < 112; i++) {
195− if (atrac3p_spectra_tabs[i].cb)
195+ if (atrac3p_spectra_tabs[i].redirect < 0)
196196 build_canonical_huff(atrac3p_spectra_tabs[i].cb,
197197 atrac3p_spectra_tabs[i].xlat,
198198 &tab_offset, &spec_vlc_tabs[i]);
199− else
200− spec_vlc_tabs[i].table = 0;
199+ else /* Reuse already initialized VLC table */
200+ spec_vlc_tabs[i] = spec_vlc_tabs[atrac3p_spectra_tabs[i].redirect];
201201 }
202202
203203 /* build huffman tables for gain data decoding */
@@ -880,10 +880,6 @@ static void decode_spectrum(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, · 676 unmodified lines
880880 tab_index = (chan->table_type * 8 + codetab) * 7 + wordlen - 1;
881881 tab = &atrac3p_spectra_tabs[tab_index];
882882
883− /* this allows reusing VLC tables */
884− if (tab->redirect >= 0)
885− tab_index = tab->redirect;
886−
887883 decode_qu_spectra(gb, tab, &spec_vlc_tabs[tab_index],
888884 &chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]],
889885 num_specs);

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