[MPlayer-cvslog] r22994 - in trunk/libswscale: swscale.c swscale_template.c

michael subversion at mplayerhq.hu
Sun Apr 15 03:27:34 CEST 2007


Author: michael
Date: Sun Apr 15 03:27:34 2007
New Revision: 22994

Modified:
   trunk/libswscale/swscale.c
   trunk/libswscale/swscale_template.c

Log:
improve horizontal chroma resolution with pal


Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	(original)
+++ trunk/libswscale/swscale.c	Sun Apr 15 03:27:34 2007
@@ -2036,7 +2036,10 @@ SwsContext *sws_getContext(int srcW, int
 	c->chrSrcVSubSample+= c->vChrDrop;
 
 	// drop every 2. pixel for chroma calculation unless user wants full chroma
-	if((isBGR(srcFormat) || isRGB(srcFormat)) && !(flags&SWS_FULL_CHR_H_INP)) 
+	if((isBGR(srcFormat) || isRGB(srcFormat)) && !(flags&SWS_FULL_CHR_H_INP)
+           && srcFormat!=PIX_FMT_RGB8      && srcFormat!=PIX_FMT_BGR8
+           && srcFormat!=PIX_FMT_RGB4      && srcFormat!=PIX_FMT_BGR4
+           && srcFormat!=PIX_FMT_RGB4_BYTE && srcFormat!=PIX_FMT_BGR4_BYTE)
 		c->chrSrcHSubSample=1;
 
 	if(param){

Modified: trunk/libswscale/swscale_template.c
==============================================================================
--- trunk/libswscale/swscale_template.c	(original)
+++ trunk/libswscale/swscale_template.c	Sun Apr 15 03:27:34 2007
@@ -2296,12 +2296,10 @@ static inline void RENAME(palToUV)(uint8
         assert(src1 == src2);
 	for(i=0; i<width; i++)
 	{
-		int d0= src1[2*i  ];
-		int d1= src1[2*i+1];
-                int p = (pal[d0]&0xFF00FF) + (pal[d1]&0xFF00FF);
+		int p= pal[src1[i]];
 
-		dstU[i]= (pal[d0]+pal[d1]-p)>>9;
-		dstV[i]= p>>17;
+		dstU[i]= p>>8;
+		dstV[i]= p>>16;
 	}
 }
 



More information about the MPlayer-cvslog mailing list