[x265] [PATCH] asm: avx2 code for chroma_vpp/vps/vss/vsp[8x2][i420] 16bpp
aasaipriya at multicorewareinc.com
aasaipriya at multicorewareinc.com
Wed Jun 10 08:00:45 CEST 2015
# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1433915765 -19800
# Wed Jun 10 11:26:05 2015 +0530
# Node ID 436e5792cd7e5ff348f25878a8d927144a45c5e0
# Parent b252468dde7ffca57da27575388d95ce538945d2
asm: avx2 code for chroma_vpp/vps/vss/vsp[8x2][i420] 16bpp
chroma_vpp[8x2] 6.06x 215.01 1302.73
chroma_vps[8x2] 4.89x 205.02 1003.49
chroma_vsp[8x2] 6.07x 214.95 1303.73
chroma_vss[8x2] 4.66x 209.95 978.59
diff -r b252468dde7f -r 436e5792cd7e source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Tue Jun 09 10:16:44 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Wed Jun 10 11:26:05 2015 +0530
@@ -1699,6 +1699,10 @@
p.chroma[X265_CSP_I444].pu[LUMA_64x64].filter_hpp = x265_interp_4tap_horiz_pp_64x64_avx2;
p.chroma[X265_CSP_I444].pu[LUMA_48x64].filter_hpp = x265_interp_4tap_horiz_pp_48x64_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;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].filter_vss = x265_interp_4tap_vert_ss_8x2_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].filter_vpp = x265_interp_4tap_vert_pp_8x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].filter_vps = x265_interp_4tap_vert_ps_8x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].filter_vsp = x265_interp_4tap_vert_sp_8x16_avx2;
diff -r b252468dde7f -r 436e5792cd7e source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm Tue Jun 09 10:16:44 2015 +0530
+++ b/source/common/x86/ipfilter16.asm Wed Jun 10 11:26:05 2015 +0530
@@ -10985,3 +10985,85 @@
FILTER_VER_CHROMA_AVX2_8xN sp, 64
FILTER_VER_CHROMA_AVX2_8xN ss, 64
+%macro PROCESS_CHROMA_AVX2_8x2 3
+ movu xm0, [r0] ; m0 = row 0
+ movu xm1, [r0 + r1] ; m1 = row 1
+ punpckhwd xm2, xm0, xm1
+ punpcklwd xm0, xm1
+ vinserti128 m0, m0, xm2, 1
+ pmaddwd m0, [r5]
+
+ movu xm2, [r0 + r1 * 2] ; m2 = row 2
+ punpckhwd xm3, xm1, xm2
+ punpcklwd xm1, xm2
+ vinserti128 m1, m1, xm3, 1
+ pmaddwd m1, [r5]
+
+ movu xm3, [r0 + r4] ; m3 = row 3
+ punpckhwd xm4, xm2, xm3
+ punpcklwd xm2, xm3
+ vinserti128 m2, m2, xm4, 1
+ pmaddwd m2, m2, [r5 + 1 * mmsize]
+ paddd m0, m2
+
+ lea r0, [r0 + r1 * 4]
+ movu xm4, [r0] ; m4 = row 4
+ punpckhwd xm5, xm3, xm4
+ punpcklwd xm3, xm4
+ vinserti128 m3, m3, xm5, 1
+ pmaddwd m3, m3, [r5 + 1 * mmsize]
+ paddd m1, m3
+
+%ifnidn %1,ss
+ paddd m0, m7
+ paddd m1, m7
+%endif
+ psrad m0, %3
+ psrad m1, %3
+
+ packssdw m0, m1
+ vpermq m0, m0, q3120
+ pxor m4, m4
+
+%ifidn %2,doClip
+ CLIPW m0, m4, [pw_pixel_max]
+%endif
+ vextracti128 xm1, m0, 1
+%endmacro
+
+
+%macro FILTER_VER_CHROMA_AVX2_8x2 3
+INIT_YMM avx2
+cglobal interp_4tap_vert_%1_8x2, 4, 6, 8
+ mov r4d, r4m
+ shl r4d, 6
+ add r1d, r1d
+ add r3d, r3d
+
+%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 m7, [pd_32]
+%elifidn %1, sp
+ mova m7, [pd_524800]
+%else
+ vbroadcasti128 m7, [pd_n32768]
+%endif
+
+ PROCESS_CHROMA_AVX2_8x2 %1, %2, %3
+ movu [r2], xm0
+ movu [r2 + r3], xm1
+ RET
+%endmacro
+
+FILTER_VER_CHROMA_AVX2_8x2 pp, doClip, 6
+FILTER_VER_CHROMA_AVX2_8x2 ps, 0, 2
+FILTER_VER_CHROMA_AVX2_8x2 sp, doClip, 10
+FILTER_VER_CHROMA_AVX2_8x2 ss, 0, 6
More information about the x265-devel
mailing list