[Mplayer-cvslog] CVS: main/postproc rgb2rgb.c,1.18,1.19 rgb2rgb.h,1.6,1.7

Michael Niedermayer michael at mplayer.dev.hu
Mon Nov 5 01:46:14 CET 2001


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

Modified Files:
	rgb2rgb.c rgb2rgb.h 
Log Message:
yv12 <-> yuy2 in C


Index: rgb2rgb.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- rgb2rgb.c	4 Nov 2001 23:04:26 -0000	1.18
+++ rgb2rgb.c	5 Nov 2001 00:45:55 -0000	1.19
@@ -259,3 +259,30 @@
 	for(i=0; i<src_size; i++)
 		((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ];
 }
+
+void yv12toyuy2(uint8_t *ysrc, uint8_t *usrc, uint8_t *vsrc, uint8_t *dst, int src_size)
+{
+	int i;
+	src_size>>=1;
+	for(i=0; i<src_size; i++)
+	{
+		dst[4*i+0] = ysrc[2*i+0];
+		dst[4*i+1] = usrc[i];
+		dst[4*i+2] = ysrc[2*i+1];
+		dst[4*i+3] = vsrc[i];
+	}
+
+}
+
+void yuy2toyv12(uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int src_size)
+{
+	int i;
+	src_size>>=1;
+	for(i=0; i<src_size; i++)
+	{
+		 ydst[2*i+0] 	= src[4*i+0];
+		 udst[i] 	= src[4*i+1];
+		 ydst[2*i+1] 	= src[4*i+2];
+		 vdst[i] 	= src[4*i+3];
+	}
+}
\ No newline at end of file

Index: rgb2rgb.h
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- rgb2rgb.h	4 Nov 2001 19:50:29 -0000	1.6
+++ rgb2rgb.h	5 Nov 2001 00:45:55 -0000	1.7
@@ -18,4 +18,8 @@
 void palette8torgb15(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette);
 void palette8torgb24(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette);
 
+void yv12toyuy2(uint8_t *ysrc, uint8_t *usrc, uint8_t *vsrc, uint8_t *dst, int src_size);
+void yuy2toyv12(uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int src_size);
+
+
 #endif




More information about the MPlayer-cvslog mailing list