[x265] [PATCH] luma_hpp[8x8, 8x16, 8x32] avx2 asm code: improved 657c->581c, 1192c->1112c, 2602c->2321c

chen chenm003 at 163.com
Tue Nov 11 01:49:51 CET 2014


need a little modify, see below

At 2014-11-10 17:20:49,divya at multicorewareinc.com wrote:
># HG changeset patch
># User Divya Manivannan
># Date 1415602686 -19800
>#      Mon Nov 10 12:28:06 2014 +0530
># Node ID a4c68926ff170d619c26bb78c7a988fa5ad715db
># Parent  1e04e178a349ff3a27ed0207cca7bdd9f0db4ff8
>luma_hpp[8x8, 8x16, 8x32] avx2 asm code: improved 657c->581c, 1192c->1112c, 2602c->2321c
>
>diff -r 1e04e178a349 -r a4c68926ff17 source/common/x86/ipfilter8.asm
>--- a/source/common/x86/ipfilter8.asm	Sun Nov 09 00:30:09 2014 -0600
>+++ b/source/common/x86/ipfilter8.asm	Mon Nov 10 12:28:06 2014 +0530
>@@ -124,6 +124,7 @@
> 
> tab_c_64_n64:   times 8 db 64, -64
> 
>+shuf1:   times 2 db 0, 1, 8, 9, 2, 3, 10, 11, 4, 5, 12, 13, 6, 7, 14, 15
> 
> SECTION .text
> 
>@@ -853,6 +854,58 @@
>     pextrd          [r2+r0], xm3, 3
>     RET
> 
>+%macro IPFILTER_LUMA_AVX2 2
>+INIT_YMM avx2
>+cglobal interp_8tap_horiz_pp_%1x%2, 4,6,6
>+    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
>+    mov             r4, %2 / 2

32bits is enough
 
>+.loop:

more unroll here
>+    ; 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]
>+    vextracti128    xm4, m3, 1
>+    packuswb        xm3, xm4

with unroll(4), we can share packuswb
>+    pshufb          xm3, [shuf1]
>+
>+     movq            [r2], xm3
>+     movhps          [r2 + r3], xm3
>+
>+    lea             r2, [r2 + r3 * 2]
>+    lea             r0, [r0 + r1 * 2]
>+    dec             r4
>+    jnz             .loop
>+    RET
>+%endmacro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20141111/42ade430/attachment.html>


More information about the x265-devel mailing list