[FFmpeg-soc] [soc]: r3069 - in aac: aac.c aac.h

superdump subversion at mplayerhq.hu
Fri Aug 8 00:01:49 CEST 2008


Author: superdump
Date: Fri Aug  8 00:01:49 2008
New Revision: 3069

Log:
Simplify apply_channel_coupling() by merging l[] and r[] into ch_select[]


Modified:
   aac/aac.c
   aac/aac.h

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Fri Aug  8 00:01:49 2008
@@ -1204,9 +1204,8 @@ static int decode_cce(AACContext * ac, G
         coup->is_cpe[c] = get_bits1(gb);
         coup->tag_select[c] = get_bits(gb, 4);
         if (coup->is_cpe[c]) {
-            coup->l[c] = get_bits1(gb);
-            coup->r[c] = get_bits1(gb);
-            if (coup->l[c] && coup->r[c])
+            coup->ch_select[c] = get_bits1(gb) + 2*get_bits1(gb);
+            if (coup->ch_select[c] == 3)
                 num_gain++;
         }
     }
@@ -1757,13 +1756,12 @@ static void apply_channel_coupling(AACCo
         if (     !coup->is_cpe[c] && ac->che[ID_SCE][coup->tag_select[c]]) {
             apply_coupling_method(ac, &ac->che[ID_SCE][coup->tag_select[c]]->ch[0], cc, index++);
         } else if(coup->is_cpe[c] && ac->che[ID_CPE][coup->tag_select[c]]) {
-            if (!coup->l[c] && !coup->r[c]) {
+            if (coup->ch_select[c] != 2) {
                 apply_coupling_method(ac, &ac->che[ID_CPE][coup->tag_select[c]]->ch[0], cc, index);
-                apply_coupling_method(ac, &ac->che[ID_CPE][coup->tag_select[c]]->ch[1], cc, index++);
+                if (coup->ch_select[c] != 0)
+                    index++;
             }
-            if (coup->l[c])
-                apply_coupling_method(ac, &ac->che[ID_CPE][coup->tag_select[c]]->ch[0], cc, index++);
-            if (coup->r[c])
+            if (coup->ch_select[c] != 1)
                 apply_coupling_method(ac, &ac->che[ID_CPE][coup->tag_select[c]]->ch[1], cc, index++);
         } else {
             av_log(ac->avccontext, AV_LOG_ERROR,

Modified: aac/aac.h
==============================================================================
--- aac/aac.h	(original)
+++ aac/aac.h	Fri Aug  8 00:01:49 2008
@@ -268,8 +268,9 @@ typedef struct {
     int num_coupled;       ///< number of target elements
     int is_cpe[9];         ///< Set if target is an CPE (otherwise it's an SCE).
     int tag_select[9];     ///< element tag index
-    int l[9];              ///< Indicates the presence of a channel specific list of gains for the left channel of a CPE.
-    int r[9];              ///< Indicates the presence of a channel specific list of gains for the right channel of a CPE.
+    int ch_select[9];      /**< [0] shared list of gains; [1] list of gains for left channel;
+                            *   [2] list of gains for right channel; [3] lists of gains for both channels
+                            */
     float gain[18][8][64];
 } ChannelCoupling;
 



More information about the FFmpeg-soc mailing list