aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3tab.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2009-04-17 08:39:11 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2009-04-17 08:39:11 +0000
commita7c6e1171b1984b949464c4d9070f10a1fd43d6d (patch)
treebdd1daca2bfc7ecfc91d1550f39ab3940b74b1e2 /libavcodec/ac3tab.c
parent35e2e681b820a878903c35b939bf130acdbb5c63 (diff)
downloadffmpeg-a7c6e1171b1984b949464c4d9070f10a1fd43d6d.tar.gz
ac3enc: reorder input channels to AC-3 channel order
Originally committed as revision 18540 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3tab.c')
-rw-r--r--libavcodec/ac3tab.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/ac3tab.c b/libavcodec/ac3tab.c
index 69ede84de8..36a7449a72 100644
--- a/libavcodec/ac3tab.c
+++ b/libavcodec/ac3tab.c
@@ -79,6 +79,21 @@ const uint8_t ff_ac3_channels_tab[8] = {
2, 1, 2, 3, 3, 4, 4, 5
};
+/**
+ * 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, } },
+ { { 0, 1, 2, 3, 4, }, { 0, 1, 3, 4, 2, } },
+ { { 0, 2, 1, 3, 4, }, { 0, 2, 1, 4, 5, 3 } },
+};
+
/* possible frequencies */
const uint16_t ff_ac3_sample_rate_tab[3] = { 48000, 44100, 32000 };