[x265] [PATCH 01 of 12] asm: interp_4tap_vert_ps_2xN sse2
dtyx265 at gmail.com
dtyx265 at gmail.com
Mon May 18 04:48:52 CEST 2015
# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1431911009 25200
# Node ID 465fb4340a241e501b53a6241f5ae81c29ba073a
# Parent 8592bf81d0848279fa79cd1487406cb516dffe99
asm: interp_4tap_vert_ps_2xN sse2
Updated vert_pp_2xN macro to also create ps. This replaces c code for ps with minimal impact on pp.
64-bit
/test/TestBench --testbench interp | grep vp | grep " 2x"
chroma_vpp[ 2x4] 1.80x 644.93 1159.97
chroma_vps[ 2x4] 1.42x 630.00 894.95
chroma_vpp[ 2x8] 1.72x 1204.99 2067.47
chroma_vps[ 2x8] 1.49x 1152.50 1712.50
chroma_vpp[ 2x16] 1.94x 2314.96 4482.00
chroma_vps[ 2x16] 1.91x 2222.45 4252.86
32-bit
./test/TestBench --testbench interp | grep vp | grep " 2x"
chroma_vpp[ 2x4] 1.74x 849.94 1479.88
chroma_vps[ 2x4] 1.64x 762.49 1247.46
chroma_vpp[ 2x8] 1.89x 1482.47 2807.46
chroma_vps[ 2x8] 1.93x 1392.49 2682.46
chroma_vpp[ 2x16] 2.26x 2769.98 6249.80
chroma_vps[ 2x16] 1.91x 2632.49 5028.81
diff -r 8592bf81d084 -r 465fb4340a24 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Thu May 14 17:12:14 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Sun May 17 18:03:29 2015 -0700
@@ -1448,6 +1448,9 @@
p.chroma[X265_CSP_I444].pu[LUMA_4x4].filter_vpp = x265_interp_4tap_vert_pp_4x4_sse2;
p.chroma[X265_CSP_I444].pu[LUMA_4x8].filter_vpp = x265_interp_4tap_vert_pp_4x8_sse2;
p.chroma[X265_CSP_I444].pu[LUMA_4x16].filter_vpp = x265_interp_4tap_vert_pp_4x16_sse2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].filter_vps = x265_interp_4tap_vert_ps_2x4_sse2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_2x8].filter_vps = x265_interp_4tap_vert_ps_2x8_sse2;
+ p.chroma[X265_CSP_I422].pu[CHROMA_422_2x16].filter_vps = x265_interp_4tap_vert_ps_2x16_sse2;
#if X86_64
p.chroma[X265_CSP_I420].pu[CHROMA_420_6x8].filter_vpp = x265_interp_4tap_vert_pp_6x8_sse2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].filter_vpp = x265_interp_4tap_vert_pp_8x2_sse2;
diff -r 8592bf81d084 -r 465fb4340a24 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Thu May 14 17:12:14 2015 +0530
+++ b/source/common/x86/ipfilter8.asm Sun May 17 18:03:29 2015 -0700
@@ -878,19 +878,26 @@
%endmacro
;-----------------------------------------------------------------------------
-; void interp_4tap_vert_pp_2xn(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
-;-----------------------------------------------------------------------------
-%macro FILTER_V4_W2_H4_sse2 1
+; void interp_4tap_vert_%1_2x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+%macro FILTER_V4_W2_H4_sse2 2
INIT_XMM sse2
%if ARCH_X86_64
-cglobal interp_4tap_vert_pp_2x%1, 4, 6, 9
+cglobal interp_4tap_vert_%1_2x%2, 4, 6, 9
pxor m8, m8
%else
-cglobal interp_4tap_vert_pp_2x%1, 4, 6, 8
+cglobal interp_4tap_vert_%1_2x%2, 4, 6, 8
%endif
mov r4d, r4m
sub r0, r1
+%ifidn %1,pp
+ mova m1, [pw_32]
+%elifidn %1,ps
+ mova m1, [pw_2000]
+ add r3d, r3d
+%endif
+
%ifdef PIC
lea r5, [tabw_ChromaCoeff]
movh m0, [r5 + r4 * 8]
@@ -899,11 +906,10 @@
%endif
punpcklqdq m0, m0
- mova m1, [pw_32]
lea r5, [3 * r1]
%assign x 1
-%rep %1/4
+%rep %2/4
movd m2, [r0]
movd m3, [r0 + r1]
movd m4, [r0 + 2 * r1]
@@ -930,7 +936,6 @@
pshuflw m3, m2, q2301
pshufhw m3, m3, q2301
paddw m2, m3
- psrld m2, 16
movd m7, [r0 + r1]
@@ -954,8 +959,10 @@
pshuflw m5, m4, q2301
pshufhw m5, m5, q2301
paddw m4, m5
+
+%ifidn %1,pp
+ psrld m2, 16
psrld m4, 16
-
packssdw m2, m4
paddw m2, m1
psraw m2, 6
@@ -983,8 +990,24 @@
shr r4, 16
mov [r2 + r3], r4w
%endif
-
-%if x < %1/4
+%elifidn %1,ps
+ psrldq m2, 2
+ psrldq m4, 2
+ pshufd m2, m2, q3120
+ pshufd m4, m4, q3120
+ psubw m4, m1
+ psubw m2, m1
+
+ movd [r2], m2
+ psrldq m2, 4
+ movd [r2 + r3], m2
+ lea r2, [r2 + 2 * r3]
+ movd [r2], m4
+ psrldq m4, 4
+ movd [r2 + r3], m4
+%endif
+
+%if x < %2/4
lea r2, [r2 + 2 * r3]
%endif
%assign x x+1
@@ -993,9 +1016,13 @@
%endmacro
- FILTER_V4_W2_H4_sse2 4
- FILTER_V4_W2_H4_sse2 8
- FILTER_V4_W2_H4_sse2 16
+ FILTER_V4_W2_H4_sse2 pp, 4
+ FILTER_V4_W2_H4_sse2 pp, 8
+ FILTER_V4_W2_H4_sse2 pp, 16
+
+ FILTER_V4_W2_H4_sse2 ps, 4
+ FILTER_V4_W2_H4_sse2 ps, 8
+ FILTER_V4_W2_H4_sse2 ps, 16
;-----------------------------------------------------------------------------
; void interp_4tap_vert_pp_4x2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
diff -r 8592bf81d084 -r 465fb4340a24 source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h Thu May 14 17:12:14 2015 +0530
+++ b/source/common/x86/ipfilter8.h Sun May 17 18:03:29 2015 -0700
@@ -913,6 +913,9 @@
void x265_interp_4tap_vert_pp_4x8_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
void x265_interp_4tap_vert_pp_4x16_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
void x265_interp_4tap_vert_pp_4x32_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
+void x265_interp_4tap_vert_ps_2x4_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
+void x265_interp_4tap_vert_ps_2x8_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
+void x265_interp_4tap_vert_ps_2x16_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);
#ifdef X86_64
void x265_interp_4tap_vert_pp_6x8_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
void x265_interp_4tap_vert_pp_6x16_sse2(const pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
More information about the x265-devel
mailing list