[Mplayer-cvslog] CVS: main/libavcodec dsputil.c,1.2,1.3

Nick Kurshev nick at mplayer.dev.hu
Tue Jul 10 23:34:17 CEST 2001


Update of /cvsroot/mplayer/main/libavcodec
In directory mplayer:/var/tmp.root/cvs-serv2779/main/libavcodec

Modified Files:
	dsputil.c 
Log Message:
Added MMX optimized pixel operation. It speedup decoding on 6% on K7 system

Index: dsputil.c
===================================================================
RCS file: /cvsroot/mplayer/main/libavcodec/dsputil.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dsputil.c	10 Jul 2001 08:30:27 -0000	1.2
+++ dsputil.c	10 Jul 2001 21:34:14 -0000	1.3
@@ -22,19 +22,21 @@
 #include "dsputil.h"
 #include "mpegvideo.h"
 
+#ifndef HAVE_MMX
 static UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
+#endif
 UINT32 squareTbl[512];
 
 void dsputil_init(void)
 {
     int i;
-
+#ifndef HAVE_MMX
     for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i;
     for(i=0;i<MAX_NEG_CROP;i++) {
         cropTbl[i] = 0;
         cropTbl[i + MAX_NEG_CROP + 256] = 255;
     }
-
+#endif
     for(i=0;i<512;i++) {
         squareTbl[i] = (i - 256) * (i - 256);
     }
@@ -63,8 +65,12 @@
     }
 }
 
+#ifdef HAVE_MMX
+#include "i386/dsputil_mmx.c"
+#else
 void put_pixels_clamped(const DCTELEM *block, UINT8 *pixels, int line_size)
 {
+
     const DCTELEM *p;
     UINT8 *pix;
     int i;
@@ -73,6 +79,7 @@
     /* read the pixels */
     p = block;
     pix = pixels;
+    /* Indeed this loop converts shorts to chars with saturation */
     for(i=0;i<8;i++) {
         pix[0] = cm[p[0]];
         pix[1] = cm[p[1]];
@@ -97,6 +104,7 @@
     /* read the pixels */
     p = block;
     pix = pixels;
+    /* Indeed this loop converts shorts to chars with saturation */
     for(i=0;i<8;i++) {
         pix[0] = cm[pix[0] + p[0]];
         pix[1] = cm[pix[1] + p[1]];
@@ -110,7 +118,7 @@
         p += 8;
     }
 }
-
+#endif
 #define PIXOP(BTYPE, OPNAME, OP, INCR)                                                   \
                                                                                          \
 static void OPNAME ## _pixels(BTYPE *block, const UINT8 *pixels, int line_size, int h)    \




More information about the MPlayer-cvslog mailing list