[x265] [PATCH] asm: filter_hpp[8x2] in avx2: 150c->107c

Divya Manivannan divya at multicorewareinc.com
Fri Mar 20 04:42:02 CET 2015


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1426822727 -19800
#      Fri Mar 20 09:08:47 2015 +0530
# Node ID 35458435a36d4ed9f23415c46556825f83e02232
# Parent  28e9c5f82a7874a39fad39ace926c3fbec286882
asm: filter_hpp[8x2] in avx2: 150c->107c

diff -r 28e9c5f82a78 -r 35458435a36d source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Mar 20 09:04:23 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Fri Mar 20 09:08:47 2015 +0530
@@ -1614,6 +1614,7 @@
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x24].filter_hpp = x265_interp_4tap_horiz_pp_32x24_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x8].filter_hpp = x265_interp_4tap_horiz_pp_32x8_avx2;
 
+        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_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 28e9c5f82a78 -r 35458435a36d source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Fri Mar 20 09:04:23 2015 +0530
+++ b/source/common/x86/ipfilter8.asm	Fri Mar 20 09:08:47 2015 +0530
@@ -1869,6 +1869,46 @@
     IPFILTER_LUMA_64x_avx2 64 , 32
     IPFILTER_LUMA_64x_avx2 64 , 16
 
+INIT_YMM avx2
+cglobal interp_4tap_horiz_pp_8x2, 4, 6, 5
+    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]
+
+    ; 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,           [pw_512]
+    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