[x265] [PATCH] asm: luma_hps[16xN] for high bit depth
aasaipriya at multicorewareinc.com
aasaipriya at multicorewareinc.com
Fri May 22 07:45:07 CEST 2015
# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1432273498 -19800
# Fri May 22 11:14:58 2015 +0530
# Node ID 167072a6622cb25750fb7d7e6596184da8ec6a5a
# Parent 7a222ec904c5745c31e722e9d28054a985925360
asm: luma_hps[16xN] for high bit depth
luma_hps[16x4] - improved 6689c->3369c
luma_hps[16x8] - improved 6396c->4080c
luma_hps[16x12] - improved 9742c->4760c
luma_hps[16x16] - improved 12762c->5843c
luma_hps[16x32] - improved 15286c->9417c
luma_hps[16x64] - improved 27616c->16202c
diff -r 7a222ec904c5 -r 167072a6622c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Fri May 22 11:10:21 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Fri May 22 11:14:58 2015 +0530
@@ -1413,6 +1413,12 @@
p.pu[LUMA_8x4].luma_hps = x265_interp_8tap_horiz_ps_8x4_avx2;
p.pu[LUMA_8x16].luma_hps = x265_interp_8tap_horiz_ps_8x16_avx2;
p.pu[LUMA_8x32].luma_hps = x265_interp_8tap_horiz_ps_8x32_avx2;
+ p.pu[LUMA_16x4].luma_hps = x265_interp_8tap_horiz_ps_16x4_avx2;
+ p.pu[LUMA_16x8].luma_hps = x265_interp_8tap_horiz_ps_16x8_avx2;
+ p.pu[LUMA_16x12].luma_hps = x265_interp_8tap_horiz_ps_16x12_avx2;
+ p.pu[LUMA_16x16].luma_hps = x265_interp_8tap_horiz_ps_16x16_avx2;
+ p.pu[LUMA_16x32].luma_hps = x265_interp_8tap_horiz_ps_16x32_avx2;
+ p.pu[LUMA_16x64].luma_hps = x265_interp_8tap_horiz_ps_16x64_avx2;
p.pu[LUMA_32x8].luma_hps = x265_interp_8tap_horiz_ps_32x8_avx2;
p.pu[LUMA_32x16].luma_hps = x265_interp_8tap_horiz_ps_32x16_avx2;
p.pu[LUMA_32x32].luma_hps = x265_interp_8tap_horiz_ps_32x32_avx2;
diff -r 7a222ec904c5 -r 167072a6622c source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm Fri May 22 11:10:21 2015 +0530
+++ b/source/common/x86/ipfilter16.asm Fri May 22 11:14:58 2015 +0530
@@ -7897,3 +7897,98 @@
IPFILTER_LUMA_PS_32_64_AVX2 64, 64
IPFILTER_LUMA_PS_32_64_AVX2 48, 64
+
+%macro IPFILTER_LUMA_PS_16xN_AVX2 1
+INIT_YMM avx2
+%if ARCH_X86_64 == 1
+cglobal interp_8tap_horiz_ps_16x%1, 4, 6, 8
+
+ add r1d, r1d
+ add r3d, r3d
+ mov r4d, r4m
+ mov r5d, r5m
+ shl r4d, 4
+%ifdef PIC
+ lea r6, [tab_LumaCoeff]
+ vpbroadcastq m0, [r6 + r4]
+ vpbroadcastq m1, [r6 + r4 + 8]
+%else
+ vpbroadcastq m0, [tab_LumaCoeff + r4]
+ vpbroadcastq m1, [tab_LumaCoeff + r4 + 8]
+%endif
+ mova m3, [pb_shuf]
+ vbroadcasti128 m2, [pd_n32768]
+
+ ; register map
+ ; m0 , m1 interpolate coeff
+
+ sub r0, 6
+ test r5d, r5d
+ mov r4d, %1
+ jz .loop0
+ lea r6, [r1*3]
+ sub r0, r6
+ add r4d, 7
+
+.loop0:
+ vbroadcasti128 m4, [r0]
+ vbroadcasti128 m5, [r0 + 8]
+ pshufb m4, m3
+ pshufb m7, m5, m3
+ pmaddwd m4, m0
+ pmaddwd m7, m1
+ paddd m4, m7
+
+ vbroadcasti128 m6, [r0 + 16]
+ pshufb m5, m3
+ pshufb m7, m6, m3
+ pmaddwd m5, m0
+ pmaddwd m7, m1
+ paddd m5, m7
+
+ phaddd m4, m5
+ vpermq m4, m4, q3120
+ paddd m4, m2
+ vextracti128 xm5, m4, 1
+ psrad xm4, 2
+ psrad xm5, 2
+ packssdw xm4, xm5
+ movu [r2], xm4
+
+ vbroadcasti128 m5, [r0 + 24]
+ pshufb m6, m3
+ pshufb m7, m5, m3
+ pmaddwd m6, m0
+ pmaddwd m7, m1
+ paddd m6, m7
+
+ vbroadcasti128 m7, [r0 + 32]
+ pshufb m5, m3
+ pshufb m7, m3
+ pmaddwd m5, m0
+ pmaddwd m7, m1
+ paddd m5, m7
+
+ phaddd m6, m5
+ vpermq m6, m6, q3120
+ paddd m6, m2
+ vextracti128 xm5,m6, 1
+ psrad xm6, 2
+ psrad xm5, 2
+ packssdw xm6, xm5
+ movu [r2 + 16], xm6
+
+ add r2, r3
+ add r0, r1
+ dec r4d
+ jnz .loop0
+ RET
+%endif
+%endmacro
+
+ IPFILTER_LUMA_PS_16xN_AVX2 4
+ IPFILTER_LUMA_PS_16xN_AVX2 8
+ IPFILTER_LUMA_PS_16xN_AVX2 12
+ IPFILTER_LUMA_PS_16xN_AVX2 16
+ IPFILTER_LUMA_PS_16xN_AVX2 32
+ IPFILTER_LUMA_PS_16xN_AVX2 64
More information about the x265-devel
mailing list