[Mplayer-cvslog] CVS: main/postproc rgb2rgb.h,1.16,1.17 rgb2rgb_template.c,1.41,1.42

Michael Niedermayer michael at mplayer.dev.hu
Thu Dec 20 18:31:03 CET 2001


Update of /cvsroot/mplayer/main/postproc
In directory mplayer:/var/tmp.root/cvs-serv11492

Modified Files:
	rgb2rgb.h rgb2rgb_template.c 
Log Message:
rgb24toyv12 bugfix



Index: rgb2rgb.h
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- rgb2rgb.h	7 Nov 2001 08:52:04 -0000	1.16
+++ rgb2rgb.h	20 Dec 2001 17:30:59 -0000	1.17
@@ -30,6 +30,9 @@
 extern void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 	unsigned int width, unsigned int height,
 	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
+extern void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
+	unsigned int width, unsigned int height,
+	unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
 
 #define MODE_RGB  0x1
 #define MODE_BGR  0x2

Index: rgb2rgb_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb_template.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- rgb2rgb_template.c	26 Nov 2001 01:15:08 -0000	1.41
+++ rgb2rgb_template.c	20 Dec 2001 17:30:59 -0000	1.42
@@ -916,9 +916,9 @@
 			unsigned int g= src[6*i+1];
 			unsigned int r= src[6*i+2];
 
-			unsigned int Y  =  RY*r + GY*g + BY*b + 16;
-			unsigned int V  =  RV*r + GV*g + BV*b + 128;
-			unsigned int U  =  RU*r + GU*g + BU*b + 128;
+			unsigned int Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
+			unsigned int V  =  ((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128;
+			unsigned int U  =  ((RU*r + GU*g + BU*b)>>RGB2YUV_SHIFT) + 128;
 
 			udst[i] 	= U;
 			vdst[i] 	= V;
@@ -928,7 +928,7 @@
 			g= src[6*i+4];
 			r= src[6*i+5];
 
-			Y  =  RY*r + GY*g + BY*b + 16;
+			Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
 			ydst[2*i+1] 	= Y;
 		}
 		ydst += lumStride;
@@ -940,7 +940,7 @@
 			unsigned int g= src[6*i+1];
 			unsigned int r= src[6*i+2];
 
-			unsigned int Y  =  RY*r + GY*g + BY*b + 16;
+			unsigned int Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
 
 			ydst[2*i] 	= Y;
 
@@ -948,7 +948,7 @@
 			g= src[6*i+4];
 			r= src[6*i+5];
 
-			Y  =  RY*r + GY*g + BY*b + 16;
+			Y  =  ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
 			ydst[2*i+1] 	= Y;
 		}
 		udst += chromStride;




More information about the MPlayer-cvslog mailing list