diff i386/dsputil_mmx_rnd.h @ 2209:c4a476971abc libavcodec

h264 luma motion compensation in mmx2/3dnow
author michael
date Tue, 07 Sep 2004 01:48:45 +0000
parents f65d87bfdd5a
children 15cfba1b97b5
line wrap: on
line diff
--- a/i386/dsputil_mmx_rnd.h	Mon Sep 06 10:32:47 2004 +0000
+++ b/i386/dsputil_mmx_rnd.h	Tue Sep 07 01:48:45 2004 +0000
@@ -296,6 +296,25 @@
 }
 
 // avg_pixels
+static void DEF(avg, pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+{
+    MOVQ_BFE(mm6);
+    JUMPALIGN();
+    do {
+	__asm __volatile(
+	     "movd  %0, %%mm0		\n\t"
+	     "movd  %1, %%mm1		\n\t"
+	     PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
+	     "movd  %%mm2, %0		\n\t"
+	     :"+m"(*block)
+	     :"m"(*pixels)
+	     :"memory");
+	pixels += line_size;
+	block += line_size;
+    }
+    while (--h);
+}
+
 // in case more speed is needed - unroling would certainly help
 static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
 {