1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Round correctly chroma picture height.

Fix issue 956.

Originally committed as revision 22223 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Vitor Sessak 2010-03-05 20:04:24 +00:00
parent 5301a05d3e
commit 09ab885975

View File

@ -760,8 +760,8 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
for (i=0; i<data_planes; i++) { for (i=0; i<data_planes; i++) {
if (i == 1) { if (i == 1) {
w = ((width >> desc->log2_chroma_w) * pf->depth + 7) / 8; w = (- ((-width) >> desc->log2_chroma_w) * pf->depth + 7) / 8;
h = height >> desc->log2_chroma_h; h = -((-height) >> desc->log2_chroma_h);
if (pix_fmt == PIX_FMT_NV12 || pix_fmt == PIX_FMT_NV21) if (pix_fmt == PIX_FMT_NV12 || pix_fmt == PIX_FMT_NV21)
w <<= 1; w <<= 1;
} else if (i == 3) { } else if (i == 3) {