[MPlayer-dev-eng] [PATCH] vf_crop to pass on field-order

Zoltan Hidvegi mplayer at hzoli.2y.net
Sat Oct 11 18:38:29 CEST 2003


> Hi,
> 
> > > > +	    vf->dmpi->fields ^= MP_IMGFIELD_TOP_FIRST;
> > > [..]
> > > > +	dmpi->fields ^= MP_IMGFIELD_TOP_FIRST;
> > > 
> > > Should those here really be XOR ?
> > 
> > Yes, if you crop odd number of lines from the top, then previously top
> > field becomes the bottom field (i.e. previously even lines become the
> > odd lines), so the MP_IMGFIELD_TOP_FIRST flag should be inverted.  If
> > not XOR, what else culd you use?
> > 
> > Zoli
> 
> actually we shouldnt allow cropping odd numbe rof lines from top and left.
> it will also trash chroma upsampling at 4:2:0 formats.

Yes, actually for interlaced 4:2:0 content, we should only allow
cropping a multiple of 4.  Unfortunately vf_crop cannot know if it is
interlaced or not.  But with 4:2:2 and 4:4:4 you can crop as many
lines as you wish, so inverting the flag is still useful.  This patch
just sets the field flags if you crop odd lines.  It is a different
issue to prevent odd cropping.



More information about the MPlayer-dev-eng mailing list