[x265] [PATCH 4 of 8] asm: interp_4tap_horiz_pp_4x2_sse3

dtyx265 at gmail.com dtyx265 at gmail.com
Fri Apr 17 18:48:00 CEST 2015


# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1429287675 25200
# Node ID 722f24e9ddcb900ea48f658fee33bc05b67b6385
# Parent  df614d8d2b7bdfd45748722c91d7d7eaecf5cb57
asm: interp_4tap_horiz_pp_4x2_sse3

This replaces c code.

64-bit

./test/TestBench --testbench interp | grep "chroma_hpp\[  4x2\]"
chroma_hpp[  4x2]	2.09x 	 475.01   	 992.48

32-bit

./test/TestBench --testbench interp | grep "chroma_hpp\[  4x2\]"
chroma_hpp[  4x2]	2.42x 	 549.94   	 1329.94

diff -r df614d8d2b7b -r 722f24e9ddcb source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Apr 17 09:15:04 2015 -0700
+++ b/source/common/x86/asm-primitives.cpp	Fri Apr 17 09:21:15 2015 -0700
@@ -1358,6 +1358,7 @@
     {
         p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].filter_hpp = x265_interp_4tap_horiz_pp_2x4_sse3;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_2x8].filter_hpp = x265_interp_4tap_horiz_pp_2x8_sse3;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_hpp = x265_interp_4tap_horiz_pp_4x2_sse3;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_2x8].filter_hpp = x265_interp_4tap_horiz_pp_2x8_sse3;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_2x16].filter_hpp = x265_interp_4tap_horiz_pp_2x16_sse3;
     }
diff -r df614d8d2b7b -r 722f24e9ddcb source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Fri Apr 17 09:15:04 2015 -0700
+++ b/source/common/x86/ipfilter8.asm	Fri Apr 17 09:21:15 2015 -0700
@@ -415,6 +415,66 @@
 
 RET
 
+%macro FILTER_H4_w4_2_sse2 0
+    pxor        m5, m5
+    movd        m0, [srcq - 1]
+    movd        m6, [srcq]
+    punpckldq   m0, m6
+    punpcklbw   m0, m5
+    movd        m1, [srcq + 1]
+    movd        m6, [srcq + 2]
+    punpckldq   m1, m6
+    punpcklbw   m1, m5
+    movd        m2, [srcq + srcstrideq - 1]
+    movd        m6, [srcq + srcstrideq]
+    punpckldq   m2, m6
+    punpcklbw   m2, m5
+    movd        m3, [srcq + srcstrideq + 1]
+    movd        m6, [srcq + srcstrideq + 2]
+    punpckldq   m3, m6
+    punpcklbw   m3, m5
+    pmaddwd     m0, m4
+    pmaddwd     m1, m4
+    pmaddwd     m2, m4
+    pmaddwd     m3, m4
+    packssdw    m0, m1
+    packssdw    m2, m3
+    pshuflw     m1, m0, q2301
+    pshufhw     m1, m1, q2301
+    pshuflw     m3, m2, q2301
+    pshufhw     m3, m3, q2301
+    paddw       m0, m1
+    paddw       m2, m3
+    psrld       m0, 16
+    psrld       m2, 16
+    packssdw    m0, m2
+    paddw       m0, m7
+    psraw       m0, 6
+    packuswb    m0, m2
+    movd        [dstq], m0
+    psrldq      m0, 4
+    movd        [dstq + dststrideq], m0
+%endmacro
+
+;-----------------------------------------------------------------------------
+; void interp_4tap_horiz_pp_4x2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+INIT_XMM sse3
+cglobal interp_4tap_horiz_pp_4x2, 4, 6, 8, src, srcstride, dst, dststride
+mov         r4d,        r4m
+mova        m7,         [pw_32]
+
+%ifdef PIC
+lea         r5,         [tabw_ChromaCoeff]
+movddup     m4,         [r5 + r4 * 8]
+%else
+movddup     m4,         [tabw_ChromaCoeff + r4 * 8]
+%endif
+
+FILTER_H4_w4_2_sse2
+
+RET
+
 %macro FILTER_H4_w2_2 3
     movh        %2, [srcq - 1]
     pshufb      %2, %2, Tm0
diff -r df614d8d2b7b -r 722f24e9ddcb source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Fri Apr 17 09:15:04 2015 -0700
+++ b/source/common/x86/ipfilter8.h	Fri Apr 17 09:21:15 2015 -0700
@@ -766,6 +766,7 @@
 void x265_interp_4tap_horiz_pp_2x4_sse3(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
 void x265_interp_4tap_horiz_pp_2x8_sse3(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
 void x265_interp_4tap_horiz_pp_2x16_sse3(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
+void x265_interp_4tap_horiz_pp_4x2_sse3(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
 #undef LUMA_FILTERS
 #undef LUMA_SP_FILTERS
 #undef LUMA_SS_FILTERS


More information about the x265-devel mailing list