[FFmpeg-soc] [soc]: r4368 - wmapro/wma3dec.c

faust3 subversion at mplayerhq.hu
Mon Jun 1 15:22:08 CEST 2009


Author: faust3
Date: Mon Jun  1 15:22:08 2009
New Revision: 4368

Log:
avoid repeated minimum number of samples calculations during wma_decode_tilehdr

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Mon Jun  1 15:09:24 2009	(r4367)
+++ wmapro/wma3dec.c	Mon Jun  1 15:22:08 2009	(r4368)
@@ -474,10 +474,13 @@ static int wma_decode_tilehdr(WMA3Decode
             int read_channel_mask = 1;
             int channels_for_cur_subframe = 0;
             int subframe_len;
+            /** minimum number of samples that need to be read */
+            int min_samples = s->min_samples_per_subframe;
 
             if(fixed_channel_layout){
                 read_channel_mask = 0;
                 channels_for_cur_subframe = s->num_channels;
+                min_samples *= channels_for_cur_subframe;
                 min_channel_len = s->channel[0].channel_len;
             }else{
                 /** find channels with the smallest overall length */
@@ -490,9 +493,10 @@ static int wma_decode_tilehdr(WMA3Decode
                         ++channels_for_cur_subframe;
                     }
                 }
+                min_samples *= channels_for_cur_subframe;
 
                 if(channels_for_cur_subframe == 1 ||
-                  s->min_samples_per_subframe * channels_for_cur_subframe == missing_samples)
+                   min_samples == missing_samples)
                     read_channel_mask = 0;
             }
 
@@ -508,8 +512,9 @@ static int wma_decode_tilehdr(WMA3Decode
                 }
             }
 
-            /** if we have the choice get next subframe length from the bitstream */
-            if(s->min_samples_per_subframe * channels_for_cur_subframe != missing_samples){
+            /** if we have the choice get next subframe length from the
+                bitstream */
+            if(min_samples != missing_samples){
                 int log2_subframe_len = 0;
                 /* 1 bit indicates if the subframe length is zero */
                 if(subframe_len_zero_bit){


More information about the FFmpeg-soc mailing list