changeset 12004:2002ea7c06f6 libavcodec

MMXEXT version of vp8 4x4 vertical pred
author darkshikari
date Tue, 29 Jun 2010 00:23:52 +0000
parents 3b761226ea35
children 88563eada57f
files x86/h264_intrapred.asm x86/h264dsp_mmx.c
diffstat 2 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/x86/h264_intrapred.asm	Mon Jun 28 23:53:07 2010 +0000
+++ b/x86/h264_intrapred.asm	Tue Jun 29 00:23:52 2010 +0000
@@ -27,6 +27,7 @@
 
 SECTION .text
 
+cextern pb_1
 cextern pb_3
 
 ;-----------------------------------------------------------------------------
@@ -572,3 +573,35 @@
     movd [r1+r2*1], mm4
     movd [r1+r2*2], mm5
     RET
+
+; dest, left, right, src, tmp
+; output: %1 = (t[n-1] + t[n]*2 + t[n+1] + 2) >> 2
+%macro PRED4x4_LOWPASS 5
+    mova    %5, %2
+    pavgb   %2, %3
+    pxor    %3, %5
+    mova    %1, %4
+    pand    %3, [pb_1]
+    psubusb %2, %3
+    pavgb   %1, %2
+%endmacro
+
+;-----------------------------------------------------------------------------
+; void pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
+;-----------------------------------------------------------------------------
+
+INIT_MMX
+cglobal pred4x4_vertical_vp8_mmxext, 3,3
+    sub       r0, r2
+    movd      m1, [r0-1]
+    movd      m0, [r0]
+    mova      m2, m0   ;t0 t1 t2 t3
+    punpckldq m0, [r1] ;t0 t1 t2 t3 t4 t5 t6 t7
+    lea       r1, [r0+r2*2]
+    psrlq     m0, 8    ;t1 t2 t3 t4
+    PRED4x4_LOWPASS m3, m1, m0, m2, m4
+    movd [r0+r2*1], m3
+    movd [r0+r2*2], m3
+    movd [r1+r2*1], m3
+    movd [r1+r2*2], m3
+    RET
--- a/x86/h264dsp_mmx.c	Mon Jun 28 23:53:07 2010 +0000
+++ b/x86/h264dsp_mmx.c	Tue Jun 29 00:23:52 2010 +0000
@@ -2348,6 +2348,7 @@
 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);
+void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
 
 #if CONFIG_H264DSP
 void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
@@ -2375,6 +2376,7 @@
             h->pred8x8  [DC_PRED8x8   ] = ff_pred8x8_dc_rv40_mmxext;
             h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext;
             h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_mmxext;
+            h->pred4x4  [VERT_PRED    ] = ff_pred4x4_vertical_vp8_mmxext;
         }
     }