[x265] [PATCH Review Only] asm: chroma_hpp[4x4] for colorspace i420 in avx2 improve 217c->198c
chen
chenm003 at 163.com
Tue Dec 9 20:04:48 CET 2014
At 2014-12-09 15:30:33,aasaipriya at multicorewareinc.com wrote:
># HG changeset patch
># User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
># Date 1418110108 -19800
># Tue Dec 09 12:58:28 2014 +0530
># Node ID 680279f6c90e9dff83624264b24a3577aa48e638
># Parent 88498ec9b10ba25a01c983a3f67c17bf470349fa
>asm: chroma_hpp[4x4] for colorspace i420 in avx2 improve 217c->198c
>
>diff -r 88498ec9b10b -r 680279f6c90e source/common/x86/asm-primitives.cpp
>--- a/source/common/x86/asm-primitives.cpp Tue Dec 09 10:03:35 2014 +0530
>+++ b/source/common/x86/asm-primitives.cpp Tue Dec 09 12:58:28 2014 +0530
>@@ -1873,6 +1873,7 @@
>
> p.luma_hpp[LUMA_48x64] = x265_interp_8tap_horiz_pp_48x64_avx2;
>
>+ p.chroma[X265_CSP_I420].filter_hpp[CHROMA_4x4] = x265_interp_4tap_horiz_pp_4x4_avx2;
> p.chroma[X265_CSP_I420].filter_hpp[CHROMA_8x8] = x265_interp_4tap_horiz_pp_8x8_avx2;
>
> p.luma_vpp[LUMA_4x4] = x265_interp_8tap_vert_pp_4x4_avx2;
>diff -r 88498ec9b10b -r 680279f6c90e source/common/x86/ipfilter8.asm
>--- a/source/common/x86/ipfilter8.asm Tue Dec 09 10:03:35 2014 +0530
>+++ b/source/common/x86/ipfilter8.asm Tue Dec 09 12:58:28 2014 +0530
>@@ -177,6 +177,8 @@
>
> tab_c_64_n64: times 8 db 64, -64
>
>+interp_4tap_horiz_4x4_shuf: db 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6
half size is enough, and may share with tab_Tm
>+
> const interp4_shuf, times 2 db 0, 1, 8, 9, 4, 5, 12, 13, 2, 3, 10, 11, 6, 7, 14, 15
>
> SECTION .text
>@@ -1403,6 +1405,56 @@
> jnz .loop
> RET
>
>+
>+INIT_YMM avx2
>+cglobal interp_4tap_horiz_pp_4x4, 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
>+
>+ movu m1, [interp_4tap_horiz_4x4_shuf]
the constant memory is aligned
>+ vpbroadcastd m2, [pw_1]
>+
>+ ; register map
>+ ; m0 - interpolate coeff
>+ ; m1 - shuffle order table
>+ ; m2 - constant word 1
>+
>+ sub r0, 1
how about DEC?
>+ ; Row 0-1
>+ vbroadcasti128 m3, [r0] ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
>+ movu xm4, [r0 + r1]
>+ vinserti128 m3, m3, xm4, 1
how about combo Movu and Vinserti128 ?
>+ pshufb m3, m1
>+ pmaddubsw m3, m0
>+ pmaddwd m3, m2
>+
>+ ; Row 2-3
>+ lea r0, [r0 + r1 * 2]
>+ vbroadcasti128 m4, [r0] ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
>+ movu xm5, [r0 + r1]
>+ vinserti128 m4, m4, xm5, 1
>+ pshufb m4, m1
if constant use less or equal to 2 times, we can use it directly
>+ pmaddubsw m4, m0
>+ pmaddwd m4, m2
>+
>+ packssdw m3, m4
>+ pmulhrsw m3, [pw_512]
>+ vextracti128 xm4, m3, 1
>+ packuswb xm3, xm4
>+
>+ lea r0, [r3 * 3]
>+ movd [r2], xm3
>+ pextrd [r2+r3], xm3, 2
>+ pextrd [r2+r3*2], xm3, 1
>+ pextrd [r2+r0], xm3, 3
>+ RET
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20141210/1fff9a49/attachment.html>
More information about the x265-devel
mailing list