changeset 11367:fec27e2a7570 libavcodec

Round correctly chroma picture height. Fix issue 956.
author vitor
date Fri, 05 Mar 2010 20:04:24 +0000
parents 3f231ba93f80
children 3d4f64b8fb10
files imgconvert.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/imgconvert.c	Fri Mar 05 08:26:23 2010 +0000
+++ b/imgconvert.c	Fri Mar 05 20:04:24 2010 +0000
@@ -760,8 +760,8 @@
 
     for (i=0; i<data_planes; i++) {
         if (i == 1) {
-            w = ((width >> desc->log2_chroma_w) * pf->depth + 7) / 8;
-            h = height >> desc->log2_chroma_h;
+            w = (- ((-width) >> desc->log2_chroma_w) * pf->depth + 7) / 8;
+            h = -((-height) >> desc->log2_chroma_h);
             if (pix_fmt == PIX_FMT_NV12 || pix_fmt == PIX_FMT_NV21)
                 w <<= 1;
         } else if (i == 3) {