[x265] [PATCH 4 of 6] asm: filter_vsp[32x8, 16x8], filter_vss[32x8, 16x8] in avx2
Divya Manivannan
divya at multicorewareinc.com
Wed Mar 18 06:43:16 CET 2015
# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1426656360 -19800
# Wed Mar 18 10:56:00 2015 +0530
# Node ID 23de48d12a38bcddc64c3714c1458ae51d4e4c76
# Parent ddfb88a81ab340be6e6bd41e1ccba6bdac7fa6fd
asm: filter_vsp[32x8, 16x8], filter_vss[32x8, 16x8] in avx2
filter_vsp[32x8, 16x8]: 3020c->2032c, 1722c->1049c
filter_vss[32x8, 16x8]: 2428c->2128c, 1400c->1071c
diff -r ddfb88a81ab3 -r 23de48d12a38 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Wed Mar 18 10:50:13 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Wed Mar 18 10:56:00 2015 +0530
@@ -1694,9 +1694,11 @@
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x4].filter_vsp = x265_interp_4tap_vert_sp_8x4_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_12x16].filter_vsp = x265_interp_4tap_vert_sp_12x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x4].filter_vsp = x265_interp_4tap_vert_sp_16x4_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x8].filter_vsp = x265_interp_4tap_vert_sp_16x8_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x12].filter_vsp = x265_interp_4tap_vert_sp_16x12_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x32].filter_vsp = x265_interp_4tap_vert_sp_16x32_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_24x32].filter_vsp = x265_interp_4tap_vert_sp_24x32_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_32x8].filter_vsp = x265_interp_4tap_vert_sp_32x8_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_32x16].filter_vsp = x265_interp_4tap_vert_sp_32x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].filter_vss = x265_interp_4tap_vert_ss_4x4_avx2;
@@ -1710,9 +1712,11 @@
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x4].filter_vss = x265_interp_4tap_vert_ss_8x4_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_12x16].filter_vss = x265_interp_4tap_vert_ss_12x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x4].filter_vss = x265_interp_4tap_vert_ss_16x4_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x8].filter_vss = x265_interp_4tap_vert_ss_16x8_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x12].filter_vss = x265_interp_4tap_vert_ss_16x12_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x32].filter_vss = x265_interp_4tap_vert_ss_16x32_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_24x32].filter_vss = x265_interp_4tap_vert_ss_24x32_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_32x8].filter_vss = x265_interp_4tap_vert_ss_32x8_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_32x16].filter_vss = x265_interp_4tap_vert_ss_32x16_avx2;
}
#endif
diff -r ddfb88a81ab3 -r 23de48d12a38 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Wed Mar 18 10:50:13 2015 +0530
+++ b/source/common/x86/ipfilter8.asm Wed Mar 18 10:56:00 2015 +0530
@@ -14536,6 +14536,199 @@
FILTER_VER_CHROMA_S_AVX2_16x4 sp
FILTER_VER_CHROMA_S_AVX2_16x4 ss
+%macro PROCESS_CHROMA_S_AVX2_W8_8R 1
+ 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 m4, m2, [r5 + 1 * mmsize]
+ paddd m0, m4
+ pmaddwd m2, [r5]
+ lea r7, [r0 + r1 * 4]
+ movu xm4, [r7] ; m4 = row 4
+ punpckhwd xm5, xm3, xm4
+ punpcklwd xm3, xm4
+ vinserti128 m3, m3, xm5, 1
+ pmaddwd m5, m3, [r5 + 1 * mmsize]
+ paddd m1, m5
+ pmaddwd m3, [r5]
+%ifidn %1,sp
+ paddd m0, m7
+ paddd m1, m7
+ psrad m0, 12
+ psrad m1, 12
+%else
+ psrad m0, 6
+ psrad m1, 6
+%endif
+ packssdw m0, m1
+
+ movu xm5, [r7 + r1] ; m5 = row 5
+ punpckhwd xm6, xm4, xm5
+ punpcklwd xm4, xm5
+ vinserti128 m4, m4, xm6, 1
+ pmaddwd m6, m4, [r5 + 1 * mmsize]
+ paddd m2, m6
+ pmaddwd m4, [r5]
+ movu xm6, [r7 + r1 * 2] ; m6 = row 6
+ punpckhwd xm1, xm5, xm6
+ punpcklwd xm5, xm6
+ vinserti128 m5, m5, xm1, 1
+ pmaddwd m1, m5, [r5 + 1 * mmsize]
+ pmaddwd m5, [r5]
+ paddd m3, m1
+%ifidn %1,sp
+ paddd m2, m7
+ paddd m3, m7
+ psrad m2, 12
+ psrad m3, 12
+%else
+ psrad m2, 6
+ psrad m3, 6
+%endif
+ packssdw m2, m3
+%ifidn %1,sp
+ packuswb m0, m2
+ mova m3, [interp8_hps_shuf]
+ vpermd m0, m3, m0
+ vextracti128 xm2, m0, 1
+ movq [r2], xm0
+ movhps [r2 + r3], xm0
+ movq [r2 + r3 * 2], xm2
+ movhps [r2 + r6], xm2
+%else
+ vpermq m0, m0, 11011000b
+ vpermq m2, m2, 11011000b
+ movu [r2], xm0
+ vextracti128 xm0, m0, 1
+ vextracti128 xm3, m2, 1
+ movu [r2 + r3], xm0
+ movu [r2 + r3 * 2], xm2
+ movu [r2 + r6], xm3
+%endif
+ lea r8, [r2 + r3 * 4]
+
+ movu xm1, [r7 + r4] ; m1 = row 7
+ punpckhwd xm0, xm6, xm1
+ punpcklwd xm6, xm1
+ vinserti128 m6, m6, xm0, 1
+ pmaddwd m0, m6, [r5 + 1 * mmsize]
+ pmaddwd m6, [r5]
+ paddd m4, m0
+ lea r7, [r7 + r1 * 4]
+ movu xm0, [r7] ; m0 = row 8
+ punpckhwd xm2, xm1, xm0
+ punpcklwd xm1, xm0
+ vinserti128 m1, m1, xm2, 1
+ pmaddwd m2, m1, [r5 + 1 * mmsize]
+ pmaddwd m1, [r5]
+ paddd m5, m2
+%ifidn %1,sp
+ paddd m4, m7
+ paddd m5, m7
+ psrad m4, 12
+ psrad m5, 12
+%else
+ psrad m4, 6
+ psrad m5, 6
+%endif
+ packssdw m4, m5
+
+ movu xm2, [r7 + r1] ; m2 = row 9
+ punpckhwd xm5, xm0, xm2
+ punpcklwd xm0, xm2
+ vinserti128 m0, m0, xm5, 1
+ pmaddwd m0, [r5 + 1 * mmsize]
+ paddd m6, m0
+ movu xm5, [r7 + r1 * 2] ; m5 = row 10
+ punpckhwd xm0, xm2, xm5
+ punpcklwd xm2, xm5
+ vinserti128 m2, m2, xm0, 1
+ pmaddwd m2, [r5 + 1 * mmsize]
+ paddd m1, m2
+
+%ifidn %1,sp
+ paddd m6, m7
+ paddd m1, m7
+ psrad m6, 12
+ psrad m1, 12
+%else
+ psrad m6, 6
+ psrad m1, 6
+%endif
+ packssdw m6, m1
+%ifidn %1,sp
+ packuswb m4, m6
+ vpermd m4, m3, m4
+ vextracti128 xm6, m4, 1
+ movq [r8], xm4
+ movhps [r8 + r3], xm4
+ movq [r8 + r3 * 2], xm6
+ movhps [r8 + r6], xm6
+%else
+ vpermq m4, m4, 11011000b
+ vpermq m6, m6, 11011000b
+ vextracti128 xm7, m4, 1
+ vextracti128 xm1, m6, 1
+ movu [r8], xm4
+ movu [r8 + r3], xm7
+ movu [r8 + r3 * 2], xm6
+ movu [r8 + r6], xm1
+%endif
+%endmacro
+
+%macro FILTER_VER_CHROMA_S_AVX2_Nx8 2
+INIT_YMM avx2
+%if ARCH_X86_64 == 1
+cglobal interp_4tap_vert_%1_%2x8, 4, 9, 8
+ mov r4d, r4m
+ shl r4d, 6
+ add r1d, r1d
+
+%ifdef PIC
+ lea r5, [pw_ChromaCoeffV]
+ add r5, r4
+%else
+ lea r5, [pw_ChromaCoeffV + r4]
+%endif
+
+ lea r4, [r1 * 3]
+ sub r0, r1
+%ifidn %1,sp
+ mova m7, [pd_526336]
+%else
+ add r3d, r3d
+%endif
+ lea r6, [r3 * 3]
+%rep %2 / 8
+ PROCESS_CHROMA_S_AVX2_W8_8R %1
+%ifidn %1,sp
+ add r2, 8
+%else
+ add r2, 16
+%endif
+ add r0, 16
+%endrep
+ RET
+%endif
+%endmacro
+
+FILTER_VER_CHROMA_S_AVX2_Nx8 sp, 32
+FILTER_VER_CHROMA_S_AVX2_Nx8 sp, 16
+FILTER_VER_CHROMA_S_AVX2_Nx8 ss, 32
+FILTER_VER_CHROMA_S_AVX2_Nx8 ss, 16
+
;---------------------------------------------------------------------------------------------------------------------
; void interp_4tap_vertical_ss_%1x%2(int16_t *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx)
;---------------------------------------------------------------------------------------------------------------------
More information about the x265-devel
mailing list