[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec vorbis.c,1.6,1.7

Rich Felker dalias
Mon May 30 08:45:16 CEST 2005


On Mon, May 30, 2005 at 02:07:54AM +0200, Michael Niedermayer CVS wrote:
> Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
> In directory mail:/var2/tmp/cvs-serv32169
> 
> Modified Files:
> 	vorbis.c 
> Log Message:
> faster float->short conversation
> 
> +        int_fast32_t tmp= ((int32_t*)vc->ret)[i];
> +        if(tmp > 0x43c07fff)
> +            tmp= 32767;
> +        else if(tmp < 0x43bf8000)
> +            tmp= -32768;

Can't these two conditionals be reduced to one if you add appropriate
bias or something? (Or at least one conditional around the whole thing
since the case of clipping is rare and the inner conditional won't
matter..)

Rich





More information about the ffmpeg-cvslog mailing list