The ff_dca_vlc_transition_mode VLCs don't use an offset at all, so just use ordinary VLCs for them.
Unified · Split
| @@ -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 | ||
| @@ -1233,7 +1233,7 @@ static const uint8_t rsd_bitvals[18] = { · 1232 unmodified lines | |||
| 1233 | }; | 1233 | }; |
| 1234 | 1234 | ||
| 1235 | DCAVLC ff_dca_vlc_bit_allocation; | 1235 | DCAVLC ff_dca_vlc_bit_allocation; |
| 1236 | DCAVLC ff_dca_vlc_transition_mode; | 1236 | VLC ff_dca_vlc_transition_mode[4]; |
| 1237 | DCAVLC ff_dca_vlc_scale_factor; | 1237 | DCAVLC ff_dca_vlc_scale_factor; |
| 1238 | DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; | 1238 | DCAVLC 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++) { |
| @@ -40,7 +40,7 @@ typedef struct DCAVLC { · 39 unmodified lines | |||
| 40 | } DCAVLC; | 40 | } DCAVLC; |
| 41 | 41 | ||
| 42 | extern DCAVLC ff_dca_vlc_bit_allocation; | 42 | extern DCAVLC ff_dca_vlc_bit_allocation; |
| 43 | extern DCAVLC ff_dca_vlc_transition_mode; | 43 | extern VLC ff_dca_vlc_transition_mode[4]; |
| 44 | extern DCAVLC ff_dca_vlc_scale_factor; | 44 | extern DCAVLC ff_dca_vlc_scale_factor; |
| 45 | extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; | 45 | extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; |
| 46 | 46 | ||