History

avcodec/dca_core, dcahuff: Don't use DCAVLC unnecessarily

The ff_dca_vlc_transition_mode VLCs don't use an offset at all, so just use ordinary VLCs for them.

Andreas Rheinhardt committed 4 years ago

Commit 88198601 parent 649a2d83 files · +6 −7Browse files

Unified · Split

3 files
  1. libavcodec/dca_core.c +2 −1
  2. libavcodec/dcahuff.c +3 −5
  3. libavcodec/dcahuff.h +1 −1
libavcodec/dca_core.c+2−1
@@ -456,7 +456,8 @@ static int parse_subframe_header(DCACoreDecoder *s, int sf, · 455 unmodified lines
456456 int sel = s->transition_mode_sel[ch];
457457 for (band = 0; band < s->subband_vq_start[ch]; band++)
458458 if (s->bit_allocation[ch][band])
459− s->transition_mode[sf][ch][band] = dca_get_vlc(&s->gb, &ff_dca_vlc_transition_mode, sel);
459+ s->transition_mode[sf][ch][band] = get_vlc2(&s->gb, ff_dca_vlc_transition_mode[sel].table,
460+ ff_dca_vlc_transition_mode[sel].bits,1);
460461 }
461462 }
462463
libavcodec/dcahuff.c+3−5
@@ -1233,7 +1233,7 @@ static const uint8_t rsd_bitvals[18] = { · 1232 unmodified lines
12331233 };
12341234
12351235 DCAVLC ff_dca_vlc_bit_allocation;
1236−DCAVLC ff_dca_vlc_transition_mode;
1236+VLC ff_dca_vlc_transition_mode[4];
12371237 DCAVLC ff_dca_vlc_scale_factor;
12381238 DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS];
12391239
@@ -1276,10 +1276,8 @@ av_cold void ff_dca_init_vlcs(void) · 36 unmodified lines
12761276 DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129,
12771277 scales_bits[i], scales_codes[i]);
12781278
1279− ff_dca_vlc_transition_mode.offset = 0;
1280− ff_dca_vlc_transition_mode.max_depth = 1;
1281− for (i = 0; i < 4; i++)
1282− DCA_INIT_VLC(ff_dca_vlc_transition_mode.vlc[i], tmode_vlc_bits[i], 4,
1279+ for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++)
1280+ DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], tmode_vlc_bits[i], 4,
12831281 tmode_bits[i], tmode_codes[i]);
12841282
12851283 for (i = 0; i < DCA_CODE_BOOKS; i++) {
libavcodec/dcahuff.h+1−1
@@ -40,7 +40,7 @@ typedef struct DCAVLC { · 39 unmodified lines
4040 } DCAVLC;
4141
4242 extern DCAVLC ff_dca_vlc_bit_allocation;
43−extern DCAVLC ff_dca_vlc_transition_mode;
43+extern VLC ff_dca_vlc_transition_mode[4];
4444 extern DCAVLC ff_dca_vlc_scale_factor;
4545 extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS];
4646

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