diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2009-04-17 08:43:04 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2009-04-17 08:43:04 +0000 |
commit | 95f3019a5193712a49cdcf9f2bc460e5c94fbc94 (patch) | |
tree | 6c5bd7196e45c7b90b62b9d9d1fbb468f46c1614 /libavcodec/ac3tab.c | |
parent | 8b5ec0875c8d00d62034ed1df7188b7c75baba3a (diff) | |
download | ffmpeg-95f3019a5193712a49cdcf9f2bc460e5c94fbc94.tar.gz |
ac3dec: reorder output channels to SMPTE channel order
Originally committed as revision 18542 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3tab.c')
-rw-r--r-- | libavcodec/ac3tab.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/libavcodec/ac3tab.c b/libavcodec/ac3tab.c index 36a7449a72..cb07ac6255 100644 --- a/libavcodec/ac3tab.c +++ b/libavcodec/ac3tab.c @@ -79,21 +79,34 @@ const uint8_t ff_ac3_channels_tab[8] = { 2, 1, 2, 3, 3, 4, 4, 5 }; +#define COMMON_CHANNEL_MAP \ + { { 0, 1, }, { 0, 1, 2, } },\ + { { 0, }, { 0, 1, } },\ + { { 0, 1, }, { 0, 1, 2, } },\ + { { 0, 2, 1, }, { 0, 2, 1, 3, } },\ + { { 0, 1, 2, }, { 0, 1, 3, 2, } },\ + { { 0, 2, 1, 3, }, { 0, 2, 1, 4, 3, } }, + /** * Table to remap channels from SMPTE order to AC-3 order. * [channel_mode][lfe][ch] */ const uint8_t ff_ac3_enc_channel_map[8][2][6] = { - { { 0, 1, }, { 0, 1, 2, } }, - { { 0, }, { 0, 1, } }, - { { 0, 1, }, { 0, 1, 2, } }, - { { 0, 2, 1, }, { 0, 2, 1, 3, } }, - { { 0, 1, 2, }, { 0, 1, 3, 2, } }, - { { 0, 2, 1, 3, }, { 0, 2, 1, 4, 3, } }, + COMMON_CHANNEL_MAP { { 0, 1, 2, 3, 4, }, { 0, 1, 3, 4, 2, } }, { { 0, 2, 1, 3, 4, }, { 0, 2, 1, 4, 5, 3 } }, }; +/** + * Table to remap channels from from AC-3 order to SMPTE order. + * [channel_mode][lfe][ch] + */ +const uint8_t ff_ac3_dec_channel_map[8][2][6] = { + COMMON_CHANNEL_MAP + { { 0, 1, 2, 3, 4, }, { 0, 1, 4, 2, 3, } }, + { { 0, 2, 1, 3, 4, }, { 0, 2, 1, 5, 3, 4 } }, +}; + /* possible frequencies */ const uint16_t ff_ac3_sample_rate_tab[3] = { 48000, 44100, 32000 }; |