changeset 11910:284f85e281fc libavcodec

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
author mstorsjo
date Tue, 22 Jun 2010 08:34:02 +0000
parents 3bfcb8fd3dc9
children 180c6aca1f6e
files dca.c
diffstat 1 files changed, 71 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- 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 */