[x265] [PATCH 09 of 12] asm: interp_4tap_vert_ps_24xN sse2
dtyx265 at gmail.com
dtyx265 at gmail.com
Mon May 18 04:49:00 CEST 2015
# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1431915216 25200
# Node ID 6b04fb941142b809bbf7326a115a859ce3a08d84
# Parent f8333270d592d9ada2318fb3286ca884b13d3249
asm: interp_4tap_vert_ps_24xN sse2
Converted vert_pp_24xN macro to also create ps primitives. This replaces c code for ps with minimal impact on pp.
64-bit
./test/TestBench --testbench interp | grep vp | grep "24x"
chroma_vpp[24x32] 7.42x 24657.66 182977.44
chroma_vps[24x32] 6.76x 22923.31 154889.81
chroma_vpp[24x64] 7.43x 49350.79 366451.75
chroma_vps[24x64] 6.87x 44989.23 309009.28
chroma_vpp[24x32] 7.42x 24602.54 182471.03
chroma_vps[24x32] 6.93x 22564.47 156441.62
diff -r f8333270d592 -r 6b04fb941142 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Sun May 17 19:06:51 2015 -0700
+++ b/source/common/x86/asm-primitives.cpp Sun May 17 19:13:36 2015 -0700
@@ -1533,6 +1533,7 @@
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x12].filter_vps = x265_interp_4tap_vert_ps_16x12_sse2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].filter_vps = x265_interp_4tap_vert_ps_16x16_sse2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x32].filter_vps = x265_interp_4tap_vert_ps_16x32_sse2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_24x32].filter_vps = x265_interp_4tap_vert_ps_24x32_sse2;
p.chroma[X265_CSP_I422].pu[CHROMA_422_6x16].filter_vps = x265_interp_4tap_vert_ps_6x16_sse2;
p.chroma[X265_CSP_I422].pu[CHROMA_422_8x8].filter_vps = x265_interp_4tap_vert_ps_8x8_sse2;
p.chroma[X265_CSP_I422].pu[CHROMA_422_8x12].filter_vps = x265_interp_4tap_vert_ps_8x12_sse2;
@@ -1545,6 +1546,7 @@
p.chroma[X265_CSP_I422].pu[CHROMA_422_16x24].filter_vps = x265_interp_4tap_vert_ps_16x24_sse2;
p.chroma[X265_CSP_I422].pu[CHROMA_422_16x32].filter_vps = x265_interp_4tap_vert_ps_16x32_sse2;
p.chroma[X265_CSP_I422].pu[CHROMA_422_16x64].filter_vps = x265_interp_4tap_vert_ps_16x64_sse2;
+ p.chroma[X265_CSP_I422].pu[CHROMA_422_24x64].filter_vps = x265_interp_4tap_vert_ps_24x64_sse2;
p.chroma[X265_CSP_I444].pu[LUMA_8x4].filter_vps = x265_interp_4tap_vert_ps_8x4_sse2;
p.chroma[X265_CSP_I444].pu[LUMA_8x8].filter_vps = x265_interp_4tap_vert_ps_8x8_sse2;
p.chroma[X265_CSP_I444].pu[LUMA_8x16].filter_vps = x265_interp_4tap_vert_ps_8x16_sse2;
@@ -1556,6 +1558,7 @@
p.chroma[X265_CSP_I444].pu[LUMA_16x16].filter_vps = x265_interp_4tap_vert_ps_16x16_sse2;
p.chroma[X265_CSP_I444].pu[LUMA_16x32].filter_vps = x265_interp_4tap_vert_ps_16x32_sse2;
p.chroma[X265_CSP_I444].pu[LUMA_16x64].filter_vps = x265_interp_4tap_vert_ps_16x64_sse2;
+ p.chroma[X265_CSP_I444].pu[LUMA_24x32].filter_vps = x265_interp_4tap_vert_ps_24x32_sse2;
#endif
ALL_LUMA_PU(luma_hpp, interp_8tap_horiz_pp, sse2);
diff -r f8333270d592 -r 6b04fb941142 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Sun May 17 19:06:51 2015 -0700
+++ b/source/common/x86/ipfilter8.asm Sun May 17 19:13:36 2015 -0700
@@ -2230,17 +2230,22 @@
%endif
;-----------------------------------------------------------------------------
-;void interp_4tap_vert_pp_24xN(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
-;-----------------------------------------------------------------------------
-%macro FILTER_V4_W24_sse2 1
+;void interp_4tap_vert_%1_24%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+%macro FILTER_V4_W24_sse2 2
INIT_XMM sse2
-cglobal interp_4tap_vert_pp_24x%1, 4, 6, 11
-
+cglobal interp_4tap_vert_%1_24x%2, 4, 6, 11
mov r4d, r4m
sub r0, r1
shl r4d, 5
pxor m9, m9
+
+%ifidn %1,pp
mova m6, [pw_32]
+%elifidn %1,ps
+ mova m6, [pw_2000]
+ add r3d, r3d
+%endif
%ifdef PIC
lea r5, [tab_ChromaCoeffV]
@@ -2252,7 +2257,7 @@
%endif
%assign x 1
-%rep %1/2
+%rep %2/2
movu m2, [r0]
movu m3, [r0 + r1]
@@ -2275,7 +2280,7 @@
lea r5, [r0 + 2 * r1]
movu m5, [r5]
- movu m10, [r5 + r1]
+ movu m10, [r5 + r1]
punpcklbw m7, m5, m10
movhlps m8, m7
@@ -2297,6 +2302,7 @@
paddw m2, m7
+%ifidn %1,pp
paddw m4, m6
psraw m4, 6
paddw m2, m6
@@ -2304,6 +2310,12 @@
packuswb m4, m2
movu [r2], m4
+%elifidn %1,ps
+ psubw m4, m6
+ psubw m2, m6
+ movu [r2], m4
+ movu [r2 + 16], m2
+%endif
punpcklbw m4, m3, m5
punpckhbw m3, m5
@@ -2325,7 +2337,7 @@
movu m2, [r5 + 2 * r1]
punpcklbw m5, m10, m2
- punpckhbw m10, m2
+ punpckhbw m10, m2
movhlps m8, m5
punpcklbw m5, m9
@@ -2344,13 +2356,20 @@
paddw m4, m5
paddw m3, m10
+%ifidn %1,pp
paddw m4, m6
psraw m4, 6
paddw m3, m6
psraw m3, 6
packuswb m4, m3
- movu [r2 + r3], m4
+ movu [r2 + r3], m4
+%elifidn %1,ps
+ psubw m4, m6
+ psubw m3, m6
+ movu [r2 + r3], m4
+ movu [r2 + r3 + 16], m3
+%endif
movq m2, [r0 + 16]
movq m3, [r0 + r1 + 16]
@@ -2376,8 +2395,13 @@
paddw m2, m4
+%ifidn %1,pp
paddw m2, m6
psraw m2, 6
+%elifidn %1,ps
+ psubw m2, m6
+ movu [r2 + 32], m2
+%endif
movq m3, [r0 + r1 + 16]
movq m4, [r5 + 16]
@@ -2403,14 +2427,19 @@
paddw m3, m5
+%ifidn %1,pp
paddw m3, m6
psraw m3, 6
packuswb m2, m3
movh [r2 + 16], m2
movhps [r2 + r3 + 16], m2
-
-%if x < %1/2
+%elifidn %1,ps
+ psubw m3, m6
+ movu [r2 + r3 + 32], m3
+%endif
+
+%if x < %2/2
mov r0, r5
lea r2, [r2 + 2 * r3]
%endif
@@ -2421,8 +2450,10 @@
%endmacro
%if ARCH_X86_64
- FILTER_V4_W24_sse2 32
- FILTER_V4_W24_sse2 64
+ FILTER_V4_W24_sse2 pp, 32
+ FILTER_V4_W24_sse2 pp, 64
+ FILTER_V4_W24_sse2 ps, 32
+ FILTER_V4_W24_sse2 ps, 64
%endif
;-----------------------------------------------------------------------------
diff -r f8333270d592 -r 6b04fb941142 source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h Sun May 17 19:06:51 2015 -0700
+++ b/source/common/x86/ipfilter8.h Sun May 17 19:13:36 2015 -0700
@@ -973,6 +973,8 @@
void x265_interp_4tap_vert_ps_16x24_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
void x265_interp_4tap_vert_ps_16x32_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
void x265_interp_4tap_vert_ps_16x64_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
+void x265_interp_4tap_vert_ps_24x32_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
+void x265_interp_4tap_vert_ps_24x64_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
#endif
#undef LUMA_FILTERS
#undef LUMA_SP_FILTERS
More information about the x265-devel
mailing list