[SCM] libav/experimental: Fix sliced yuv410 -> yuv420 conversion

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:45:25 UTC 2013


The following commit has been merged in the experimental branch:
commit 5f9ae1983d901e703cd133435c6c87fdaae7b06f
Author: Vitor Sessak <vitor1001 at gmail.com>
Date:   Thu May 7 20:41:04 2009 +0000

    Fix sliced yuv410 -> yuv420 conversion
    
    Originally committed as revision 29272 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 19d93dd..a0954ad 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -2108,11 +2108,15 @@ static int yvu9toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int
     }
 
     if (c->dstFormat==PIX_FMT_YUV420P || c->dstFormat==PIX_FMT_YUVA420P){
-        planar2x(src[1], dst[1], c->chrSrcW, c->chrSrcH, srcStride[1], dstStride[1]);
-        planar2x(src[2], dst[2], c->chrSrcW, c->chrSrcH, srcStride[2], dstStride[2]);
+        planar2x(src[1], dst[1] + dstStride[1]*(srcSliceY >> 1), c->chrSrcW,
+                 srcSliceH >> 2, srcStride[1], dstStride[1]);
+        planar2x(src[2], dst[2] + dstStride[2]*(srcSliceY >> 1), c->chrSrcW,
+                 srcSliceH >> 2, srcStride[2], dstStride[2]);
     }else{
-        planar2x(src[1], dst[2], c->chrSrcW, c->chrSrcH, srcStride[1], dstStride[2]);
-        planar2x(src[2], dst[1], c->chrSrcW, c->chrSrcH, srcStride[2], dstStride[1]);
+        planar2x(src[1], dst[2] + dstStride[2]*(srcSliceY >> 1), c->chrSrcW,
+                 srcSliceH >> 2, srcStride[1], dstStride[2]);
+        planar2x(src[2], dst[1] + dstStride[1]*(srcSliceY >> 1), c->chrSrcW,
+                 srcSliceH >> 2, srcStride[2], dstStride[1]);
     }
     if (dst[3])
         fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list