[x265] [PATCH Review Only] luma_hps[12x16] avx2 asm: improved 3751c->2963c

aasaipriya at multicorewareinc.com aasaipriya at multicorewareinc.com
Mon Mar 2 10:24:27 CET 2015


# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1425288244 -19800
#      Mon Mar 02 14:54:04 2015 +0530
# Node ID 15c8a533f530a32d3fc3b6a92d47daa677e74e34
# Parent  04861917b7b343216ac1b9a9f70e38396af53275
luma_hps[12x16] avx2 asm: improved 3751c->2963c

diff -r 04861917b7b3 -r 15c8a533f530 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Feb 26 19:11:18 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Mar 02 14:54:04 2015 +0530
@@ -1786,6 +1786,8 @@
 
         p.pu[LUMA_48x64].luma_hpp = x265_interp_8tap_horiz_pp_48x64_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;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].filter_hpp = x265_interp_4tap_horiz_pp_32x32_avx2;
diff -r 04861917b7b3 -r 15c8a533f530 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Thu Feb 26 19:11:18 2015 +0530
+++ b/source/common/x86/ipfilter8.asm	Mon Mar 02 14:54:04 2015 +0530
@@ -1922,6 +1922,65 @@
 IPFILTER_LUMA_PS_8x_AVX2 8 , 32
 IPFILTER_LUMA_PS_8x_AVX2 8 , 4
 
+INIT_YMM avx2
+cglobal interp_8tap_horiz_ps_12x16, 6, 7, 5
+    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
+
+    ; register map
+    ; m0 - interpolate coeff
+    ; m1 - shuffle order table
+    ; m2 - pw_2000
+
+    mova                        m5,                [interp8_hps_shuf]
+    sub                         r0,                3
+    test                        r5d,               r5d
+    jz                          .label
+    lea                         r6,                [r1 * 3]                     ; r6 = (N / 2 - 1) * srcStride
+    sub                         r0,                r6                           ; r0(src)-r6
+    add                         r4d,                7                            ; blkheight += 7
+.label
+
+    ; 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
+    phaddw                      m3,                m4                           ; DWORD [R1D R1C R0D R0C R1B R1A R0B R0A]
+
+    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
+    phaddw                      m4,                m4                           ; DWORD [R3D R3C R2D R2C R3B R3A R2B R2A]
+
+    phaddw                      m3,                m4                           ; all rows and col completed
+
+    vpermd                      m3,                m5,               m3
+    psubw                       m3,                m2
+
+    vextracti128                xm4,               m3,               1
+    movu                        [r2],              xm3                          ;row 0
+    movq                        [r2 + 16],         xm4                          ;row 1
+
+   lea                          r2,                [r2 + r3]
+   lea                          r0,                [r0 + r1]
+   dec                          r4d
+   jnz                          .label
+RET
+
 
 %macro IPFILTER_LUMA_PS_16x_AVX2 2
 INIT_YMM avx2


More information about the x265-devel mailing list