[Mplayer-cvslog] CVS: main/postproc rgb2rgb.c,1.37,1.38

Arpi of Ize arpi at mplayer.dev.hu
Sun Nov 11 00:28:12 CET 2001


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

Modified Files:
	rgb2rgb.c 
Log Message:
uyvy->uv12 added

Index: rgb2rgb.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- rgb2rgb.c	10 Nov 2001 20:39:22 -0000	1.37
+++ rgb2rgb.c	10 Nov 2001 23:28:10 -0000	1.38
@@ -813,3 +813,41 @@
         :::"memory");
 #endif
 }
+
+/**
+ *
+ * height should be a multiple of 2 and width should be a multiple of 16 (if this is a
+ * problem for anyone then tell me, and ill fix it)
+ */
+void uyvytoyv12(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)
+{
+	int y;
+	const int chromWidth= width>>1;
+	for(y=0; y<height; y+=2)
+	{
+		int i;
+		for(i=0; i<chromWidth; i++)
+		{
+			udst[i] 	= src[4*i+0];
+			ydst[2*i+0] 	= src[4*i+1];
+			vdst[i] 	= src[4*i+2];
+			ydst[2*i+1] 	= src[4*i+3];
+		}
+		ydst += lumStride;
+		src  += srcStride;
+
+		for(i=0; i<chromWidth; i++)
+		{
+			ydst[2*i+0] 	= src[4*i+1];
+			ydst[2*i+1] 	= src[4*i+3];
+		}
+		udst += chromStride;
+		vdst += chromStride;
+		ydst += lumStride;
+		src  += srcStride;
+	}
+}
+
+




More information about the MPlayer-cvslog mailing list