[Mplayer-cvslog] CVS: main/postproc rgb2rgb_template.c,1.59,1.60

Michael Niedermayer CVS michael at mplayerhq.hu
Tue Feb 11 14:13:30 CET 2003


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

Modified Files:
	rgb2rgb_template.c 
Log Message:
yv12 -> yuy2 converter in alpha asm (from mplayerxp)


Index: rgb2rgb_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb_template.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- rgb2rgb_template.c	11 Feb 2003 12:57:53 -0000	1.59
+++ rgb2rgb_template.c	11 Feb 2003 13:13:16 -0000	1.60
@@ -1413,7 +1413,55 @@
 			: "%eax"
 		);
 #else
-#if __WORDSIZE >= 64
+
+#if defined ARCH_ALPHA && defined HAVE_MVI
+#define pl2yuy2(n)					\
+	y1 = yc[n];					\
+	y2 = yc2[n];					\
+	u = uc[n];					\
+	v = vc[n];					\
+	asm("unpkbw %1, %0" : "=r"(y1) : "r"(y1));	\
+	asm("unpkbw %1, %0" : "=r"(y2) : "r"(y2));	\
+	asm("unpkbl %1, %0" : "=r"(u) : "r"(u));	\
+	asm("unpkbl %1, %0" : "=r"(v) : "r"(v));	\
+	yuv1 = (u << 8) + (v << 24);			\
+	yuv2 = yuv1 + y2;				\
+	yuv1 += y1;					\
+	qdst[n] = yuv1;					\
+	qdst2[n] = yuv2;
+
+		int i;
+		uint64_t *qdst = (uint64_t *) dst;
+		uint64_t *qdst2 = (uint64_t *) (dst + dstStride);
+		const uint32_t *yc = (uint32_t *) ysrc;
+		const uint32_t *yc2 = (uint32_t *) (ysrc + lumStride);
+		const uint16_t *uc = (uint16_t*) usrc, *vc = (uint16_t*) vsrc;
+		for(i = 0; i < chromWidth; i += 8){
+			uint64_t y1, y2, yuv1, yuv2;
+			uint64_t u, v;
+			/* Prefetch */
+			asm("ldq $31,64(%0)" :: "r"(yc));
+			asm("ldq $31,64(%0)" :: "r"(yc2));
+			asm("ldq $31,64(%0)" :: "r"(uc));
+			asm("ldq $31,64(%0)" :: "r"(vc));
+
+			pl2yuy2(0);
+			pl2yuy2(1);
+			pl2yuy2(2);
+			pl2yuy2(3);
+
+			yc += 4;
+			yc2 += 4;
+			uc += 4;
+			vc += 4;
+			qdst += 4;
+			qdst2 += 4;
+		}
+		y++;
+		ysrc += lumStride;
+		dst += dstStride;
+
+#elif __WORDSIZE >= 64
 		int i;
 		uint64_t *ldst = (uint64_t *) dst;
 		const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
@@ -2354,7 +2402,7 @@
 	x2=0;
 	x=0;
 #ifdef HAVE_MMX
-	for(;x<w;x+=8,x2+=32)
+	for(;x<w-7;x+=8,x2+=32)
 	{
 	    asm volatile(
 		PREFETCH" 32%1\n\t"



More information about the MPlayer-cvslog mailing list