[x265] [PATCH] asm: filter_hpp[8x6] in avx2: 360c->234c

Divya Manivannan divya at multicorewareinc.com
Fri Mar 20 04:47:19 CET 2015


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1426823157 -19800
#      Fri Mar 20 09:15:57 2015 +0530
# Node ID b542f84a14fccdb1268ff7e65d3947c687937a30
# Parent  35458435a36d4ed9f23415c46556825f83e02232
asm: filter_hpp[8x6] in avx2: 360c->234c

diff -r 35458435a36d -r b542f84a14fc source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Mar 20 09:08:47 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Fri Mar 20 09:15:57 2015 +0530
@@ -1616,6 +1616,7 @@
 
         p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].filter_hpp = x265_interp_4tap_horiz_pp_8x2_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_8x4].filter_hpp = x265_interp_4tap_horiz_pp_8x4_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x6].filter_hpp = x265_interp_4tap_horiz_pp_8x6_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].filter_hpp = x265_interp_4tap_horiz_pp_8x16_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_8x32].filter_hpp = x265_interp_4tap_horiz_pp_8x32_avx2;
 
diff -r 35458435a36d -r b542f84a14fc source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Fri Mar 20 09:08:47 2015 +0530
+++ b/source/common/x86/ipfilter8.asm	Fri Mar 20 09:15:57 2015 +0530
@@ -1909,6 +1909,86 @@
     movhps            [r2 + r3],    xm3
     RET
 
+INIT_YMM avx2
+cglobal interp_4tap_horiz_pp_8x6, 4, 6, 7
+    mov               r4d,           r4m
+
+%ifdef PIC
+    lea               r5,            [tab_ChromaCoeff]
+    vpbroadcastd      m0,            [r5 + r4 * 4]
+%else
+    vpbroadcastd      m0,            [tab_ChromaCoeff + r4 * 4]
+%endif
+
+    mova              m1,            [tab_Tm]
+    mova              m2,            [pw_1]
+    mova              m6,            [pw_512]
+    lea               r4,            [r1 * 3]
+    lea               r5,            [r3 * 3]
+    ; register map
+    ; m0 - interpolate coeff
+    ; m1 - shuffle order table
+    ; m2 - constant word 1
+
+    dec               r0
+    ; Row 0
+    vbroadcasti128    m3,            [r0]                        ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb            m3,            m1
+    pmaddubsw         m3,            m0
+    pmaddwd           m3,            m2
+
+    ; Row 1
+    vbroadcasti128    m4,            [r0 + r1]                   ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb            m4,            m1
+    pmaddubsw         m4,            m0
+    pmaddwd           m4,            m2
+    packssdw          m3,            m4
+    pmulhrsw          m3,            m6
+
+    ; Row 2
+    vbroadcasti128    m4,            [r0 + r1 * 2]               ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb            m4,            m1
+    pmaddubsw         m4,            m0
+    pmaddwd           m4,            m2
+
+    ; Row 3
+    vbroadcasti128    m5,            [r0 + r4]                   ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb            m5,            m1
+    pmaddubsw         m5,            m0
+    pmaddwd           m5,            m2
+    packssdw          m4,            m5
+    pmulhrsw          m4,            m6
+
+    packuswb          m3,            m4
+    mova              m5,            [interp8_hps_shuf]
+    vpermd            m3,            m5,          m3
+    vextracti128      xm4,           m3,          1
+    movq              [r2],          xm3
+    movhps            [r2 + r3],     xm3
+    movq              [r2 + r3 * 2], xm4
+    movhps            [r2 + r5],     xm4
+    lea               r2,            [r2 + r3 * 4]
+    lea               r0,            [r0 + r1 * 4]
+    ; Row 4
+    vbroadcasti128    m3,            [r0]                        ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb            m3,            m1
+    pmaddubsw         m3,            m0
+    pmaddwd           m3,            m2
+
+    ; Row 5
+    vbroadcasti128    m4,            [r0 + r1]                   ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    pshufb            m4,            m1
+    pmaddubsw         m4,            m0
+    pmaddwd           m4,            m2
+    packssdw          m3,            m4
+    pmulhrsw          m3,            m6
+    vextracti128      xm4,           m3,          1
+    packuswb          xm3,           xm4
+    pshufd            xm3,           xm3,         11011000b
+    movq              [r2],          xm3
+    movhps            [r2 + r3],     xm3
+    RET
+
 ;-----------------------------------------------------------------------------------------------------------------------------
 ;void interp_horiz_ps_c(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx, int isRowExt)
 ;-----------------------------------------------------------------------------------------------------------------------------


More information about the x265-devel mailing list