[Mplayer-cvslog] CVS: main/postproc rgb2rgb.c,1.46,1.47 rgb2rgb_template.c,1.46,1.47 rgb2rgb.h,1.19,1.20

Michael Niedermayer michael at mplayer.dev.hu
Sat Apr 13 04:21:15 CEST 2002


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

Modified Files:
	rgb2rgb.c rgb2rgb_template.c rgb2rgb.h 
Log Message:
yuv422p -> yuy2 (untested)


Index: rgb2rgb.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- rgb2rgb.c	13 Apr 2002 00:48:21 -0000	1.46
+++ rgb2rgb.c	13 Apr 2002 02:21:12 -0000	1.47
@@ -362,6 +362,29 @@
 
 /**
  *
+ * width should be a multiple of 16
+ */
+void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
+	unsigned int width, unsigned int height,
+	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+{
+#ifdef CAN_COMPILE_X86_ASM
+	// ordered per speed fasterst first
+	if(gCpuCaps.hasMMX2)
+		yuv422ptoyuy2_MMX2(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
+	else if(gCpuCaps.has3DNow)
+		yuv422ptoyuy2_3DNow(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
+	else if(gCpuCaps.hasMMX)
+		yuv422ptoyuy2_MMX(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
+	else
+		yuv422ptoyuy2_C(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
+#else
+		yuv422ptoyuy2_C(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
+#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)
  */

Index: rgb2rgb_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb_template.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- rgb2rgb_template.c	13 Apr 2002 00:48:21 -0000	1.46
+++ rgb2rgb_template.c	13 Apr 2002 02:21:12 -0000	1.47
@@ -638,14 +638,9 @@
 	}
 }
 
-/**
- *
- * 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)
- */
-static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
+static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
-	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride, int vertLumPerChroma)
 {
 	int y;
 	const int chromWidth= width>>1;
@@ -696,7 +691,7 @@
 			dst[4*i+3] = vsrc[i];
 		}
 #endif
-		if(y&1)
+		if((y&(vertLumPerChroma-1))==(vertLumPerChroma-1) )
 		{
 			usrc += chromStride;
 			vsrc += chromStride;
@@ -709,6 +704,30 @@
         SFENCE" \n\t"
         :::"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)
+ */
+static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
+	unsigned int width, unsigned int height,
+	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+{
+	//FIXME interpolate chroma
+	RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
+}
+
+/**
+ *
+ * width should be a multiple of 16
+ */
+static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
+	unsigned int width, unsigned int height,
+	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
+{
+	RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1);
 }
 
 /**

Index: rgb2rgb.h
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- rgb2rgb.h	13 Apr 2002 00:48:21 -0000	1.19
+++ rgb2rgb.h	13 Apr 2002 02:21:12 -0000	1.20
@@ -28,6 +28,9 @@
 extern void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
 	unsigned int width, unsigned int height,
 	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
+extern void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
+	unsigned int width, unsigned int height,
+	unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
 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);




More information about the MPlayer-cvslog mailing list