[FFmpeg-soc] [soc]: r3295 - aac/aac.c

superdump subversion at mplayerhq.hu
Fri Aug 15 01:58:54 CEST 2008


Author: superdump
Date: Fri Aug 15 01:58:54 2008
New Revision: 3295

Log:
Avoid three TYPE_CCE checks in spectral_to_sample() by using an unused value of
ChannelCoupling.coupling_point


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Fri Aug 15 01:58:54 2008
@@ -1666,7 +1666,7 @@ static int spectral_to_sample(AACContext
         for(type = 0; type < 4; type++) {
             ChannelElement *che = ac->che[type][i];
             if(che) {
-                if(type == TYPE_CCE && che->coup.coupling_point == BEFORE_TNS)
+                if(che->coup.coupling_point == BEFORE_TNS)
                     apply_channel_coupling(ac, che, apply_dependent_coupling);
 #ifdef AAC_LTP
                 if (ac->m4ac.object_type == AOT_AAC_LTP) {
@@ -1682,7 +1682,7 @@ static int spectral_to_sample(AACContext
                     apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
                 if(che->ch[1].tns.present)
                     apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
-                if(type == TYPE_CCE && che->coup.coupling_point == BETWEEN_TNS_AND_IMDCT)
+                if(che->coup.coupling_point == BETWEEN_TNS_AND_IMDCT)
                     apply_channel_coupling(ac, che, apply_dependent_coupling);
 #ifdef AAC_SSR
                 if (ac->m4ac.object_type == AOT_AAC_SSR) {
@@ -1697,7 +1697,7 @@ static int spectral_to_sample(AACContext
 #ifdef AAC_SSR
                 }
 #endif /* AAC_SSR */
-                if(type == TYPE_CCE && che->coup.coupling_point == AFTER_IMDCT)
+                if(che->coup.coupling_point == AFTER_IMDCT)
                     apply_channel_coupling(ac, che, apply_independent_coupling);
 #ifdef AAC_LTP
                 if (ac->m4ac.object_type == AOT_AAC_LTP) {
@@ -1735,8 +1735,12 @@ static int aac_decode_frame(AVCodecConte
             ac->che[TYPE_SCE][elem_id] = ac->che[TYPE_LFE][0];
             ac->che[TYPE_LFE][0] = NULL;
         }
-        if(elem_type && elem_type < TYPE_DSE && !ac->che[elem_type][elem_id])
+        if(elem_type && elem_type < TYPE_DSE) {
+            if(!ac->che[elem_type][elem_id])
             return -1;
+            if(elem_type != TYPE_CCE)
+                ac->che[elem_type][elem_id]->coup.coupling_point = 4;
+        }
 
         switch (elem_type) {
 



More information about the FFmpeg-soc mailing list