diff --git a/libavcodec/dca.c b/libavcodec/dca.c index c1b19e30e7..7ea0c41ab6 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -95,44 +95,81 @@ static const int8_t dca_lfe_index[] = { 1,2,2,2,2,3,2,3,2,3,2,3,1,3,2,3 }; -static const int8_t dca_channel_reorder_lfe[][8] = { - { 0, -1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 2, 0, 1, -1, -1, -1, -1, -1}, - { 0, 1, 3, -1, -1, -1, -1, -1}, - { 2, 0, 1, 4, -1, -1, -1, -1}, - { 0, 1, 3, 4, -1, -1, -1, -1}, - { 2, 0, 1, 4, 5, -1, -1, -1}, - { 3, 4, 0, 1, 5, 6, -1, -1}, - { 2, 0, 1, 4, 5, 6, -1, -1}, - { 0, 6, 4, 5, 2, 3, -1, -1}, - { 4, 2, 5, 0, 1, 6, 7, -1}, - { 5, 6, 0, 1, 7, 3, 8, 4}, - { 4, 2, 5, 0, 1, 6, 8, 7}, +static const int8_t dca_channel_reorder_lfe[][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 dca_channel_reorder_nolfe[][8] = { - { 0, -1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 0, 1, -1, -1, -1, -1, -1, -1}, - { 2, 0, 1, -1, -1, -1, -1, -1}, - { 0, 1, 2, -1, -1, -1, -1, -1}, - { 2, 0, 1, 3, -1, -1, -1, -1}, - { 0, 1, 2, 3, -1, -1, -1, -1}, - { 2, 0, 1, 3, 4, -1, -1, -1}, - { 2, 3, 0, 1, 4, 5, -1, -1}, - { 2, 0, 1, 3, 4, 5, -1, -1}, - { 0, 5, 3, 4, 1, 2, -1, -1}, - { 3, 2, 4, 0, 1, 5, 6, -1}, - { 4, 5, 0, 1, 6, 2, 7, 3}, - { 3, 2, 4, 0, 1, 5, 7, 6}, +static const int8_t dca_channel_reorder_lfe_xch[][9] = { + { 0, 2, -1, -1, -1, -1, -1, -1, -1}, + { 0, 1, 3, -1, -1, -1, -1, -1, -1}, + { 0, 1, 3, -1, -1, -1, -1, -1, -1}, + { 0, 1, 3, -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}, + { 0, 1, 4, 5, 3, -1, -1, -1, -1}, + { 2, 0, 1, 5, 6, 4, -1, -1, -1}, + { 3, 4, 0, 1, 6, 7, 5, -1, -1}, + { 2, 0, 1, 4, 5, 6, 7, -1, -1}, + { 0, 6, 4, 5, 2, 3, 7, -1, -1}, + { 4, 2, 5, 0, 1, 7, 8, 6, -1}, + { 5, 6, 0, 1, 8, 3, 9, 4, 7}, + { 4, 2, 5, 0, 1, 6, 9, 8, 7}, }; +static const int8_t dca_channel_reorder_nolfe[][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}, +}; + +static const int8_t dca_channel_reorder_nolfe_xch[][9] = { + { 0, 1, -1, -1, -1, -1, -1, -1, -1}, + { 0, 1, 2, -1, -1, -1, -1, -1, -1}, + { 0, 1, 2, -1, -1, -1, -1, -1, -1}, + { 0, 1, 2, -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}, + { 0, 1, 3, 4, 2, -1, -1, -1, -1}, + { 2, 0, 1, 4, 5, 3, -1, -1, -1}, + { 2, 3, 0, 1, 5, 6, 4, -1, -1}, + { 2, 0, 1, 3, 4, 5, 6, -1, -1}, + { 0, 5, 3, 4, 1, 2, 6, -1, -1}, + { 3, 2, 4, 0, 1, 6, 7, 5, -1}, + { 4, 5, 0, 1, 7, 2, 8, 3, 6}, + { 3, 2, 4, 0, 1, 5, 8, 7, 6}, +}; #define DCA_DOLBY 101 /* FIXME */