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
456 int sel = s->transition_mode_sel[ch];456 int sel = s->transition_mode_sel[ch];
457 for (band = 0; band < s->subband_vq_start[ch]; band++)457 for (band = 0; band < s->subband_vq_start[ch]; band++)
458 if (s->bit_allocation[ch][band])458 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);
460 }461 }
461 }462 }
462 463
libavcodec/dcahuff.c+3−5
@@ -1233,7 +1233,7 @@ static const uint8_t rsd_bitvals[18] = { · 1232 unmodified lines
1233};1233};
1234 1234
1235DCAVLC ff_dca_vlc_bit_allocation;1235DCAVLC ff_dca_vlc_bit_allocation;
1236DCAVLC ff_dca_vlc_transition_mode;1236VLC ff_dca_vlc_transition_mode[4];
1237DCAVLC ff_dca_vlc_scale_factor;1237DCAVLC ff_dca_vlc_scale_factor;
1238DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS];1238DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS];
1239 1239
@@ -1276,10 +1276,8 @@ av_cold void ff_dca_init_vlcs(void) · 36 unmodified lines
1276 DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129,1276 DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129,
1277 scales_bits[i], scales_codes[i]);1277 scales_bits[i], scales_codes[i]);
1278 1278
1279 ff_dca_vlc_transition_mode.offset = 0;1279 for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++)
1280 ff_dca_vlc_transition_mode.max_depth = 1;1280 DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], tmode_vlc_bits[i], 4,
1281 for (i = 0; i < 4; i++)
1282 DCA_INIT_VLC(ff_dca_vlc_transition_mode.vlc[i], tmode_vlc_bits[i], 4,
1283 tmode_bits[i], tmode_codes[i]);1281 tmode_bits[i], tmode_codes[i]);
1284 1282
1285 for (i = 0; i < DCA_CODE_BOOKS; i++) {1283 for (i = 0; i < DCA_CODE_BOOKS; i++) {
libavcodec/dcahuff.h+1−1
@@ -40,7 +40,7 @@ typedef struct DCAVLC { · 39 unmodified lines
40} DCAVLC;40} DCAVLC;
41 41
42extern DCAVLC ff_dca_vlc_bit_allocation;42extern DCAVLC ff_dca_vlc_bit_allocation;
43extern DCAVLC ff_dca_vlc_transition_mode;43extern VLC ff_dca_vlc_transition_mode[4];
44extern DCAVLC ff_dca_vlc_scale_factor;44extern DCAVLC ff_dca_vlc_scale_factor;
45extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS];45extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS];
46 46

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