[FFmpeg-devel] [PATCH] fix for rev11962 that broke yuv422 mpeg encoding
Wed Feb 20 00:57:13 CET 2008
The following command
ffmpeg -i source -pix_fmt yuv422p -vcodec mpeg2video -intra -qscale 1
outputs corrupted chroma since rev 11962.
(source is 720x576, -intra and -qscale make the chroma alignment problem
easier to see)
Rev 11962 has changed the linesize of the yuv planes using ALIGN macro
to align Y on U dimension.
However macro is only designed to align to pow2 values and not various
Also after alignment to picture.linesize there's no garantee that the
linesize is still aligned to a STRIDE_ALIGN multiple anymore.
Refs in libavcodec/utils.c:
#define ALIGN(x, a) (((x)+(a)-1)&~((a)-1))
picture.linesize = ALIGN(picture.linesize, picture.linesize);
I changed the code so that the linesize[1,2,3] are adjusted to upper
value that is a round fraction of linesize,
while preserving alignment to STRIDE_ALIGN for all planes.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the ffmpeg-devel