[Mplayer-cvslog] CVS: main/postproc postprocess_template.c,1.49,1.50

Michael Niedermayer michael at mplayer.dev.hu
Wed Nov 28 02:26:13 CET 2001


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

Modified Files:
	postprocess_template.c 
Log Message:
faster brightness correcture in MMX2


Index: postprocess_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/postprocess_template.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- postprocess_template.c	27 Nov 2001 02:25:31 -0000	1.49
+++ postprocess_template.c	28 Nov 2001 01:26:03 -0000	1.50
@@ -2464,7 +2464,30 @@
 						"movq packedYOffset, %%mm2	\n\t"
 						"movq packedYScale, %%mm3	\n\t"
 						"pxor %%mm4, %%mm4	\n\t"
+#ifdef HAVE_MMX2
+#define SCALED_CPY(src1, src2, dst1, dst2)					\
+						"movq " #src1 ", %%mm0	\n\t"\
+						"movq " #src1 ", %%mm5	\n\t"\
+						"movq " #src2 ", %%mm1	\n\t"\
+						"movq " #src2 ", %%mm6	\n\t"\
+						"punpcklbw %%mm0, %%mm0 \n\t"\
+						"punpckhbw %%mm5, %%mm5 \n\t"\
+						"punpcklbw %%mm1, %%mm1 \n\t"\
+						"punpckhbw %%mm6, %%mm6 \n\t"\
+						"pmulhuw %%mm3, %%mm0	\n\t"\
+						"pmulhuw %%mm3, %%mm5	\n\t"\
+						"pmulhuw %%mm3, %%mm1	\n\t"\
+						"pmulhuw %%mm3, %%mm6	\n\t"\
+						"psubw %%mm2, %%mm0	\n\t"\
+						"psubw %%mm2, %%mm5	\n\t"\
+						"psubw %%mm2, %%mm1	\n\t"\
+						"psubw %%mm2, %%mm6	\n\t"\
+						"packuswb %%mm5, %%mm0	\n\t"\
+						"packuswb %%mm6, %%mm1	\n\t"\
+						"movq %%mm0, " #dst1 "	\n\t"\
+						"movq %%mm1, " #dst2 "	\n\t"\
 
+#else //HAVE_MMX2
 #define SCALED_CPY(src1, src2, dst1, dst2)					\
 						"movq " #src1 ", %%mm0	\n\t"\
 						"movq " #src1 ", %%mm5	\n\t"\
@@ -2491,6 +2514,8 @@
 						"movq %%mm0, " #dst1 "	\n\t"\
 						"movq %%mm1, " #dst2 "	\n\t"\
 
+#endif //!HAVE_MMX2
+
 SCALED_CPY((%0)       , (%0, %2)      , (%1)       , (%1, %3))
 SCALED_CPY((%0, %2, 2), (%%eax, %2, 2), (%1, %3, 2), (%%ebx, %3, 2))
 SCALED_CPY((%0, %2, 4), (%%eax, %2, 4), (%1, %3, 4), (%%ebx, %3, 4))
@@ -2678,13 +2703,19 @@
 			clipped-= yHistogram[white];
 		}
 
+		scale= (double)(maxAllowedY - minAllowedY) / (double)(white-black);
+
+#ifdef HAVE_MMX2
+		packedYScale= (uint16_t)(scale*256.0 + 0.5);
+		packedYOffset= (((black*packedYScale)>>8) - minAllowedY) & 0xFFFF;
+#else
+		packedYScale= (uint16_t)(scale*1024.0 + 0.5);
 		packedYOffset= (black - minAllowedY) & 0xFFFF;
+#endif
+
 		packedYOffset|= packedYOffset<<32;
 		packedYOffset|= packedYOffset<<16;
 
-		scale= (double)(maxAllowedY - minAllowedY) / (double)(white-black);
-
-		packedYScale= (uint16_t)(scale*1024.0 + 0.5);
 		packedYScale|= packedYScale<<32;
 		packedYScale|= packedYScale<<16;
 	}




More information about the MPlayer-cvslog mailing list