Commit da3f08fa authored by Jian Zhou's avatar Jian Zhou

Speed up h_predictor_8x8

Relocate the function from SSSE3 to SSE2, Unroll loop from 4 to 2,
and reduce mem access to left.
Speed up by >20% in ./test_intra_pred_speed.

Change-Id: Ib9f1846819783b6e05e2a310c930eb844b2b4d2e
parent aa2764ab
...@@ -239,15 +239,16 @@ INTRA_PRED_TEST(C, TestIntraPred8, vpx_dc_predictor_8x8_c, ...@@ -239,15 +239,16 @@ INTRA_PRED_TEST(C, TestIntraPred8, vpx_dc_predictor_8x8_c,
#if HAVE_SSE2 && CONFIG_USE_X86INC #if HAVE_SSE2 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSE2, TestIntraPred8, vpx_dc_predictor_8x8_sse2, INTRA_PRED_TEST(SSE2, TestIntraPred8, vpx_dc_predictor_8x8_sse2,
vpx_dc_left_predictor_8x8_sse2, vpx_dc_top_predictor_8x8_sse2, vpx_dc_left_predictor_8x8_sse2, vpx_dc_top_predictor_8x8_sse2,
vpx_dc_128_predictor_8x8_sse2, vpx_v_predictor_8x8_sse2, NULL, vpx_dc_128_predictor_8x8_sse2, vpx_v_predictor_8x8_sse2,
NULL, NULL, NULL, NULL, NULL, NULL, vpx_tm_predictor_8x8_sse2) vpx_h_predictor_8x8_sse2, NULL, NULL, NULL, NULL, NULL,
NULL, vpx_tm_predictor_8x8_sse2)
#endif // HAVE_SSE2 && CONFIG_USE_X86INC #endif // HAVE_SSE2 && CONFIG_USE_X86INC
#if HAVE_SSSE3 && CONFIG_USE_X86INC #if HAVE_SSSE3 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL, INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL,
vpx_h_predictor_8x8_ssse3, vpx_d45_predictor_8x8_ssse3, NULL, NULL, vpx_d45_predictor_8x8_ssse3, NULL, NULL,
NULL, vpx_d153_predictor_8x8_ssse3, vpx_d153_predictor_8x8_ssse3, vpx_d207_predictor_8x8_ssse3,
vpx_d207_predictor_8x8_ssse3, vpx_d63_predictor_8x8_ssse3, NULL) vpx_d63_predictor_8x8_ssse3, NULL)
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC #endif // HAVE_SSSE3 && CONFIG_USE_X86INC
#if HAVE_DSPR2 #if HAVE_DSPR2
......
...@@ -130,7 +130,7 @@ add_proto qw/void vpx_d63e_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, co ...@@ -130,7 +130,7 @@ add_proto qw/void vpx_d63e_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, co
specialize qw/vpx_d63e_predictor_8x8/; specialize qw/vpx_d63e_predictor_8x8/;
add_proto qw/void vpx_h_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_h_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
specialize qw/vpx_h_predictor_8x8 neon dspr2 msa/, "$ssse3_x86inc"; specialize qw/vpx_h_predictor_8x8 neon dspr2 msa/, "$sse2_x86inc";
add_proto qw/void vpx_d117_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d117_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
specialize qw/vpx_d117_predictor_8x8/; specialize qw/vpx_d117_predictor_8x8/;
......
...@@ -533,6 +533,29 @@ cglobal h_predictor_4x4, 2, 4, 4, dst, stride, line, left ...@@ -533,6 +533,29 @@ cglobal h_predictor_4x4, 2, 4, 4, dst, stride, line, left
movd [dstq+strideq], m3 movd [dstq+strideq], m3
RET RET
INIT_XMM sse2
cglobal h_predictor_8x8, 2, 5, 3, dst, stride, line, left
movifnidn leftq, leftmp
mov lineq, -2
DEFINE_ARGS dst, stride, line, left, stride3
lea stride3q, [strideq*3]
movq m0, [leftq ]
punpcklbw m0, m0 ; l1 l1 l2 l2 ... l8 l8
.loop:
pshuflw m1, m0, 0x0 ; l1 l1 l1 l1 l1 l1 l1 l1
pshuflw m2, m0, 0x55 ; l2 l2 l2 l2 l2 l2 l2 l2
movq [dstq ], m1
movq [dstq+strideq], m2
pshuflw m1, m0, 0xaa
pshuflw m2, m0, 0xff
movq [dstq+strideq*2], m1
movq [dstq+stride3q ], m2
pshufd m0, m0, 0xe ; [63:0] l5 l5 l6 l6 l7 l7 l8 l8
inc lineq
lea dstq, [dstq+strideq*4]
jnz .loop
REP_RET
INIT_XMM sse2 INIT_XMM sse2
cglobal tm_predictor_4x4, 4, 4, 5, dst, stride, above, left cglobal tm_predictor_4x4, 4, 4, 5, dst, stride, above, left
pxor m1, m1 pxor m1, m1
......
...@@ -33,24 +33,6 @@ sh_b2333: db 2, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ...@@ -33,24 +33,6 @@ sh_b2333: db 2, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
SECTION .text SECTION .text
INIT_MMX ssse3
cglobal h_predictor_8x8, 2, 4, 3, dst, stride, line, left
movifnidn leftq, leftmp
add leftq, 8
mov lineq, -4
pxor m0, m0
.loop:
movd m1, [leftq+lineq*2 ]
movd m2, [leftq+lineq*2+1]
pshufb m1, m0
pshufb m2, m0
movq [dstq ], m1
movq [dstq+strideq], m2
lea dstq, [dstq+strideq*2]
inc lineq
jnz .loop
REP_RET
INIT_XMM ssse3 INIT_XMM ssse3
cglobal h_predictor_16x16, 2, 4, 3, dst, stride, line, left cglobal h_predictor_16x16, 2, 4, 3, dst, stride, line, left
movifnidn leftq, leftmp movifnidn leftq, leftmp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment