[Mplayer-cvslog] CVS: main/libavcodec dsputil.c,1.4,1.5 mpegvideo.c,1.3,1.4
Nick Kurshev
nick at mplayer.dev.hu
Mon Jul 16 11:16:22 CEST 2001
Update of /cvsroot/mplayer/main/libavcodec
In directory mplayer:/var/tmp.root/cvs-serv25971/main/libavcodec
Modified Files:
dsputil.c mpegvideo.c
Log Message:
Minor x86 & MMX optimization
Index: dsputil.c
===================================================================
RCS file: /cvsroot/mplayer/main/libavcodec/dsputil.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dsputil.c 12 Jul 2001 18:11:03 -0000 1.4
+++ dsputil.c 16 Jul 2001 09:16:19 -0000 1.5
@@ -22,34 +22,15 @@
#include "dsputil.h"
#include "mpegvideo.h"
-#ifdef ARCH_X86
-/*
- * x86 CPUs can access unaligned 32-bit data, so we can speed up copying
- * DCT blocks a bit by using 32-bit data moves instead of 8-bit moves
- * (fewer instructions in the inner loop)
- */
-static void put_pixels_long(UINT8 *block, const UINT8 *pixels, int line_size, int h)
-{
- UINT32 *p;
- const UINT32 *pix;
-
- p = (UINT32*)block;
- pix = (UINT32*)pixels;
- do {
- p[0] = pix[0];
- p[1] = pix[1];
- pix = (UINT32*) ((char*)pix + line_size);
- p = (UINT32*) ((char*)p + line_size);
- } while (--h);
-}
-#endif
-
-
#ifndef HAVE_MMX
static UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
#endif
UINT32 squareTbl[512];
+#ifdef ARCH_X86
+static void put_pixels_long(UINT8 *block, const UINT8 *pixels, int line_size, int h);
+#endif
+
void dsputil_init(void)
{
int i;
@@ -146,6 +127,26 @@
p += 8;
}
}
+#ifdef ARCH_X86
+/*
+ * x86 CPUs can access unaligned 32-bit data, so we can speed up copying
+ * DCT blocks a bit by using 32-bit data moves instead of 8-bit moves
+ * (fewer instructions in the inner loop)
+ */
+static void put_pixels_long(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+{
+ UINT32 *p;
+ const UINT32 *pix;
+ p = (UINT32*)block;
+ pix = (UINT32*)pixels;
+ do {
+ p[0] = pix[0];
+ p[1] = pix[1];
+ pix = (UINT32*) ((char*)pix + line_size);
+ p = (UINT32*) ((char*)p + line_size);
+ } while (--h);
+}
+#endif
#endif
#define PIXOP(BTYPE, OPNAME, OP, INCR) \
\
Index: mpegvideo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libavcodec/mpegvideo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mpegvideo.c 10 Jul 2001 08:30:27 -0000 1.3
+++ mpegvideo.c 16 Jul 2001 09:16:19 -0000 1.4
@@ -352,13 +352,14 @@
}
}
-
/* generic function for encode/decode called before a frame is coded/decoded */
+#ifdef ARCH_X86
+#include "i386/mpegvideo.c"
+#else
void MPV_frame_start(MpegEncContext *s)
{
int i;
UINT8 *tmp;
-
if (s->pict_type == B_TYPE) {
for(i=0;i<3;i++) {
s->current_picture[i] = s->aux_picture[i];
@@ -373,7 +374,7 @@
}
}
}
-
+#endif
/* generic function for encode/decode called after a frame has been coded/decoded */
void MPV_frame_end(MpegEncContext *s)
{
More information about the MPlayer-cvslog
mailing list