[x265] [PATCH] asm: chroma_hpp[4x4] for colorspace i420 in avx2 improve 217c->192c

aasaipriya at multicorewareinc.com aasaipriya at multicorewareinc.com
Thu Dec 11 05:07:03 CET 2014


# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1418270776 -19800
#      Thu Dec 11 09:36:16 2014 +0530
# Node ID b37278c2eb302377dfb39fd74c024e66c238399a
# Parent  9c3b478a60b27aa118b0eb71e8d495016a0283d1
asm: chroma_hpp[4x4] for colorspace i420 in avx2 improve 217c->192c

diff -r 9c3b478a60b2 -r b37278c2eb30 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Dec 10 17:19:06 2014 -0600
+++ b/source/common/x86/asm-primitives.cpp	Thu Dec 11 09:36:16 2014 +0530
@@ -1874,6 +1874,7 @@
         p.luma_hpp[LUMA_48x64] = x265_interp_8tap_horiz_pp_48x64_avx2;
 
         p.chroma[X265_CSP_I420].filter_hpp[CHROMA_8x8] = x265_interp_4tap_horiz_pp_8x8_avx2;
+        p.chroma[X265_CSP_I420].filter_hpp[CHROMA_4x4] = x265_interp_4tap_horiz_pp_4x4_avx2;
 
         p.luma_vpp[LUMA_4x4] = x265_interp_8tap_vert_pp_4x4_avx2;
 
diff -r 9c3b478a60b2 -r b37278c2eb30 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Wed Dec 10 17:19:06 2014 -0600
+++ b/source/common/x86/ipfilter8.asm	Thu Dec 11 09:36:16 2014 +0530
@@ -1403,6 +1403,54 @@
     jnz               .loop
     RET
 
+INIT_YMM avx2 
+cglobal interp_4tap_horiz_pp_4x4, 4,6,6
+    mov             r4d, r4m
+
+%ifdef PIC
+    lea               r5,           [tab_ChromaCoeff]
+    vpbroadcastd      m0,           [r5 + r4 * 4]
+%else
+    vpbroadcastd      m0,           [tab_ChromaCoeff + r4 * 4]
+%endif
+
+    vpbroadcastd      m2,           [pw_1]
+    vbroadcasti128    m1,           [tab_Tm]
+
+    ; register map
+    ; m0 - interpolate coeff
+    ; m1 - shuffle order table
+    ; m2 - constant word 1
+
+    dec                r0
+
+    ; Row 0-1
+    vbroadcasti128    m3,           [r0]                        ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    vinserti128       m3,           m3,      [r0 + r1],     1
+    pshufb            m3,           m1
+    pmaddubsw         m3,           m0
+    pmaddwd           m3,           m2
+
+    ; Row 2-3
+    lea               r0,           [r0 + r1 * 2]
+    vbroadcasti128    m4,           [r0]                      ; [x x x x x A 9 8 7 6 5 4 3 2 1 0]
+    vinserti128       m4,           m4,      [r0 + r1],     1
+    pshufb            m4,           m1
+    pmaddubsw         m4,           m0
+    pmaddwd           m4,           m2
+
+    packssdw          m3,           m4
+    pmulhrsw          m3,           [pw_512]
+    vextracti128      xm4,          m3,     1
+    packuswb          xm3,          xm4
+
+    lea               r0,           [r3 * 3]
+    movd              [r2],         xm3
+    pextrd            [r2+r3],      xm3,     2
+    pextrd            [r2+r3*2],    xm3,     1
+    pextrd            [r2+r0],      xm3,     3
+    RET
+
 ;--------------------------------------------------------------------------------------------------------------
 ; void interp_8tap_horiz_pp_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
 ;--------------------------------------------------------------------------------------------------------------


More information about the x265-devel mailing list