[x265] [PATCH] asm: luma_hps[12x16] avx2 - improved 3779c->2482c

aasaipriya at multicorewareinc.com aasaipriya at multicorewareinc.com
Mon Apr 6 05:47:14 CEST 2015


# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1428292028 -19800
#      Mon Apr 06 09:17:08 2015 +0530
# Node ID 3d890f9a61596519d8e9777ebc9cbbedfc9f5a51
# Parent  ebe5e57c4b45b45338035a1009b64585f21d66d5
asm: luma_hps[12x16] avx2 - improved 3779c->2482c

diff -r ebe5e57c4b45 -r 3d890f9a6159 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Sat Apr 04 15:11:39 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp	Mon Apr 06 09:17:08 2015 +0530
@@ -1850,6 +1850,7 @@
         p.pu[LUMA_64x48].luma_hps = x265_interp_8tap_horiz_ps_64x48_avx2;
         p.pu[LUMA_64x32].luma_hps = x265_interp_8tap_horiz_ps_64x32_avx2;
         p.pu[LUMA_64x16].luma_hps = x265_interp_8tap_horiz_ps_64x16_avx2;
+        p.pu[LUMA_12x16].luma_hps = x265_interp_8tap_horiz_ps_12x16_avx2;
 
         p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].filter_hpp = x265_interp_4tap_horiz_pp_8x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].filter_hpp = x265_interp_4tap_horiz_pp_4x4_avx2;
diff -r ebe5e57c4b45 -r 3d890f9a6159 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Sat Apr 04 15:11:39 2015 -0500
+++ b/source/common/x86/ipfilter8.asm	Mon Apr 06 09:17:08 2015 +0530
@@ -20735,3 +20735,67 @@
     movd              [r2+8],          xm4
 .end
     RET
+
+INIT_YMM avx2
+cglobal interp_8tap_horiz_ps_12x16, 6, 7, 8
+    mov                         r5d,               r5m
+    mov                         r4d,               r4m
+%ifdef PIC
+    lea                         r6,                [tab_LumaCoeff]
+    vpbroadcastq                m0,                [r6 + r4 * 8]
+%else
+    vpbroadcastq                m0,                [tab_LumaCoeff + r4 * 8]
+%endif
+    mova                        m6,                [tab_Lm + 32]
+    mova                        m1,                [tab_Lm]
+    add                         r3d,               r3d
+    vbroadcasti128              m2,                [pw_2000]
+    mov                         r4d,                16
+    vbroadcasti128              m7,                [pw_1]
+    ; register map
+    ; m0 - interpolate coeff
+    ; m1 - shuffle order table
+    ; m2 - pw_2000
+
+    mova                        m5,                [interp8_hps_shuf]
+    sub                         r0,                3
+    test                        r5d,               r5d
+    jz                          .loop
+    lea                         r6,                [r1 * 3]                     ; r6 = (N / 2 - 1) * srcStride
+    sub                         r0,                r6                           ; r0(src)-r6
+    add                         r4d,                7
+.loop
+
+    ; Row 0
+
+    vbroadcasti128              m3,                [r0]                         ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb                      m4,                m3,        m6
+    pshufb                      m3,                m1                           ; shuffled based on the col order tab_Lm
+    pmaddubsw                   m3,                m0
+    pmaddubsw                   m4,                m0
+    pmaddwd                     m3,                m7
+    pmaddwd                     m4,                m7
+    packssdw                    m3,                m4
+
+    vbroadcasti128              m4,                [r0 + 8]                         ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb                      m4,                m1
+    pmaddubsw                   m4,                m0
+    pmaddwd                     m4,                m7
+    packssdw                    m4,                m4
+
+    pmaddwd                     m3,                m7
+    pmaddwd                     m4,                m7
+    packssdw                    m3,                m4
+
+    vpermd                      m3,                m5,               m3
+    psubw                       m3,                m2
+
+    vextracti128                xm4,               m3,               1
+    movu                        [r2],              xm3                          ;row 0
+    movq                        [r2 + 16],         xm4                          ;row 1
+
+    add                         r0,                r1
+    add                         r2,                r3
+    dec                         r4d
+    jnz                         .loop
+    RET


More information about the x265-devel mailing list