[Mplayer-cvslog] CVS: main/postproc postprocess.c,1.27,1.28

Michael Niedermayer michael at mplayer.dev.hu
Fri Oct 26 00:50:06 CEST 2001


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

Modified Files:
	postprocess.c 
Log Message:
3dnow dering


Index: postprocess.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/postprocess.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- postprocess.c	25 Oct 2001 21:55:11 -0000	1.27
+++ postprocess.c	25 Oct 2001 22:50:03 -0000	1.28
@@ -26,7 +26,7 @@
 isHorizMinMaxOk		a	E
 doHorizLowPass		E		e	e
 doHorizDefFilter	Ec	Ec	Ec
-deRing					e
+deRing					e	e*
 Vertical RKAlgo1	E		a	a
 Horizontal RKAlgo1			a	a
 Vertical X1		a		E	E
@@ -1808,7 +1808,7 @@
 
 static inline void dering(uint8_t src[], int stride, int QP)
 {
-#ifdef HAVE_MMX2
+#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
 	asm volatile(
 		"movq pQPb, %%mm0				\n\t"
 		"paddusb %%mm0, %%mm0				\n\t"
@@ -1821,11 +1821,20 @@
 
 		"pcmpeqb %%mm6, %%mm6				\n\t"
 		"pxor %%mm7, %%mm7				\n\t"
-
+#ifdef HAVE_MMX2
 #define FIND_MIN_MAX(addr)\
 		"movq " #addr ", %%mm0				\n\t"\
 		"pminub %%mm0, %%mm6				\n\t"\
 		"pmaxub %%mm0, %%mm7				\n\t"
+#else
+#define FIND_MIN_MAX(addr)\
+		"movq " #addr ", %%mm0				\n\t"\
+		"movq %%mm6, %%mm1				\n\t"\
+		"psubusb %%mm0, %%mm7				\n\t"\
+		"paddb %%mm0, %%mm7				\n\t"\
+		"psubusb %%mm0, %%mm1				\n\t"\
+		"psubb %%mm1, %%mm6				\n\t"
+#endif
 
 FIND_MIN_MAX((%%eax))
 FIND_MIN_MAX((%%eax, %1))
@@ -1838,36 +1847,49 @@
 
 		"movq %%mm6, %%mm4				\n\t"
 		"psrlq $8, %%mm6				\n\t"
-		"pminub %%mm4, %%mm6				\n\t" // min of pixels
 #ifdef HAVE_MMX2
+		"pminub %%mm4, %%mm6				\n\t" // min of pixels
 		"pshufw $0xF9, %%mm6, %%mm4			\n\t"
 		"pminub %%mm4, %%mm6				\n\t" // min of pixels
 		"pshufw $0xFE, %%mm6, %%mm4			\n\t"
+		"pminub %%mm4, %%mm6				\n\t"
 #else
+		"movq %%mm6, %%mm1				\n\t"
+		"psubusb %%mm4, %%mm1				\n\t"
+		"psubb %%mm1, %%mm6				\n\t"
 		"movq %%mm6, %%mm4				\n\t"
 		"psrlq $16, %%mm6				\n\t"
-		"pminub %%mm4, %%mm6				\n\t"
+		"movq %%mm6, %%mm1				\n\t"
+		"psubusb %%mm4, %%mm1				\n\t"
+		"psubb %%mm1, %%mm6				\n\t"
 		"movq %%mm6, %%mm4				\n\t"
 		"psrlq $32, %%mm6				\n\t"
+		"movq %%mm6, %%mm1				\n\t"
+		"psubusb %%mm4, %%mm1				\n\t"
+		"psubb %%mm1, %%mm6				\n\t"
 #endif
-		"pminub %%mm4, %%mm6				\n\t"
 
 
 		"movq %%mm7, %%mm4				\n\t"
 		"psrlq $8, %%mm7				\n\t"
-		"pmaxub %%mm4, %%mm7				\n\t" // max of pixels
 #ifdef HAVE_MMX2
+		"pmaxub %%mm4, %%mm7				\n\t" // max of pixels
 		"pshufw $0xF9, %%mm7, %%mm4			\n\t"
-		"pmaxub %%mm4, %%mm7				\n\t" // min of pixels
+		"pmaxub %%mm4, %%mm7				\n\t"
 		"pshufw $0xFE, %%mm7, %%mm4			\n\t"
+		"pmaxub %%mm4, %%mm7				\n\t"
 #else
+		"psubusb %%mm4, %%mm7				\n\t"
+		"paddb %%mm4, %%mm7				\n\t"
 		"movq %%mm7, %%mm4				\n\t"
 		"psrlq $16, %%mm7				\n\t"
-		"pmaxub %%mm4, %%mm7				\n\t"
+		"psubusb %%mm4, %%mm7				\n\t"
+		"paddb %%mm4, %%mm7				\n\t"
 		"movq %%mm7, %%mm4				\n\t"
 		"psrlq $32, %%mm7				\n\t"
+		"psubusb %%mm4, %%mm7				\n\t"
+		"paddb %%mm4, %%mm7				\n\t"
 #endif
-		"pmaxub %%mm4, %%mm7				\n\t"
 		PAVGB(%%mm6, %%mm7)				      // a=(max + min)/2
 		"punpcklbw %%mm7, %%mm7				\n\t"
 		"punpcklbw %%mm7, %%mm7				\n\t"




More information about the MPlayer-cvslog mailing list