[Mplayer-advusers] MPEG2 height not multiple of 16

Zoltan Hidvegi mplayer at hzoli.2y.net
Fri Oct 10 04:27:46 CEST 2003


HDTV 1080i uses 1080 lines, which is not a multiple of 16.  The
problem is that libmpeg2 forces the dimensions to be a multiple of 16,
however libmpdemux/mpeg_hdr.c uses unrounded dimensions.  So one part
of mplayer thinks that the image have 1080 lines, while an other part
thinks it is 1088.  I'm not completely sure what happens after that,
but I suspect that space is only allocated for 1080 lines, since if I
apply filters, for example detc, without cropping, the top lines of
the output is discolored, which would happen if the last 8 line of the
luma plane overlaps with the top of the first chroma plane.

This whole thing does not happen with -vfm ffmpeg.  The ffmpeg mpeg2
decoder is also faster, but it does not set the fields flags,
therefore it is not usable for encoding content that is switching
between hard and soft telecine with variable top/bottom field first.

I really do not know enough to fix libmpeg2.  This could be a serious
problem, since it may result in writing beyond the allocated memory,
which may be exploited in some way.  But this may not happen for some
other reason, since I haven't actually seen any crashes caused by
this.

I've put a 2MB 1080i sample to
ftp.mplayerhq.hu/MPlayer/incoming/HDTV_1080i.ts
Play it with -tsprog 2.

Zoli



More information about the MPlayer-advusers mailing list