[FFmpeg-cvslog] r23876 - in trunk/libavcodec/x86: h264_intrapred.asm h264dsp_mmx.c

darkshikari subversion
Tue Jun 29 02:23:52 CEST 2010


Author: darkshikari
Date: Tue Jun 29 02:23:52 2010
New Revision: 23876

Log:
MMXEXT version of vp8 4x4 vertical pred

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

Modified: trunk/libavcodec/x86/h264_intrapred.asm
==============================================================================
--- trunk/libavcodec/x86/h264_intrapred.asm	Tue Jun 29 01:53:07 2010	(r23875)
+++ trunk/libavcodec/x86/h264_intrapred.asm	Tue Jun 29 02:23:52 2010	(r23876)
@@ -27,6 +27,7 @@ tm_shuf: times 8 db 0x03, 0x80
 
 SECTION .text
 
+cextern pb_1
 cextern pb_3
 
 ;-----------------------------------------------------------------------------
@@ -572,3 +573,35 @@ cglobal pred4x4_tm_vp8_ssse3, 3,3
     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

Modified: trunk/libavcodec/x86/h264dsp_mmx.c
==============================================================================
--- trunk/libavcodec/x86/h264dsp_mmx.c	Tue Jun 29 01:53:07 2010	(r23875)
+++ trunk/libavcodec/x86/h264dsp_mmx.c	Tue Jun 29 02:23:52 2010	(r23876)
@@ -2348,6 +2348,7 @@ void ff_pred4x4_dc_mmxext          (uint
 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 @@ void ff_h264_pred_init_x86(H264PredConte
             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;
         }
     }
 



More information about the ffmpeg-cvslog mailing list