[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec/i386 dsputil_h264_template_mmx.c, 1.5, 1.6 dsputil_mmx.c, 1.116, 1.117 h264dsp_mmx.c, 1.20, 1.21

Loren Merritt CVS lorenm
Wed Mar 22 23:05:03 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec/i386
In directory mail:/var2/tmp/cvs-serv20861/i386

Modified Files:
	dsputil_h264_template_mmx.c dsputil_mmx.c h264dsp_mmx.c 
Log Message:
h264_chroma_mc2_mmx



Index: dsputil_h264_template_mmx.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dsputil_h264_template_mmx.c	5 Feb 2006 13:35:17 -0000	1.5
+++ dsputil_h264_template_mmx.c	22 Mar 2006 22:05:00 -0000	1.6
@@ -240,7 +240,7 @@
     }
 }
 
-static void H264_CHROMA_MC4_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
+static void H264_CHROMA_MC4_TMPL(uint8_t *dst/*align 4*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
 {
     DECLARE_ALIGNED_8(uint64_t, AA);
     DECLARE_ALIGNED_8(uint64_t, DD);
@@ -319,3 +319,66 @@
         dst += stride;
     }
 }
+
+#ifdef H264_CHROMA_MC2_TMPL
+static void H264_CHROMA_MC2_TMPL(uint8_t *dst/*align 2*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
+{
+    int CD=((1<<16)-1)*x*y + 8*y;
+    int AB=((8<<16)-8)*x + 64 - CD;
+    int i;
+
+    asm volatile(
+        /* mm5 = {A,B,A,B} */
+        /* mm6 = {C,D,C,D} */
+        "movd %0, %%mm5\n\t"
+        "movd %1, %%mm6\n\t"
+        "punpckldq %%mm5, %%mm5\n\t"
+        "punpckldq %%mm6, %%mm6\n\t"
+        "pxor %%mm7, %%mm7\n\t"
+        :: "r"(AB), "r"(CD));
+
+    asm volatile(
+        /* mm0 = src[0,1,1,2] */
+        "movd %0, %%mm0\n\t"
+        "punpcklbw %%mm7, %%mm0\n\t"
+        "pshufw $0x94, %%mm0, %%mm0\n\t"
+        :: "m"(src[0]));
+
+    for(i=0; i<h; i++) {
+        asm volatile(
+            /* mm1 = A * src[0,1] + B * src[1,2] */
+            "movq    %%mm0, %%mm1\n\t"
+            "pmaddwd %%mm5, %%mm1\n\t"
+            ::);
+
+        src += stride;
+        asm volatile(
+            /* mm0 = src[0,1,1,2] */
+            "movd %0, %%mm0\n\t"
+            "punpcklbw %%mm7, %%mm0\n\t"
+            "pshufw $0x94, %%mm0, %%mm0\n\t"
+            :: "m"(src[0]));
+
+        asm volatile(
+            /* mm1 += C * src[0,1] + D * src[1,2] */
+            "movq    %%mm0, %%mm2\n\t"
+            "pmaddwd %%mm6, %%mm2\n\t"
+            "paddw   %%mm2, %%mm1\n\t"
+            ::);
+
+        asm volatile(
+            /* dst[0,1] = pack((mm1 + 32) >> 6) */
+            "paddw %1, %%mm1\n\t"
+            "psrlw $6, %%mm1\n\t"
+            "packssdw %%mm7, %%mm1\n\t"
+            "packuswb %%mm7, %%mm1\n\t"
+            /* writes garbage to the right of dst.
+             * ok because partitions are processed from left to right. */
+            H264_CHROMA_OP4(%0, %%mm1, %%mm3)
+            "movd %%mm1, %0\n\t"
+            : "=m" (dst[0]) : "m" (ff_pw_32) : "eax");
+        dst += stride;
+    }
+}
+#endif
+

Index: dsputil_mmx.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/dsputil_mmx.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- dsputil_mmx.c	22 Mar 2006 12:08:35 -0000	1.116
+++ dsputil_mmx.c	22 Mar 2006 22:05:00 -0000	1.117
@@ -2848,6 +2848,8 @@
 
             c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_mmx2;
             c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_mmx2;
+            c->avg_h264_chroma_pixels_tab[2]= avg_h264_chroma_mc2_mmx2;
+            c->put_h264_chroma_pixels_tab[2]= put_h264_chroma_mc2_mmx2;
             c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_mmx2;
             c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_mmx2;
             c->h264_v_loop_filter_chroma= h264_v_loop_filter_chroma_mmx2;

Index: h264dsp_mmx.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/h264dsp_mmx.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- h264dsp_mmx.c	7 Mar 2006 22:45:56 -0000	1.20
+++ h264dsp_mmx.c	22 Mar 2006 22:05:00 -0000	1.21
@@ -1296,12 +1296,14 @@
 #define H264_CHROMA_OP4(S,D,T)
 #define H264_CHROMA_MC8_TMPL put_h264_chroma_mc8_mmx
 #define H264_CHROMA_MC4_TMPL put_h264_chroma_mc4_mmx
+#define H264_CHROMA_MC2_TMPL put_h264_chroma_mc2_mmx2
 #define H264_CHROMA_MC8_MV0 put_pixels8_mmx
 #include "dsputil_h264_template_mmx.c"
 #undef H264_CHROMA_OP
 #undef H264_CHROMA_OP4
 #undef H264_CHROMA_MC8_TMPL
 #undef H264_CHROMA_MC4_TMPL
+#undef H264_CHROMA_MC2_TMPL
 #undef H264_CHROMA_MC8_MV0
 
 #define H264_CHROMA_OP(S,D) "pavgb " #S ", " #D " \n\t"
@@ -1309,12 +1311,14 @@
                                "pavgb " #T ", " #D " \n\t"
 #define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_mmx2
 #define H264_CHROMA_MC4_TMPL avg_h264_chroma_mc4_mmx2
+#define H264_CHROMA_MC2_TMPL avg_h264_chroma_mc2_mmx2
 #define H264_CHROMA_MC8_MV0 avg_pixels8_mmx2
 #include "dsputil_h264_template_mmx.c"
 #undef H264_CHROMA_OP
 #undef H264_CHROMA_OP4
 #undef H264_CHROMA_MC8_TMPL
 #undef H264_CHROMA_MC4_TMPL
+#undef H264_CHROMA_MC2_TMPL
 #undef H264_CHROMA_MC8_MV0
 
 #define H264_CHROMA_OP(S,D) "pavgusb " #S ", " #D " \n\t"





More information about the ffmpeg-cvslog mailing list