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

faust3 subversion at mplayerhq.hu
Sat Jul 4 10:39:12 CEST 2009


Author: faust3
Date: Sat Jul  4 10:39:12 2009
New Revision: 4582

Log:
avoid floats in the subwoofer cutoff calculation

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Sat Jul  4 09:43:31 2009	(r4581)
+++ wmapro/wma3dec.c	Sat Jul  4 10:39:12 2009	(r4582)
@@ -441,8 +441,8 @@ static av_cold int decode_init(AVCodecCo
     /** calculate subwoofer cutoff values */
     for (i=0;i< s->num_possible_block_sizes;i++) {
         int block_size = s->samples_per_frame >> i;
-        int cutoff = ceil(block_size * 440.0
-                          / (double)s->avctx->sample_rate + 0.5);
+        int cutoff = (440*block_size + 3*s->avctx->sample_rate/2 - 1)
+                     / s->avctx->sample_rate;
         s->subwoofer_cutoffs[i] = av_clip(cutoff,4,block_size);
     }
 


More information about the FFmpeg-soc mailing list