[MPlayer-cvslog] r34877 - trunk/libaf/reorder_ch.c

ranma subversion at mplayerhq.hu
Tue Apr 24 23:01:15 CEST 2012


Author: ranma
Date: Tue Apr 24 23:01:15 2012
New Revision: 34877

Log:
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]

Modified:
   trunk/libaf/reorder_ch.c

Modified: trunk/libaf/reorder_ch.c
==============================================================================
--- trunk/libaf/reorder_ch.c	Tue Apr 24 20:04:15 2012	(r34876)
+++ trunk/libaf/reorder_ch.c	Tue Apr 24 23:01:15 2012	(r34877)
@@ -785,6 +785,9 @@ static int reorder_self_5_step_1(void *s
         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 @@ static int reorder_self_5_step_1(void *s
         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 @@ static int reorder_self_5_step_1(void *s
         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 @@ static int reorder_self_5_step_1(void *s
         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 @@ void reorder_channel(void *src,
     // 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 @@ void reorder_channel(void *src,
         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;


More information about the MPlayer-cvslog mailing list