[FFmpeg-cvslog] r26157 - in trunk/libavcodec/x86: h264_intrapred.asm h264_intrapred_init.c

rbultje subversion
Wed Dec 29 22:49:57 CET 2010


Author: rbultje
Date: Wed Dec 29 22:49:57 2010
New Revision: 26157

Log:
Port pred4x4_horizontal_down_mmxext (H.264 intra prediction) from x264
(authors:Jason, Loren, Holger) to FFmpeg. Patch by Daniel Kang <daniel dot
d dot kang at gmail com>, as part of Google's GCI 2010.

Modified:
   trunk/libavcodec/x86/h264_intrapred.asm
   trunk/libavcodec/x86/h264_intrapred_init.c

Modified: trunk/libavcodec/x86/h264_intrapred.asm
==============================================================================
--- trunk/libavcodec/x86/h264_intrapred.asm	Wed Dec 29 22:42:33 2010	(r26156)
+++ trunk/libavcodec/x86/h264_intrapred.asm	Wed Dec 29 22:49:57 2010	(r26157)
@@ -2594,4 +2594,40 @@ cglobal pred4x4_horizontal_up_mmxext, 3,
     movd    [r1+r2*1], m7
     movd    [r1+r2*2], m1
     RET
+
+;-----------------------------------------------------------------------------
+; void pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+;-----------------------------------------------------------------------------
+
+INIT_MMX
+%define PALIGNR PALIGNR_MMX
+cglobal pred4x4_horizontal_down_mmxext, 3,3
+    sub       r0, r2
+    lea       r1, [r0+r2*2]
+    movh      m0, [r0-4]      ; lt ..
+    punpckldq m0, [r0]        ; t3 t2 t1 t0 lt .. .. ..
+    psllq     m0, 8           ; t2 t1 t0 lt .. .. .. ..
+    movq      m1, [r1+r2*2-8] ; l3
+    punpckhbw m1, [r1+r2*1-8] ; l2 l3
+    movq      m2, [r0+r2*2-8] ; l1
+    punpckhbw m2, [r0+r2*1-8] ; l0 l1
+    punpckhwd m1, m2          ; l0 l1 l2 l3
+    punpckhdq m1, m0          ; t2 t1 t0 lt l0 l1 l2 l3
+    movq      m0, m1
+    movq      m2, m1
+    movq      m5, m1
+    psrlq     m0, 16          ; .. .. t2 t1 t0 lt l0 l1
+    psrlq     m2, 8           ; .. t2 t1 t0 lt l0 l1 l2
+    pavgb     m5, m2
+    PRED4x4_LOWPASS m3, m1, m0, m2, m4
+    punpcklbw m5, m3
+    psrlq     m3, 32
+    PALIGNR   m3, m5, 6, m4
+    movh      [r1+r2*2], m5
+    psrlq     m5, 16
+    movh      [r1+r2*1], m5
+    psrlq     m5, 16
+    movh      [r0+r2*2], m5
+    movh      [r0+r2*1], m3
+    RET
 %endif

Modified: trunk/libavcodec/x86/h264_intrapred_init.c
==============================================================================
--- trunk/libavcodec/x86/h264_intrapred_init.c	Wed Dec 29 22:42:33 2010	(r26156)
+++ trunk/libavcodec/x86/h264_intrapred_init.c	Wed Dec 29 22:49:57 2010	(r26157)
@@ -86,6 +86,7 @@ void ff_pred4x4_dc_mmxext          (uint
 void ff_pred4x4_down_left_mmxext   (uint8_t *src, const uint8_t *topright, int stride);
 void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
 void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride);
+void ff_pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride);
 void ff_pred4x4_tm_vp8_mmx         (uint8_t *src, const uint8_t *topright, int stride);
 void ff_pred4x4_tm_vp8_mmxext      (uint8_t *src, const uint8_t *topright, int stride);
 void ff_pred4x4_tm_vp8_ssse3       (uint8_t *src, const uint8_t *topright, int stride);
@@ -130,6 +131,7 @@ void ff_h264_pred_init_x86(H264PredConte
         h->pred8x8l [VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_mmxext;
         h->pred8x8l [HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_mmxext;
         h->pred8x8l [HOR_DOWN_PRED       ] = ff_pred8x8l_horizontal_down_mmxext;
+        h->pred4x4  [HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_mmxext;
 #endif
         h->pred4x4  [DC_PRED     ] = ff_pred4x4_dc_mmxext;
 #if CONFIG_GPL



More information about the ffmpeg-cvslog mailing list