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

Sascha Sommer saschasommer at freenet.de
Mon Jun 1 13:40:23 CEST 2009


Hi,

On Sonntag, 31. Mai 2009, Aurelien Jacobs wrote:
> On Sun, May 31, 2009 at 10:36:44AM +0200, faust3 wrote:
> > Author: faust3
> > Date: Sun May 31 10:36:44 2009
> > New Revision: 4354
> >
> > Log:
> > use FFMIN FFMAX where possible
> >
> > Modified:
> >    wmapro/wma3dec.c
> >
> > Modified: wmapro/wma3dec.c
> > =========================================================================
> >===== --- wmapro/wma3dec.c	Sun May 31 10:00:02 2009	(r4353)
> > +++ wmapro/wma3dec.c	Sun May 31 10:36:44 2009	(r4354)
> > @@ -367,10 +367,8 @@ static av_cold int wma_decode_init(AVCod
> >      for(i=0;i< s->num_possible_block_sizes;i++){
> >          int block_size = s->samples_per_frame / (1 << i);
> >          int cutoff = ceil(block_size * 440.0 /
> > (double)s->avctx->sample_rate + 0.5); -        if(cutoff < 4)
> > -            cutoff = 4;
> > -        if(cutoff > block_size)
> > -            cutoff = block_size;
> > +        cutoff = FFMAX(cutoff, 4);
> > +        cutoff = FFMIN(cutoff, block_size);
> >          s->subwoofer_cutoffs[i] = cutoff;
> >      }
>
> What about using av_clip() here ?
>

Thanks for the suggestion. I replaced the code with av_clip.

Regards

Sascha


More information about the FFmpeg-soc mailing list