From 5f59207d94115e61d5c401f5f03a3d2644fcb5c7 Mon Sep 17 00:00:00 2001 From: Cédric Schieli Date: Sat, 28 Feb 2009 07:31:36 +0000 Subject: Fix avpicture_layout to not chroma shift the alpha plane when outputting YUVA420P Originally committed as revision 17654 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/imgconvert.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libavcodec') diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 9f5db68191..1e0c66de84 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -721,7 +721,7 @@ int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height, unsigned char *dest, int dest_size) { const PixFmtInfo* pf = &pix_fmt_info[pix_fmt]; - int i, j, w, h, data_planes; + int i, j, w, ow, h, oh, data_planes; const unsigned char* s; int size = avpicture_get_size(pix_fmt, width, height); @@ -751,10 +751,16 @@ int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height, h = height; } + ow = w; + oh = h; + for (i=0; i> pf->x_chroma_shift; h = height >> pf->y_chroma_shift; + } else if (i == 3) { + w = ow; + h = oh; } s = src->data[i]; for(j=0; j