OSDN Git Service

Use a simpler and more general check for the gray case in the planarCopy function
authorCédric Schieli <cschieli@gmail.com>
Fri, 20 Mar 2009 14:01:51 +0000 (14:01 +0000)
committerCédric Schieli <cschieli@gmail.com>
Fri, 20 Mar 2009 14:01:51 +0000 (14:01 +0000)
Originally committed as revision 29009 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

libswscale/swscale.c

index 9a74f95..17fe3c6 100644 (file)
@@ -1989,11 +1989,8 @@ static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
         int y=      plane==0 ? srcSliceY: -((-srcSliceY)>>c->chrDstVSubSample);
         int height= plane==0 ? srcSliceH: -((-srcSliceH)>>c->chrDstVSubSample);
 
-        if ((isGray(c->srcFormat) || isGray(c->dstFormat)) && plane>0)
-        {
-            if (!isGray(c->dstFormat))
+        if (dst[plane] && !src[plane])
                 fillPlane(dst[plane], dstStride[plane], length, height, y, 128);
-        }
         else
         {
             if (dstStride[plane]==srcStride[plane] && srcStride[plane] > 0)