# HG changeset patch # User mstorsjo # Date 1277195642 0 # Node ID 284f85e281fc3878f6d17737eda060fe4a9aefee # Parent 3bfcb8fd3dc9184409204d1250ea18f61c3fa776 Support DTS-ES extension (XCh) in dca: update and add channel mapping tables for DTS-ES mappings Patch by Nick Brereton, nick at nbrereton dot net diff -r 3bfcb8fd3dc9 -r 284f85e281fc dca.c --- a/dca.c Tue Jun 22 08:33:00 2010 +0000 +++ b/dca.c Tue Jun 22 08:34:02 2010 +0000 @@ -95,44 +95,81 @@ 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_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[][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_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 */