[Mplayer-cvslog] CVS: main/libmpcodecs vf_scale.c,1.39,1.40

D Richard Felker III dalias at aerifal.cx
Sun Apr 27 18:28:34 CEST 2003

On Sun, Apr 27, 2003 at 05:21:16PM +0200, Attila Kinali wrote:
> On Sun, 27 Apr 2003 12:05:03 +0200
> Richard Felker CVS <rfelker at mplayerhq.hu> wrote:
> > Update of /cvsroot/mplayer/main/libmpcodecs
> > In directory mail:/var/tmp.root/cvs-serv12888/libmpcodecs
> > 
> > Modified Files:
> > 	vf_scale.c 
> > Log Message:
> > generate meaningful d_width & d_height when scaling, rather than useless nonsense.
> Shouldn't this be done in regard of the vo_x11_keepaspect variable ?
> Then the user could choose whether he wants to have the same aspect or not.

Nope, it's totally unrelated. See my posts on -dev-eng. And BTW, a
filter's behavior should *never* depend on global vars, since the
filter could be invoked more than once in a chain with different
options desired.

Basically, it seems vf_scale's output d_width and d_height were never
intended to be used, since the usual use of vf_scale would be software
scaling for vo's that don't support hardware scaling or for the ve
with mencoder (both of which ignore d_width and d_height).

So, suppose you have a 480x480 movie with 4:3 aspect, and you use
vf_scale to scale it to 640x480. The input d_width/d_height vf_scale
gets is 640/480. With the old (broken) code, vf_scale would set the
output d_width to 853, for which there is absolutely no logical basis.
It was just wrong.

My reasoning in making the correction is that scaling the picture
should not change the original intended aspect from the file headers
or -aspect on the command line. While you alter the pixel dimensions,
you don't alter the horizontal or vertical distances the picture
spans, so aspect should remain the same.

BTW, soon I'm going to write vf_aspect or vf_dsize or something (can't
decide what to call it) that lets you set the d_width/d_height at an
arbitrary point in the filter chain, so that the rest of the chain can
compute with and preserve it properly when cropping, expanding, and
scaling. However, before I write it, I need to figure out how to pass
get_image, put_image, and draw_slice through properly so it doesn't
affect performance in any way...


More information about the MPlayer-cvslog mailing list