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

faust3 subversion at mplayerhq.hu
Wed May 27 19:09:37 CEST 2009


Author: faust3
Date: Wed May 27 19:09:37 2009
New Revision: 4317

Log:
use sizeof instead of hardcoding the buffer element sizes

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Wed May 27 18:57:47 2009	(r4316)
+++ wmapro/wma3dec.c	Wed May 27 19:09:37 2009	(r4317)
@@ -575,7 +575,7 @@ static int wma_decode_channel_transform(
      */
 
     for(i=0;i< s->num_channels;i++){
-        memset(s->chgroup[i].decorrelation_matrix,0,4*s->num_channels * s->num_channels);
+        memset(s->chgroup[i].decorrelation_matrix,0,sizeof(float) *s->num_channels * s->num_channels);
     }
 
     if(s->num_channels == 1 ){
@@ -585,7 +585,7 @@ static int wma_decode_channel_transform(
         s->chgroup[0].transform = 2;
         s->channel[0].resampled_scale_factors[0] = 0;
         memset(s->chgroup[0].transform_band,0,MAX_BANDS);
-        memset(s->chgroup[0].decorrelation_matrix,0,4*s->num_channels * s->num_channels);
+        memset(s->chgroup[0].decorrelation_matrix,0,sizeof(float) *s->num_channels * s->num_channels);
 
         s->chgroup[0].decorrelation_matrix[0] = 1.0;
 
@@ -968,7 +968,7 @@ static void wma_calc_decorrelation_matri
 {
     int i;
     int offset = 0;
-    memset(chgroup->decorrelation_matrix, 0, chgroup->num_channels * 4 * chgroup->num_channels);
+    memset(chgroup->decorrelation_matrix, 0, chgroup->num_channels * sizeof(float) * chgroup->num_channels);
     for(i=0;i<chgroup->num_channels;i++)
         chgroup->decorrelation_matrix[chgroup->num_channels * i + i] = chgroup->positive[i]?1.0:-1.0;
 
@@ -980,8 +980,8 @@ static void wma_calc_decorrelation_matri
                 int y;
                 float tmp1[MAX_CHANNELS];
                 float tmp2[MAX_CHANNELS];
-                memcpy(tmp1, &chgroup->decorrelation_matrix[x * chgroup->num_channels], 4 * (i + 1));
-                memcpy(tmp2, &chgroup->decorrelation_matrix[i * chgroup->num_channels], 4 * (i + 1));
+                memcpy(tmp1, &chgroup->decorrelation_matrix[x * chgroup->num_channels], sizeof(float) * (i + 1));
+                memcpy(tmp2, &chgroup->decorrelation_matrix[i * chgroup->num_channels], sizeof(float) * (i + 1));
                 for(y=0;y < i + 1 ; y++){
                     float v1 = tmp1[y];
                     float v2 = tmp2[y];
@@ -1306,7 +1306,7 @@ static int wma_decode_subframe(WMA3Decod
             int b;
             float* dst;
             if(c == s->lfe_channel)
-                memset(&s->tmp[s->cur_subwoofer_cutoff],0,4 * (subframe_len - s->cur_subwoofer_cutoff));
+                memset(&s->tmp[s->cur_subwoofer_cutoff],0,sizeof(float) * (subframe_len - s->cur_subwoofer_cutoff));
 
             /** inverse quantization */
             for(b=0;b<s->num_bands;b++){


More information about the FFmpeg-soc mailing list