[x265] [PATCH 2 of 3] asm: interp_4tap_vert_pp sse2

dtyx265 at gmail.com dtyx265 at gmail.com
Wed May 6 21:45:36 CEST 2015


# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1430940898 25200
# Node ID ae9d689acc97b9165acfee5c32b257cc3823492f
# Parent  4690c9aa24caa1adb665355803d4c308a124ec96
asm: interp_4tap_vert_pp sse2

This replaces c code for 4x2

64-bit

./test/TestBench --testbench interp | grep vpp | grep " 4x"
chroma_vpp[  4x2]	2.12x 	 527.49   	 1117.46

32-bit

/test/TestBench --testbench interp | grep vpp | grep " 4x"
chroma_vpp[  4x2]	2.27x 	 622.48   	 1414.94

diff -r 4690c9aa24ca -r ae9d689acc97 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed May 06 12:27:20 2015 -0700
+++ b/source/common/x86/asm-primitives.cpp	Wed May 06 12:34:58 2015 -0700
@@ -1358,6 +1358,7 @@
         p.pu[LUMA_8x8].luma_hvpp = x265_interp_8tap_hv_pp_8x8_sse3;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].filter_vpp = x265_interp_4tap_vert_pp_2x4_sse2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_2x8].filter_vpp = x265_interp_4tap_vert_pp_2x8_sse2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_vpp = x265_interp_4tap_vert_pp_4x2_sse2;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_2x8].filter_vpp = x265_interp_4tap_vert_pp_2x8_sse2;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_2x16].filter_vpp = x265_interp_4tap_vert_pp_2x16_sse2;
 
diff -r 4690c9aa24ca -r ae9d689acc97 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Wed May 06 12:27:20 2015 -0700
+++ b/source/common/x86/ipfilter8.asm	Wed May 06 12:34:58 2015 -0700
@@ -1176,6 +1176,74 @@
     FILTER_V4_W2_H4_sse2 16
 
 ;-----------------------------------------------------------------------------
+; void interp_4tap_vert_pp_4x2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+INIT_XMM sse2
+cglobal interp_4tap_vert_pp_4x2, 4, 6, 8
+
+    mov         r4d,       r4m
+    sub         r0,        r1
+    add         r4d,       r4d
+    pxor        m7,        m7
+
+%ifdef PIC
+    lea         r5,        [tabw_ChromaCoeffV]
+    mova        m0,        [r5 + r4 * 8]
+%else
+    mova        m0,        [tabw_ChromaCoeffV + r4 * 8]
+%endif
+
+    lea         r5,        [r0 + 2 * r1]
+
+    movd        m2,        [r0]
+    movd        m3,        [r0 + r1]
+    movd        m4,        [r5]
+    movd        m5,        [r5 + r1]
+
+    punpcklbw   m2,        m3
+    punpcklbw   m1,        m4,        m5
+    punpcklbw   m2,        m1
+
+    movhlps     m6,        m2
+    punpcklbw   m2,        m7
+    punpcklbw   m6,        m7
+    pmaddwd     m2,        m0
+    pmaddwd     m6,        m0
+    packssdw    m2,        m6
+
+    movd        m1,        [r0 + 4 * r1]
+
+    punpcklbw   m3,        m4
+    punpcklbw   m5,        m1
+    punpcklbw   m3,        m5
+
+    movhlps     m6,        m3
+    punpcklbw   m3,        m7
+    punpcklbw   m6,        m7
+    pmaddwd     m3,        m0
+    pmaddwd     m6,        m0
+    packssdw    m3,        m6
+
+    pshuflw     m4,        m2,        q2301
+    pshufhw     m4,        m4,        q2301
+    paddw       m2,        m4
+    pshuflw     m5,        m3,        q2301
+    pshufhw     m5,        m5,        q2301
+    paddw       m3,        m5
+    psrld       m2,        16
+    psrld       m3,        16
+    packssdw    m2,        m3
+
+    paddw       m2,        [pw_32]
+    psraw       m2,        6
+    packuswb    m2,        m2
+
+    movd        [r2],      m2
+    psrldq      m2,        4
+    movd        [r2 + r3], m2
+    RET
+
+;-----------------------------------------------------------------------------
 ; void interp_4tap_horiz_pp_2x4(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
 ;-----------------------------------------------------------------------------
 INIT_XMM sse4
diff -r 4690c9aa24ca -r ae9d689acc97 source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Wed May 06 12:27:20 2015 -0700
+++ b/source/common/x86/ipfilter8.h	Wed May 06 12:34:58 2015 -0700
@@ -908,6 +908,7 @@
 void x265_interp_4tap_vert_pp_2x4_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
 void x265_interp_4tap_vert_pp_2x8_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
 void x265_interp_4tap_vert_pp_2x16_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
+void x265_interp_4tap_vert_pp_4x2_sse2(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