[MPlayer-dev-eng] [PATCH] re_order: Be able to re-order 8 channels to AAC layout..

Thierry Foucu tfoucu at gmail.com
Wed Apr 18 20:29:03 CEST 2012


Here is a patch 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



Index: libaf/reorder_ch.c
===================================================================
--- libaf/reorder_ch.c (revision 34869)
+++ libaf/reorder_ch.c (working copy)
@@ -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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: re_order_8_aac.patch
Type: application/octet-stream
Size: 2670 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120418/682a96b5/attachment-0001.obj>


More information about the MPlayer-dev-eng mailing list