diff options
author | Cédric Schieli <cschieli@gmail.com> | 2009-02-28 07:31:36 +0000 |
---|---|---|
committer | Cédric Schieli <cschieli@gmail.com> | 2009-02-28 07:31:36 +0000 |
commit | 5f59207d94115e61d5c401f5f03a3d2644fcb5c7 (patch) | |
tree | 63c7872833effdbcf962911c6ef25497d1f57c38 /libavcodec/imgconvert.c | |
parent | 73914d56d9b43ce9cc832e2c55cfd771c2d1ba3b (diff) | |
download | ffmpeg-5f59207d94115e61d5c401f5f03a3d2644fcb5c7.tar.gz |
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
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r-- | libavcodec/imgconvert.c | 8 |
1 files changed, 7 insertions, 1 deletions
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<data_planes; i++) { if (i == 1) { w = width >> 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<h; j++) { |