[x265] [PATCH] asm: chroma_hpp[4x8, 4x16] for i420 avx2 - improved 346c->322c, 610c->586c
aasaipriya at multicorewareinc.com
aasaipriya at multicorewareinc.com
Mon Mar 16 06:17:19 CET 2015
# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1426483029 -19800
# Mon Mar 16 10:47:09 2015 +0530
# Node ID 19f6ba4dd66147698aa96deb2f364f30a7d63a7e
# Parent 97a441776465d47d57e809dd18889c8714deeef6
asm: chroma_hpp[4x8, 4x16] for i420 avx2 - improved 346c->322c, 610c->586c
diff -r 97a441776465 -r 19f6ba4dd661 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Mon Mar 16 10:43:23 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Mon Mar 16 10:47:09 2015 +0530
@@ -1582,6 +1582,8 @@
p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].filter_hpp = x265_interp_4tap_horiz_pp_16x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_hpp = x265_interp_4tap_horiz_pp_4x2_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x8].filter_hpp = x265_interp_4tap_horiz_pp_4x8_avx2;
+ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x16].filter_hpp = x265_interp_4tap_horiz_pp_4x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_32x16].filter_hpp = x265_interp_4tap_horiz_pp_32x16_avx2;
p.chroma[X265_CSP_I420].pu[CHROMA_420_32x24].filter_hpp = x265_interp_4tap_horiz_pp_32x24_avx2;
diff -r 97a441776465 -r 19f6ba4dd661 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Mon Mar 16 10:43:23 2015 +0530
+++ b/source/common/x86/ipfilter8.asm Mon Mar 16 10:47:09 2015 +0530
@@ -16866,3 +16866,66 @@
IPFILTER_CHROMA_PP_8xN_AVX2 8 , 16
IPFILTER_CHROMA_PP_8xN_AVX2 8 , 32
IPFILTER_CHROMA_PP_8xN_AVX2 8 , 4
+
+;-------------------------------------------------------------------------------------------------------------
+; void interp_4tap_horiz_pp_4xN(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx
+;-------------------------------------------------------------------------------------------------------------
+%macro IPFILTER_CHROMA_PP_4xN_AVX2 2
+INIT_YMM avx2
+cglobal interp_4tap_horiz_pp_%1x%2, 4,6,6
+ mov r4d, r4m
+
+%ifdef PIC
+ lea r5, [tab_ChromaCoeff]
+ vpbroadcastd m0, [r5 + r4 * 4]
+%else
+ vpbroadcastd m0, [tab_ChromaCoeff + r4 * 4]
+%endif
+
+ vpbroadcastd m2, [pw_1]
+ vbroadcasti128 m1, [tab_Tm]
+ mov r4d, %2
+ ; register map
+ ; m0 - interpolate coeff
+ ; m1 - shuffle order table
+ ; m2 - constant word 1
+
+ dec r0
+
+.loop
+ sub r4d, 4
+ ; Row 0-1
+ movu xm3, [r0] ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+ vinserti128 m3, m3, [r0 + r1], 1
+ pshufb m3, m1
+ pmaddubsw m3, m0
+ pmaddwd m3, m2
+
+ ; Row 2-3
+ lea r0, [r0 + r1 * 2]
+ movu xm4, [r0] ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+ vinserti128 m4, m4, [r0 + r1], 1
+ pshufb m4, m1
+ pmaddubsw m4, m0
+ pmaddwd m4, m2
+
+ packssdw m3, m4
+ pmulhrsw m3, [pw_512]
+ vextracti128 xm4, m3, 1
+ packuswb xm3, xm4
+
+ movd [r2], xm3
+ pextrd [r2+r3], xm3, 2
+ lea r2, [r2 + r3 * 2]
+ pextrd [r2], xm3, 1
+ pextrd [r2+r3], xm3, 3
+
+ lea r0, [r0 + r1 * 2]
+ lea r2, [r2 + r3 * 2]
+ test r4d, r4d
+ jnz .loop
+ RET
+%endmacro
+
+IPFILTER_CHROMA_PP_4xN_AVX2 4 , 8
+IPFILTER_CHROMA_PP_4xN_AVX2 4 , 16
More information about the x265-devel
mailing list