fixing y422p output
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Sep 2002 22:48:39 +0000 (22:48 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Sep 2002 22:48:39 +0000 (22:48 +0000)
Originally committed as revision 7352 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc

postproc/swscale_template.c

index 91461027eef964a94b0234d9153753515172a2c5..d39fb340d4c19a7cc7bdc4634f974bb1d508838a 100644 (file)
@@ -2503,7 +2503,8 @@ i--;
            {
                if(isPlanarYUV(dstFormat) || isGray(dstFormat)) //YV12 like
                {
-                       if((dstY&1) || isGray(dstFormat)) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
+                       const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
+                       if((dstY&chrSkipMask) || isGray(dstFormat)) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
                        if(vLumFilterSize == 1 && vChrFilterSize == 1) // Unscaled YV12
                        {
                                int16_t *lumBuf = lumPixBuf[0];
@@ -2559,7 +2560,8 @@ i--;
                int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
                if(isPlanarYUV(dstFormat) || isGray(dstFormat)) //YV12
                {
-                       if((dstY&1) || isGray(dstFormat)) uDest=vDest= NULL;
+                       const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
+                       if((dstY&chrSkipMask) || isGray(dstFormat)) uDest=vDest= NULL; //FIXME split functions in lumi / chromi
                        yuv2yuvXinC(
                                vLumFilter+dstY*vLumFilterSize   , lumSrcPtr, vLumFilterSize,
                                vChrFilter+chrDstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,