[x265] [PATCH] asm: avx2 code for chroma_vpp/vsp/vps/vss[4x4][i420] 16bpp
aasaipriya at multicorewareinc.com
aasaipriya at multicorewareinc.com
Wed Jun 10 08:24:35 CEST 2015
# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1433917467 -19800
# Wed Jun 10 11:54:27 2015 +0530
# Node ID 72a008d47d3f959936ab0254898e725a4c169c51
# Parent 7c2b17f4efb260d88f6757d594a1207874ab45a2
asm: avx2 code for chroma_vpp/vsp/vps/vss[4x4][i420] 16bpp
avx2:
chroma_vpp[ 4x4] 6.47x 210.02 1358.84
chroma_vps[ 4x4] 5.70x 185.85 1059.04
chroma_vsp[ 4x4] 6.19x 220.03 1362.61
chroma_vss[ 4x4] 5.76x 180.04 1036.59
sse:
chroma_vpp[ 4x4] 3.11x 436.95 1361.08
chroma_vps[ 4x4] 2.83x 408.31 1157.27
chroma_vsp[ 4x4] 3.14x 436.84 1370.84
chroma_vss[ 4x4] 2.73x 381.63 1041.73
diff -r 7c2b17f4efb2 -r 72a008d47d3f source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Wed Jun 10 11:35:42 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Wed Jun 10 11:54:27 2015 +0530
@@ -1703,6 +1703,10 @@
p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_vps = x265_interp_4tap_vert_ps_4x2_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_vsp = x265_interp_4tap_vert_sp_4x2_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_vss = x265_interp_4tap_vert_ss_4x2_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].filter_vpp = x265_interp_4tap_vert_pp_4x4_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].filter_vps = x265_interp_4tap_vert_ps_4x4_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].filter_vsp = x265_interp_4tap_vert_sp_4x4_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].filter_vss = x265_interp_4tap_vert_ss_4x4_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].filter_vpp = x265_interp_4tap_vert_pp_8x2_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].filter_vps = x265_interp_4tap_vert_ps_8x2_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].filter_vsp = x265_interp_4tap_vert_sp_8x2_avx2;
diff -r 7c2b17f4efb2 -r 72a008d47d3f source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm Wed Jun 10 11:35:42 2015 +0530
+++ b/source/common/x86/ipfilter16.asm Wed Jun 10 11:54:27 2015 +0530
@@ -11134,3 +11134,82 @@
FILTER_VER_CHROMA_AVX2_4x2 ps, 0, 2
FILTER_VER_CHROMA_AVX2_4x2 sp, doClip, 10
FILTER_VER_CHROMA_AVX2_4x2 ss, 0, 6
+
+%macro FILTER_VER_CHROMA_AVX2_4x4 3
+INIT_YMM avx2
+cglobal interp_4tap_vert_%1_4x4, 4, 6, 7
+ mov r4d, r4m
+ add r1d, r1d
+ add r3d, r3d
+ shl r4d, 6
+
+%ifdef PIC
+ lea r5, [tab_ChromaCoeffVer]
+ add r5, r4
+%else
+ lea r5, [tab_ChromaCoeffVer + r4]
+%endif
+
+ lea r4, [r1 * 3]
+ sub r0, r1
+
+%ifidn %1,pp
+ vbroadcasti128 m6, [pd_32]
+%elifidn %1, sp
+ mova m6, [pd_524800]
+%else
+ vbroadcasti128 m6, [pd_n32768]
+%endif
+ movq xm0, [r0] ; row 0
+ movq xm1, [r0 + r1] ; row 1
+ punpcklwd xm0, xm1
+
+ movq xm2, [r0 + r1 * 2] ; row 2
+ punpcklwd xm1, xm2
+ vinserti128 m0, m0, xm1, 1 ; m0 = [2 1 1 0]
+ pmaddwd m0, [r5]
+
+ movq xm3, [r0 + r4] ; row 3
+ punpcklwd xm2, xm3
+ lea r0, [r0 + 4 * r1]
+ movq xm4, [r0] ; row 4
+ punpcklwd xm3, xm4
+ vinserti128 m2, m2, xm3, 1 ; m2 = [4 3 3 2]
+ pmaddwd m5, m2, [r5 + 1 * mmsize]
+ pmaddwd m2, [r5]
+ paddd m0, m5
+
+ movq xm3, [r0 + r1] ; row 5
+ punpcklwd xm4, xm3
+ movq xm1, [r0 + r1 * 2] ; row 6
+ punpcklwd xm3, xm1
+ vinserti128 m4, m4, xm3, 1 ; m4 = [6 5 5 4]
+ pmaddwd m4, [r5 + 1 * mmsize]
+ paddd m2, m4
+
+%ifnidn %1,ss
+ paddd m0, m6
+ paddd m2, m6
+%endif
+ psrad m0, %3
+ psrad m2, %3
+
+ packssdw m0, m2
+ pxor m1, m1
+%ifidn %2, doClip
+ CLIPW m0, m1, [pw_pixel_max]
+%endif
+
+ vextracti128 xm2, m0, 1
+ lea r4, [r3 * 3]
+ movq [r2], xm0
+ movq [r2 + r3], xm2
+ movhps [r2 + r3 * 2], xm0
+ movhps [r2 + r4], xm2
+ RET
+%endmacro
+
+FILTER_VER_CHROMA_AVX2_4x4 pp, doClip, 6
+FILTER_VER_CHROMA_AVX2_4x4 ps, 0, 2
+FILTER_VER_CHROMA_AVX2_4x4 sp, doClip, 10
+FILTER_VER_CHROMA_AVX2_4x4 ss, 0, 6
More information about the x265-devel
mailing list