[x265] [PATCH] asm-avx2: filter_vpp[16x4], filter_vps[16x4]: 302c->291c, 320c->235c
Divya Manivannan
divya at multicorewareinc.com
Thu Mar 5 09:09:23 CET 2015
# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1425542868 -19800
# Thu Mar 05 13:37:48 2015 +0530
# Node ID 18ad0c966f4ae87b8ff8cf1b486a94a94d2edb5a
# Parent 2ceafdd931d5aa10df9ef2150a12f123faa67ff5
asm-avx2: filter_vpp[16x4], filter_vps[16x4]: 302c->291c, 320c->235c
diff -r 2ceafdd931d5 -r 18ad0c966f4a source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Thu Mar 05 12:30:53 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Thu Mar 05 13:37:48 2015 +0530
@@ -1643,6 +1643,7 @@
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x6].filter_vpp = x265_interp_4tap_vert_pp_8x6_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_16x8].filter_vpp = x265_interp_4tap_vert_pp_16x8_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x4].filter_vpp = x265_interp_4tap_vert_pp_16x4_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].filter_vps = x265_interp_4tap_vert_ps_2x4_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_vps = x265_interp_4tap_vert_ps_4x2_avx2;
@@ -1653,6 +1654,7 @@
p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].filter_vps = x265_interp_4tap_vert_ps_8x8_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_16x8].filter_vps = x265_interp_4tap_vert_ps_16x8_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x4].filter_vps = x265_interp_4tap_vert_ps_16x4_avx2;
p.chroma[X265_CSP_I422].pu[CHROMA_422_4x4].filter_vpp = x265_interp_4tap_vert_pp_4x4_avx2;
}
diff -r 2ceafdd931d5 -r 18ad0c966f4a source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Thu Mar 05 12:30:53 2015 +0530
+++ b/source/common/x86/ipfilter8.asm Thu Mar 05 13:37:48 2015 +0530
@@ -5332,6 +5332,102 @@
FILTER_VER_CHROMA_AVX2_16x8 pp
FILTER_VER_CHROMA_AVX2_16x8 ps
+%macro FILTER_VER_CHROMA_AVX2_16x4 1
+INIT_YMM avx2
+cglobal interp_4tap_vert_%1_16x4, 4, 6, 7
+ mov r4d, r4m
+ shl r4d, 6
+
+%ifdef PIC
+ lea r5, [tab_ChromaCoeffVer_32]
+ add r5, r4
+%else
+ lea r5, [tab_ChromaCoeffVer_32 + r4]
+%endif
+
+ lea r4, [r1 * 3]
+ sub r0, r1
+%ifidn %1,pp
+ mova m6, [pw_512]
+%else
+ add r3d, r3d
+ mova m6, [pw_2000]
+%endif
+
+ movu xm0, [r0] ; m0 = row 0
+ movu xm1, [r0 + r1] ; m1 = row 1
+ punpckhbw xm2, xm0, xm1
+ punpcklbw xm0, xm1
+ vinserti128 m0, m0, xm2, 1
+ pmaddubsw m0, [r5]
+ movu xm2, [r0 + r1 * 2] ; m2 = row 2
+ punpckhbw xm3, xm1, xm2
+ punpcklbw xm1, xm2
+ vinserti128 m1, m1, xm3, 1
+ pmaddubsw m1, [r5]
+ movu xm3, [r0 + r4] ; m3 = row 3
+ punpckhbw xm4, xm2, xm3
+ punpcklbw xm2, xm3
+ vinserti128 m2, m2, xm4, 1
+ pmaddubsw m4, m2, [r5 + mmsize]
+ paddw m0, m4
+ pmaddubsw m2, [r5]
+ lea r0, [r0 + r1 * 4]
+ movu xm4, [r0] ; m4 = row 4
+ punpckhbw xm5, xm3, xm4
+ punpcklbw xm3, xm4
+ vinserti128 m3, m3, xm5, 1
+ pmaddubsw m5, m3, [r5 + mmsize]
+ paddw m1, m5
+ pmaddubsw m3, [r5]
+%ifidn %1,pp
+ pmulhrsw m0, m6 ; m0 = word: row 0
+ pmulhrsw m1, m6 ; m1 = word: row 1
+ packuswb m0, m1
+ vpermq m0, m0, 11011000b
+ vextracti128 xm1, m0, 1
+ movu [r2], xm0
+ movu [r2 + r3], xm1
+%else
+ psubw m0, m6 ; m0 = word: row 0
+ psubw m1, m6 ; m1 = word: row 1
+ movu [r2], m0
+ movu [r2 + r3], m1
+%endif
+ lea r2, [r2 + r3 * 2]
+
+ movu xm0, [r0 + r1] ; m0 = row 5
+ punpckhbw xm1, xm4, xm0
+ punpcklbw xm4, xm0
+ vinserti128 m4, m4, xm1, 1
+ pmaddubsw m4, [r5 + mmsize]
+ paddw m2, m4
+ movu xm1, [r0 + r1 * 2] ; m1 = row 6
+ punpckhbw xm5, xm0, xm1
+ punpcklbw xm0, xm1
+ vinserti128 m0, m0, xm5, 1
+ pmaddubsw m0, [r5 + mmsize]
+ paddw m3, m0
+%ifidn %1,pp
+ pmulhrsw m2, m6 ; m2 = word: row 2
+ pmulhrsw m3, m6 ; m3 = word: row 3
+ packuswb m2, m3
+ vpermq m2, m2, 11011000b
+ vextracti128 xm3, m2, 1
+ movu [r2], xm2
+ movu [r2 + r3], xm3
+%else
+ psubw m2, m6 ; m2 = word: row 2
+ psubw m3, m6 ; m3 = word: row 3
+ movu [r2], m2
+ movu [r2 + r3], m3
+%endif
+ RET
+%endmacro
+
+FILTER_VER_CHROMA_AVX2_16x4 pp
+FILTER_VER_CHROMA_AVX2_16x4 ps
+
;-----------------------------------------------------------------------------
;void interp_4tap_vert_pp_24x32(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
;-----------------------------------------------------------------------------
More information about the x265-devel
mailing list