[MPlayer-users] Question about crop, scale, aspect ratio, multiple of 16

D Richard Felker III dalias at aerifal.cx
Sun Dec 19 07:59:36 CET 2004


On Sat, Dec 18, 2004 at 09:33:22PM -0600, Kichigai Mentat wrote:
> On Dec 18, 2004, at 13.47, D Richard Felker III wrote:
> 
> >On Fri, Dec 17, 2004 at 01:50:12AM -0800, RC wrote:
> >>On Thu, 16 Dec 2004 20:48:26 +0100
> >>nick <nick.rienties at home.nl> wrote:
> >>
> >>>Is it a problem that 428 is not a multiple of 16?
> >>
> >>Your final dimentions, before encoding, need to be multiples of 16...
> >>You can use any values for crop, if you are planning on scaling (or
> >>expanding, or whatever) to dimentions that are multiples of
> >>16, afterwards.
> >
> >not any. they must be multiples of 2, and if the content is
> >interlaced/telecined at the time you crop, the vertical crop offset
> >and size must be multiples of 4!
> >rich
> 
> Actually, you can set the crop to any size. MEncoder will fix it by 
> setting it to the proper size for you. I did this when cropping footage 
> that came out to some number like 415, and it blew it up to 416 
> automatically. So this isn't something to really worry about.

no, it is something to worry about. the rules discussed above are
there for a reason. mplayer/mencoder won't _crash_ if you break them,
but the output will be bogus (in the case of odd numbers) or
inefficient (in the case of non-multiple-of-16).

the even-number rule comes from the fact that 4:2:0-sampled data
exists in units of _pairs_ of samples, not single samples, i.e. it
always has to be an even number.

the multiple-of-4 rule for interlaced content comes from the fact that
you have two fields which have to be the same size, combined with the
above rule and the way interlaced 4:2:0 sampling works.

the multiple-of-16 rule comes from the way mpeg-type compression
works.

rich




More information about the MPlayer-users mailing list