DCA core decoder no longer uses fixed tables for channel reordering. Move them into private encoder header (and drop ff_dca_ prefix). Signed-off-by: James Almer <jamrial@gmail.com>tags/n3.1
| @@ -8730,48 +8730,6 @@ const int32_t ff_dca_sampling_freqs[16] = { | |||||
| 176400, 352800, 12000, 24000, 48000, 96000, 192000, 384000, | 176400, 352800, 12000, 24000, 48000, 96000, 192000, 384000, | ||||
| }; | }; | ||||
| const int8_t ff_dca_lfe_index[16] = { | |||||
| 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3 | |||||
| }; | |||||
| const int8_t ff_dca_channel_reorder_lfe[16][9] = { | |||||
| { 0, -1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 3, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 4, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 3, 4, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 4, 5, -1, -1, -1, -1 }, | |||||
| { 3, 4, 0, 1, 5, 6, -1, -1, -1 }, | |||||
| { 2, 0, 1, 4, 5, 6, -1, -1, -1 }, | |||||
| { 0, 6, 4, 5, 2, 3, -1, -1, -1 }, | |||||
| { 4, 2, 5, 0, 1, 6, 7, -1, -1 }, | |||||
| { 5, 6, 0, 1, 7, 3, 8, 4, -1 }, | |||||
| { 4, 2, 5, 0, 1, 6, 8, 7, -1 }, | |||||
| }; | |||||
| const int8_t ff_dca_channel_reorder_nolfe[16][9] = { | |||||
| { 0, -1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 3, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 2, 3, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 3, 4, -1, -1, -1, -1 }, | |||||
| { 2, 3, 0, 1, 4, 5, -1, -1, -1 }, | |||||
| { 2, 0, 1, 3, 4, 5, -1, -1, -1 }, | |||||
| { 0, 5, 3, 4, 1, 2, -1, -1, -1 }, | |||||
| { 3, 2, 4, 0, 1, 5, 6, -1, -1 }, | |||||
| { 4, 5, 0, 1, 6, 2, 7, 3, -1 }, | |||||
| { 3, 2, 4, 0, 1, 5, 7, 6, -1 }, | |||||
| }; | |||||
| const uint16_t ff_dca_vlc_offs[63] = { | const uint16_t ff_dca_vlc_offs[63] = { | ||||
| 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364, | 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364, | ||||
| 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508, | 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508, | ||||
| @@ -73,11 +73,6 @@ extern const int32_t ff_dca_xll_band_coeff[20]; | |||||
| extern const int32_t ff_dca_sampling_freqs[16]; | extern const int32_t ff_dca_sampling_freqs[16]; | ||||
| extern const int8_t ff_dca_lfe_index[16]; | |||||
| extern const int8_t ff_dca_channel_reorder_lfe[16][9]; | |||||
| extern const int8_t ff_dca_channel_reorder_nolfe[16][9]; | |||||
| extern const uint16_t ff_dca_vlc_offs[63]; | extern const uint16_t ff_dca_vlc_offs[63]; | ||||
| #endif /* AVCODEC_DCADATA_H */ | #endif /* AVCODEC_DCADATA_H */ | ||||
| @@ -137,9 +137,9 @@ static int encode_init(AVCodecContext *avctx) | |||||
| if (c->lfe_channel) { | if (c->lfe_channel) { | ||||
| c->fullband_channels--; | c->fullband_channels--; | ||||
| c->channel_order_tab = ff_dca_channel_reorder_lfe[c->channel_config]; | |||||
| c->channel_order_tab = channel_reorder_lfe[c->channel_config]; | |||||
| } else { | } else { | ||||
| c->channel_order_tab = ff_dca_channel_reorder_nolfe[c->channel_config]; | |||||
| c->channel_order_tab = channel_reorder_nolfe[c->channel_config]; | |||||
| } | } | ||||
| for (i = 0; i < 9; i++) { | for (i = 0; i < 9; i++) { | ||||
| @@ -303,7 +303,7 @@ static void subband_transform(DCAEncContext *c, const int32_t *input) | |||||
| static void lfe_downsample(DCAEncContext *c, const int32_t *input) | static void lfe_downsample(DCAEncContext *c, const int32_t *input) | ||||
| { | { | ||||
| /* FIXME: make 128x LFE downsampling possible */ | /* FIXME: make 128x LFE downsampling possible */ | ||||
| const int lfech = ff_dca_lfe_index[c->channel_config]; | |||||
| const int lfech = lfe_index[c->channel_config]; | |||||
| int i, j, lfes; | int i, j, lfes; | ||||
| int32_t hist[512]; | int32_t hist[512]; | ||||
| int32_t accum; | int32_t accum; | ||||
| @@ -103,4 +103,46 @@ static const int bit_consumption[27] = { | |||||
| 272, 288, 304, 320, 336, 352, 368, | 272, 288, 304, 320, 336, 352, 368, | ||||
| }; | }; | ||||
| static const int8_t lfe_index[16] = { | |||||
| 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3 | |||||
| }; | |||||
| static const int8_t channel_reorder_lfe[16][9] = { | |||||
| { 0, -1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 3, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 4, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 3, 4, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 4, 5, -1, -1, -1, -1 }, | |||||
| { 3, 4, 0, 1, 5, 6, -1, -1, -1 }, | |||||
| { 2, 0, 1, 4, 5, 6, -1, -1, -1 }, | |||||
| { 0, 6, 4, 5, 2, 3, -1, -1, -1 }, | |||||
| { 4, 2, 5, 0, 1, 6, 7, -1, -1 }, | |||||
| { 5, 6, 0, 1, 7, 3, 8, 4, -1 }, | |||||
| { 4, 2, 5, 0, 1, 6, 8, 7, -1 }, | |||||
| }; | |||||
| static const int8_t channel_reorder_nolfe[16][9] = { | |||||
| { 0, -1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, -1, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 3, -1, -1, -1, -1, -1 }, | |||||
| { 0, 1, 2, 3, -1, -1, -1, -1, -1 }, | |||||
| { 2, 0, 1, 3, 4, -1, -1, -1, -1 }, | |||||
| { 2, 3, 0, 1, 4, 5, -1, -1, -1 }, | |||||
| { 2, 0, 1, 3, 4, 5, -1, -1, -1 }, | |||||
| { 0, 5, 3, 4, 1, 2, -1, -1, -1 }, | |||||
| { 3, 2, 4, 0, 1, 5, 6, -1, -1 }, | |||||
| { 4, 5, 0, 1, 6, 2, 7, 3, -1 }, | |||||
| { 3, 2, 4, 0, 1, 5, 7, 6, -1 }, | |||||
| }; | |||||
| #endif /* AVCODEC_DCAENC_H */ | #endif /* AVCODEC_DCAENC_H */ | ||||