[Mplayer-cvslog] CVS: main/postproc rgb2rgb.c,1.47,1.48 rgb2rgb_template.c,1.49,1.50

Alex Beregszaszi alex at mplayerhq.hu
Fri Jun 21 19:37:03 CEST 2002


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

Modified Files:
	rgb2rgb.c rgb2rgb_template.c 
Log Message:
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)

Index: rgb2rgb.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- rgb2rgb.c	13 Apr 2002 02:21:12 -0000	1.47
+++ rgb2rgb.c	21 Jun 2002 17:37:00 -0000	1.48
@@ -214,6 +214,23 @@
 	}
 }
 
+void bgr24torgb24(const uint8_t *src, uint8_t *dst, unsigned src_size)
+{
+#ifdef CAN_COMPILE_X86_ASM
+	// ordered per speed fasterst first
+	if(gCpuCaps.hasMMX2)
+		bgr24torgb24_MMX2(src, dst, src_size);
+	else if(gCpuCaps.has3DNow)
+		bgr24torgb24_3DNow(src, dst, src_size);
+	else if(gCpuCaps.hasMMX)
+		bgr24torgb24_MMX(src, dst, src_size);
+	else
+		bgr24torgb24_C(src, dst, src_size);
+#else
+		bgr24torgb24_C(src, dst, src_size);
+#endif
+}
+
 void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size)
 {
 #ifdef CAN_COMPILE_X86_ASM
@@ -429,6 +446,26 @@
 		uyvytoyv12_C(src, ydst, udst, vdst, width,  height, lumStride, chromStride, srcStride);
 #else
 		uyvytoyv12_C(src, ydst, udst, vdst, width,  height, lumStride, chromStride, srcStride);
+#endif
+}
+
+void yvu9toyv12(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
+	uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
+	unsigned int width, unsigned int height,
+	unsigned int lumStride, unsigned int chromStride)
+{
+#ifdef CAN_COMPILE_X86_ASM
+	// ordered per speed fasterst first
+	if(gCpuCaps.hasMMX2)
+		yvu9toyv12_MMX2(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
+	else if(gCpuCaps.has3DNow)
+		yvu9toyv12_3DNow(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
+	else if(gCpuCaps.hasMMX)
+		yvu9toyv12_MMX(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
+	else
+		yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
+#else
+		yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
 #endif
 }
 

Index: rgb2rgb_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb_template.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- rgb2rgb_template.c	15 May 2002 02:27:41 -0000	1.49
+++ rgb2rgb_template.c	21 Jun 2002 17:37:00 -0000	1.50
@@ -244,6 +244,17 @@
 #endif
 }
 
+static inline void RENAME(bgr24torgb24)(const uint8_t *src, uint8_t *dst, unsigned src_size)
+{
+	unsigned j,i,num_pixels=src_size/3;
+	for(i=0,j=0; j<num_pixels; i+=3,j+=3)
+	{
+		dst[j+0] = src[i+2];
+		dst[j+1] = src[i+1];
+		dst[j+2] = src[i+0];
+	}
+}
+
 static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, unsigned src_size)
 {
 #ifdef HAVE_MMX
@@ -851,6 +862,16 @@
         	SFENCE" \n\t"
         	:::"memory");
 #endif
+}
+
+static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
+	uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
+	unsigned int width, unsigned int height, unsigned int lumStride, unsigned int chromStride)
+{
+	/* Y Plane */
+	memcpy(ydst, ysrc, width*height);
+
+	/* XXX: implement upscaling for U,V */
 }
 
 /**





More information about the MPlayer-cvslog mailing list