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

superdump subversion at mplayerhq.hu
Sun Jul 27 23:40:13 CEST 2008


Author: superdump
Date: Sun Jul 27 23:40:13 2008
New Revision: 2866

Log:
Refactor error check in decode_ics_info


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Sun Jul 27 23:40:13 2008
@@ -989,19 +989,12 @@ static int decode_ics_info(AACContext * 
         }
         ics->swb_offset    =    swb_offset_128[ac->m4ac.sampling_index];
         ics->num_swb       =       num_swb_128[ac->m4ac.sampling_index];
-        if(ics->max_sfb > ics->num_swb) {
-            av_log(ac->avccontext, AV_LOG_ERROR,
-                "Number of scalefactor bands in group (%d) exceeds limit (%d).\n",
-                ics->max_sfb, ics->num_swb);
-            return -1;
-        }
-
-        ics->num_windows   = 8;
-        ics->tns_max_bands = tns_max_bands_128[ac->m4ac.sampling_index];
     } else {
         ics->max_sfb = get_bits(gb, 6);
         ics->swb_offset    =    swb_offset_1024[ac->m4ac.sampling_index];
         ics->num_swb       =       num_swb_1024[ac->m4ac.sampling_index];
+    }
+
         if(ics->max_sfb > ics->num_swb) {
             av_log(ac->avccontext, AV_LOG_ERROR,
                 "Number of scalefactor bands in group (%d) exceeds limit (%d).\n",
@@ -1009,6 +1002,10 @@ static int decode_ics_info(AACContext * 
             return -1;
         }
 
+    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE) {
+        ics->num_windows   = 8;
+        ics->tns_max_bands = tns_max_bands_128[ac->m4ac.sampling_index];
+    } else {
         ics->num_windows   = 1;
         ics->tns_max_bands = tns_max_bands_1024[ac->m4ac.sampling_index];
         if (get_bits1(gb)) {



More information about the FFmpeg-soc mailing list