changeset 7351:064ada190b6c

fixing y422p output
author michael
date Mon, 09 Sep 2002 22:48:39 +0000
parents e8c9bfb533ad
children 757e876d36fe
files postproc/swscale_template.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/swscale_template.c	Mon Sep 09 22:44:23 2002 +0000
+++ b/postproc/swscale_template.c	Mon Sep 09 22:48:39 2002 +0000
@@ -2503,7 +2503,8 @@
 	    {
 		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 @@
 		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,