[x265] [PATCH] asm: luma_hpp[8x8, 8x16, 8x32] in avx2: improve 623c->523c, 1384c->1092c, 2555c->2067c
Divya Manivannan
divya at multicorewareinc.com
Mon Nov 24 07:37:27 CET 2014
# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1416810964 -19800
# Mon Nov 24 12:06:04 2014 +0530
# Node ID 67426be98effc8e2fdb6511187dfbced7971b6ae
# Parent 9dfa1886c8802073a7d56db85c896a641c54d98a
asm: luma_hpp[8x8, 8x16, 8x32] in avx2: improve 623c->523c, 1384c->1092c, 2555c->2067c
diff -r 9dfa1886c880 -r 67426be98eff source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Mon Nov 24 10:33:42 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp Mon Nov 24 12:06:04 2014 +0530
@@ -1806,6 +1806,9 @@
p.luma_vpp[LUMA_16x64] = x265_interp_8tap_vert_pp_16x64_avx2;
#endif
p.luma_hpp[LUMA_4x4] = x265_interp_8tap_horiz_pp_4x4_avx2;
+ p.luma_hpp[LUMA_8x8] = x265_interp_8tap_horiz_pp_8x8_avx2;
+ p.luma_hpp[LUMA_8x16] = x265_interp_8tap_horiz_pp_8x16_avx2;
+ p.luma_hpp[LUMA_8x32] = x265_interp_8tap_horiz_pp_8x32_avx2;
p.luma_vpp[LUMA_4x4] = x265_interp_8tap_vert_pp_4x4_avx2;
p.luma_vpp[LUMA_8x4] = x265_interp_8tap_vert_pp_8x4_avx2;
p.luma_vpp[LUMA_8x8] = x265_interp_8tap_vert_pp_8x8_avx2;
diff -r 9dfa1886c880 -r 67426be98eff source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Mon Nov 24 10:33:42 2014 +0530
+++ b/source/common/x86/ipfilter8.asm Mon Nov 24 12:06:04 2014 +0530
@@ -883,6 +883,88 @@
IPFILTER_LUMA 12, 16, pp
IPFILTER_LUMA 4, 16, pp
+%macro IPFILTER_LUMA_AVX2 2
+INIT_YMM avx2
+cglobal interp_8tap_horiz_pp_%1x%2, 4, 7, 7
+ mov r4d, r4m
+
+%ifdef PIC
+ lea r5, [tab_LumaCoeff]
+ vpbroadcastq m0, [r5 + r4 * 8]
+%else
+ vpbroadcastq m0, [tab_LumaCoeff + r4 * 8]
+%endif
+
+ mova m1, [tab_Lm]
+ mova m2, [tab_Lm + 32]
+
+ ; register map
+ ; m0 - interpolate coeff
+ ; m1, m2 - shuffle order table
+
+ sub r0, 3
+ lea r5, [r1 * 3]
+ lea r6, [r3 * 3]
+ mov r4d, %2 / 4
+.loop:
+ ; Row 0
+ vbroadcasti128 m3, [r0] ; [x E D C B A 9 8 7 6 5 4 3 2 1 0]
+ pshufb m4, m3, m2
+ pshufb m3, m1
+ pmaddubsw m3, m0
+ pmaddubsw m4, m0
+ phaddw m3, m4
+ ; Row 1
+ vbroadcasti128 m4, [r0 + r1] ; [x E D C B A 9 8 7 6 5 4 3 2 1 0]
+ pshufb m5, m4, m2
+ pshufb m4, m1
+ pmaddubsw m4, m0
+ pmaddubsw m5, m0
+ phaddw m4, m5
+
+ phaddw m3, m4 ; WORD [R1H R1G R1D R1C R0H R0G R0D R0C R1F R1E R1B R1A R0F R0E R0B R0A]
+ pmulhrsw m3, [pw_512]
+
+ ; Row 2
+ vbroadcasti128 m4, [r0 + r1 * 2] ; [x E D C B A 9 8 7 6 5 4 3 2 1 0]
+ pshufb m5, m4, m2
+ pshufb m4, m1
+ pmaddubsw m4, m0
+ pmaddubsw m5, m0
+ phaddw m4, m5
+ ; Row 3
+ vbroadcasti128 m5, [r0 + r5] ; [x E D C B A 9 8 7 6 5 4 3 2 1 0]
+ pshufb m6, m5, m2
+ pshufb m5, m1
+ pmaddubsw m5, m0
+ pmaddubsw m6, m0
+ phaddw m5, m6
+
+ phaddw m4, m5 ; WORD [R3H R3G R3D R3C R2H R2G R2D R2C R3F R3E R3B R3A R2F R2E R2B R2A]
+ pmulhrsw m4, [pw_512]
+
+ packuswb m3, m4
+ vextracti128 xm4, m3, 1
+ punpcklwd xm5, xm3, xm4
+
+ movq [r2], xm5
+ movhps [r2 + r3], xm5
+
+ punpckhwd xm5, xm3, xm4
+ movq [r2 + r3 * 2], xm5
+ movhps [r2 + r6], xm5
+
+ lea r0, [r0 + r1 * 4]
+ lea r2, [r2 + r3 * 4]
+ dec r4d
+ jnz .loop
+ RET
+%endmacro
+
+IPFILTER_LUMA_AVX2 8, 8
+IPFILTER_LUMA_AVX2 8, 16
+IPFILTER_LUMA_AVX2 8, 32
+
;--------------------------------------------------------------------------------------------------------------
; void interp_8tap_horiz_pp_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
;--------------------------------------------------------------------------------------------------------------
More information about the x265-devel
mailing list