[MPlayer-dev-eng] [PATCH] rounding error in sw scaling

Eric Lammerts eric at lammerts.org
Mon Aug 19 00:08:16 CEST 2002


Hi,
When I'm mencoding a movie with an aspect ratio of 4:3 with
"-vop scale=384:-2", mencoder chooses 290 for the vertical resolution.
It should be 288. This is caused by a bug (typo?) in vf_scale.c.

Please apply the patch below.

Eric

Index: libmpcodecs/vf_scale.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_scale.c,v
retrieving revision 1.22
diff -u -4 -r1.22 vf_scale.c
--- libmpcodecs/vf_scale.c	2 Aug 2002 22:57:58 -0000	1.22
+++ libmpcodecs/vf_scale.c	18 Aug 2002 22:18:46 -0000
@@ -120,9 +120,9 @@
 	if(vf->priv->w==-2) vf->priv->w=(vf->priv->h*d_width/d_height+1)&~1;
 	if(vf->priv->w<0) vf->priv->w=width; else
 	if(vf->priv->w==0) vf->priv->w=d_width;
 	if(vf->priv->h==-3) vf->priv->h=(vf->priv->w*height/width+1)&~1; else
-	if(vf->priv->h==-2) vf->priv->h=(vf->priv->w*d_height/d_width+2)&~1;
+	if(vf->priv->h==-2) vf->priv->h=(vf->priv->w*d_height/d_width+1)&~1;
 	break;
     default:
     if(vf->priv->w==-3) vf->priv->w=vf->priv->h*width/height; else
     if(vf->priv->w==-2) vf->priv->w=vf->priv->h*d_width/d_height;



More information about the MPlayer-dev-eng mailing list