[x264-devel] commit: Predict 4x4_DC asm (Jason Garrett-Glaser )
git version control
git at videolan.org
Fri Sep 5 22:13:24 CEST 2008
x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Thu Sep 4 20:13:38 2008 -0700| [e48a952cb74741fbf13d0ec352906dc2f3a61e4b] | committer: Jason Garrett-Glaser
Predict 4x4_DC asm
Also remove 5-year-old unnecessary #define that reduced speed unnecessarily under MSVC-compiled builds
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e48a952cb74741fbf13d0ec352906dc2f3a61e4b
---
common/predict.c | 3 ---
common/x86/predict-a.asm | 25 +++++++++++++++++++++++++
common/x86/predict-c.c | 2 ++
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/common/predict.c b/common/predict.c
index f8c49cc..9a66ed9 100644
--- a/common/predict.c
+++ b/common/predict.c
@@ -27,9 +27,6 @@
#include "common.h"
-#ifdef _MSC_VER
-#undef HAVE_MMX /* not finished now */
-#endif
#ifdef HAVE_MMX
# include "x86/predict.h"
#endif
diff --git a/common/x86/predict-a.asm b/common/x86/predict-a.asm
index 0768558..c41ce48 100644
--- a/common/x86/predict-a.asm
+++ b/common/x86/predict-a.asm
@@ -146,6 +146,31 @@ cglobal predict_4x4_vl_mmxext, 1,1
RET
;-----------------------------------------------------------------------------
+; void predict_4x4_dc( uint8_t *src )
+;-----------------------------------------------------------------------------
+
+cglobal predict_4x4_dc_mmxext, 1,4
+ pxor mm7, mm7
+ movd mm0, [r0-FDEC_STRIDE]
+ psadbw mm0, mm7
+ movd r3d, mm0
+ movzx r1d, byte [r0-1]
+%assign n 1
+%rep 3
+ movzx r2d, byte [r0+FDEC_STRIDE*n-1]
+ add r1d, r2d
+%assign n n+1
+%endrep
+ lea r1d, [r1+r3+4]
+ shr r1d, 3
+ imul r1d, 0x01010101
+ mov [r0+FDEC_STRIDE*0], r1d
+ mov [r0+FDEC_STRIDE*1], r1d
+ mov [r0+FDEC_STRIDE*2], r1d
+ mov [r0+FDEC_STRIDE*3], r1d
+ RET
+
+;-----------------------------------------------------------------------------
; void predict_8x8_v_mmxext( uint8_t *src, uint8_t *edge )
;-----------------------------------------------------------------------------
cglobal predict_8x8_v_mmxext, 2,2
diff --git a/common/x86/predict-c.c b/common/x86/predict-c.c
index d70c25a..34a98d6 100644
--- a/common/x86/predict-c.c
+++ b/common/x86/predict-c.c
@@ -49,6 +49,7 @@ extern void predict_8x8_vl_sse2( uint8_t *src, uint8_t edge[33] );
extern void predict_8x8_vr_core_mmxext( uint8_t *src, uint8_t edge[33] );
extern void predict_4x4_ddl_mmxext( uint8_t *src );
extern void predict_4x4_vl_mmxext( uint8_t *src );
+extern void predict_4x4_dc_mmxext( uint8_t *src );
extern void predict_16x16_dc_top_sse2( uint8_t *src );
extern void predict_16x16_dc_core_sse2( uint8_t *src, int i_dc_left );
extern void predict_16x16_v_sse2( uint8_t *src );
@@ -555,4 +556,5 @@ void x264_predict_4x4_init_mmx( int cpu, x264_predict_t pf[12] )
return;
pf[I_PRED_4x4_DDL] = predict_4x4_ddl_mmxext;
pf[I_PRED_4x4_VL] = predict_4x4_vl_mmxext;
+ pf[I_PRED_4x4_DC] = predict_4x4_dc_mmxext;
}
More information about the x264-devel
mailing list