[Mplayer-cvslog] CVS: main/libmpcodecs ve_xvid.c,1.18,1.19

Dominik Mierzejewski dominik at rangers.eu.org
Thu Apr 3 09:25:39 CEST 2003


On Thursday, 03 April 2003, Rémi Guyomarch CVS wrote:
> Update of /cvsroot/mplayer/main/libmpcodecs
> In directory mail:/var/tmp.root/cvs-serv28820/libmpcodecs
> 
> Modified Files:
> 	ve_xvid.c 
> Log Message:
> 
> Actually do something useful with XVID_GLOBAL_EXTRASTATS / XVID_EXTRASTATS.
> Now we can really compare XviD and libavcodec :)
> 
> 
> 
> Index: ve_xvid.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_xvid.c,v
> retrieving revision 1.18
> retrieving revision 1.19
> diff -u -r1.18 -r1.19
> --- ve_xvid.c	2 Apr 2003 22:27:35 -0000	1.18
> +++ ve_xvid.c	3 Apr 2003 06:53:01 -0000	1.19
[...]
> +static double
> +sse_to_PSNR(double sse, double pixels)
> +{
> +    return sse == 0 ? INFINITY : 4.34294481903251827652 * (11.08252709031685229249 - log(sse/pixels));
> +    // 4.34294481903251827652 = 10/log(10)
> +    // 11.08252709031685229249 = log(255*255)
> +}
> +

You should never compare real type variables with 0. Best thing to do in
such cases is to check if the absolute value is smaller than a certain
threshold, for example

return abs(sse) < 0.00000000000000000001 ? ...

-- 
MPlayer RPMs maintainer: http://www.piorunek.pl/~dominik/linux/pkgs/mplayer/
"The Universe doesn't give you any points for doing things that are easy."
        -- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"



More information about the MPlayer-cvslog mailing list