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

superdump subversion at mplayerhq.hu
Mon Aug 11 11:07:58 CEST 2008


Author: superdump
Date: Mon Aug 11 11:07:58 2008
New Revision: 3165

Log:
Simplify coupling_point assignment. Add check for invalid coupling_point.


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

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Mon Aug 11 11:07:58 2008
@@ -1136,7 +1136,7 @@ static int decode_cpe(AACContext * ac, G
 static int decode_cce(AACContext * ac, GetBitContext * gb, int elem_id) {
     int num_gain = 0;
     int c, g, sfb, ret, idx = 0;
-    int is_indep_coup, domain, sign;
+    int sign;
     float scale;
     SingleChannelElement * sce;
     ChannelCoupling * coup;
@@ -1145,7 +1145,7 @@ static int decode_cce(AACContext * ac, G
 
     coup = &ac->che[TYPE_CCE][elem_id]->coup;
 
-    is_indep_coup = get_bits1(gb);
+    coup->coupling_point = 2*get_bits1(gb);
     coup->num_coupled = get_bits(gb, 3);
     for (c = 0; c <= coup->num_coupled; c++) {
         num_gain++;
@@ -1158,14 +1158,14 @@ static int decode_cce(AACContext * ac, G
         } else
             coup->ch_select[c] = 1;
     }
-    domain = get_bits1(gb);
+    coup->coupling_point += get_bits1(gb);
 
-    if (is_indep_coup) {
-        coup->coupling_point = AFTER_IMDCT;
-    } else if(domain) {
-        coup->coupling_point = BETWEEN_TNS_AND_IMDCT;
-    } else
-        coup->coupling_point = BEFORE_TNS;
+    if (coup->coupling_point == 2) {
+        av_log(ac->avccontext, AV_LOG_ERROR,
+            "Independently switched CCE with 'invalid' domain signalled.\n");
+        memset(coup, 0, sizeof(ChannelCoupling));
+        return -1;
+    }
 
     sign = get_bits(gb, 1);
     scale = pow(2., pow(2., get_bits(gb, 2) - 3));

Modified: aac/aac.h
==============================================================================
--- aac/aac.h	(original)
+++ aac/aac.h	Mon Aug 11 11:07:58 2008
@@ -146,7 +146,7 @@ enum ChannelPosition {
 enum CouplingPoint {
     BEFORE_TNS,
     BETWEEN_TNS_AND_IMDCT,
-    AFTER_IMDCT,
+    AFTER_IMDCT = 3,
 };
 
 #ifdef AAC_LTP



More information about the FFmpeg-soc mailing list