changeset 34789:91d62f0e2952

This will allow us to encode 7.1 audio AAC. 7.1 audio not being really popular, instead of creating a new re_order function, I'm using 2 functions for the re_ordering from L R Ls Rs C LFE Rls Rrs --> C L R Ls Rs Rls Rrs LFE Patch by Thierry Foucu [tfoucu gmail]
author ranma
date Tue, 24 Apr 2012 21:01:15 +0000
parents cfd225997828
children 89c7cd996a36
files libaf/reorder_ch.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/reorder_ch.c	Tue Apr 24 18:04:15 2012 +0000
+++ b/libaf/reorder_ch.c	Tue Apr 24 21:01:15 2012 +0000
@@ -785,6 +785,9 @@
         if (chnum==6) {
             REORDER_SELF_SWAP_5_STEP_1(src_8,tmp,samples,6,s0,s1,s2,s3,s4);
         }
+        else if (chnum==8) {
+            REORDER_SELF_SWAP_5_STEP_1(src_8,tmp,samples,8,s0,s1,s2,s3,s4);
+        }
         else {
             REORDER_SELF_SWAP_5_STEP_1(src_8,tmp,samples,5,s0,s1,s2,s3,s4);
         }
@@ -797,6 +800,9 @@
         if (chnum==6) {
             REORDER_SELF_SWAP_5_STEP_1(src_16,tmp,samples,6,s0,s1,s2,s3,s4);
         }
+        else if (chnum==8) {
+            REORDER_SELF_SWAP_5_STEP_1(src_16,tmp,samples,8,s0,s1,s2,s3,s4);
+        }
         else {
             REORDER_SELF_SWAP_5_STEP_1(src_16,tmp,samples,5,s0,s1,s2,s3,s4);
         }
@@ -835,6 +841,9 @@
         if (chnum==6) {
             REORDER_SELF_SWAP_5_STEP_1(src_32,tmp,samples,6,s0,s1,s2,s3,s4);
         }
+        else if (chnum==8) {
+            REORDER_SELF_SWAP_5_STEP_1(src_32,tmp,samples,8,s0,s1,s2,s3,s4);
+        }
         else {
             REORDER_SELF_SWAP_5_STEP_1(src_32,tmp,samples,5,s0,s1,s2,s3,s4);
         }
@@ -847,6 +856,9 @@
         if (chnum==6) {
             REORDER_SELF_SWAP_5_STEP_1(src_64,tmp,samples,6,s0,s1,s2,s3,s4);
         }
+        else if (chnum==8) {
+            REORDER_SELF_SWAP_5_STEP_1(src_64,tmp,samples,8,s0,s1,s2,s3,s4);
+        }
         else {
             REORDER_SELF_SWAP_5_STEP_1(src_64,tmp,samples,5,s0,s1,s2,s3,s4);
         }
@@ -1250,6 +1262,7 @@
     // AF_CHANNEL_LAYOUT_7_1_A   L R C LFE Ls Rs Rls Rrs
     // AF_CHANNEL_LAYOUT_7_1_B   L R Ls Rs C LFE Rls Rrs
     // AF_CHANNEL_LAYOUT_7_1_C   L C R Ls Rs LFE Rls Rrs
+    // AF_CHANNEL_LAYOUT_7_1_D   C L R Ls Rs Rls Rrs LFE
     // AF_CHANNEL_LAYOUT_7_1_F   C L R LFE Ls Rs Rls Rrs
     case AF_CHANNEL_LAYOUT_7_1_A << 16 | AF_CHANNEL_LAYOUT_7_1_B:
     case AF_CHANNEL_LAYOUT_7_1_B << 16 | AF_CHANNEL_LAYOUT_7_1_A:
@@ -1258,6 +1271,12 @@
         else
             reorder_self_4_step_2(src, samples, samplesize, 8, 2, 3, 4, 5);
         break;
+    case AF_CHANNEL_LAYOUT_7_1_B << 16 | AF_CHANNEL_LAYOUT_7_1_D:
+        // First convert to AF_CHANNEL_LAYOUT_7_1_F
+        reorder_self_2_4(src, samples, samplesize, 8, 3, 5, 4, 2, 1, 0);
+        // then convert to AF_CHANNEL_LAYOUT_7_1_D
+        reorder_self_5_step_1(src, samples, samplesize, 8, 3, 4, 5, 6, 7);
+        break;
     case AF_CHANNEL_LAYOUT_7_1_C << 16 | AF_CHANNEL_LAYOUT_7_1_B:
         reorder_self_4_step_1(src, samples, samplesize, 8, 1, 2, 3, 4);
         break;