[x265] [PATCH] asm : chroma_hps[8x8] for i420 avx2 - improved 629c->503c

aasaipriya at multicorewareinc.com aasaipriya at multicorewareinc.com
Wed Mar 11 06:06:46 CET 2015


# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1426050385 -19800
#      Wed Mar 11 10:36:25 2015 +0530
# Node ID ce06c14c599952ed6c1c889272041963efc6c60c
# Parent  6d22e70191340d11425713bced720a9b4439a27f
asm : chroma_hps[8x8] for i420 avx2 - improved 629c->503c

diff -r 6d22e7019134 -r ce06c14c5999 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Mar 11 10:32:08 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Mar 11 10:36:25 2015 +0530
@@ -1578,6 +1578,7 @@
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].filter_hps = x265_interp_4tap_horiz_ps_32x32_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].filter_hps = x265_interp_4tap_horiz_ps_16x16_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].filter_hps = x265_interp_4tap_horiz_ps_4x4_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].filter_hps = x265_interp_4tap_horiz_ps_8x8_avx2;
 
         p.chroma[X265_CSP_I422].pu[CHROMA_422_4x4].filter_vpp = x265_interp_4tap_vert_pp_4x4_avx2;
 
diff -r 6d22e7019134 -r ce06c14c5999 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Wed Mar 11 10:32:08 2015 +0530
+++ b/source/common/x86/ipfilter8.asm	Wed Mar 11 10:36:25 2015 +0530
@@ -14604,3 +14604,77 @@
     movhps            [r2],         xm3
 .end
    RET
+
+;-----------------------------------------------------------------------------------------------------------------------------
+; void interp_4tap_horiz_ps_8x8(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx, int isRowExt)
+;-----------------------------------------------------------------------------------------------------------------------------;
+INIT_YMM avx2 
+cglobal interp_4tap_horiz_ps_8x8, 4,7,6
+    mov             r4d, r4m
+    mov             r5d, r5m
+    add             r3d, r3d
+
+%ifdef PIC
+    lea               r6,           [tab_ChromaCoeff]
+    vpbroadcastd      m0,           [r6 + r4 * 4]
+%else
+    vpbroadcastd      m0,           [tab_ChromaCoeff + r4 * 4]
+%endif
+
+    vbroadcasti128     m2,           [pw_1]
+    vbroadcasti128     m5,           [pw_2000]
+    mova               m1,           [tab_Tm]
+
+    ; register map
+    ; m0 - interpolate coeff
+    ; m1 - shuffle order table
+    ; m2 - constant word 1
+
+    mov                r6d,      4
+    dec                r0
+    test                r5d,     r5d
+    je                 .loop
+    sub                r0 ,      r1
+    add                r6d ,     1
+
+.loop
+     dec               r6d
+    ; Row 0
+    vbroadcasti128    m3,           [r0]
+    pshufb            m3,           m1
+    pmaddubsw         m3,           m0
+    pmaddwd           m3,           m2
+
+    ; Row 1
+    vbroadcasti128    m4,           [r0 + r1]
+    pshufb            m4,           m1
+    pmaddubsw         m4,           m0
+    pmaddwd           m4,           m2
+
+    packssdw          m3,           m4
+    psubw             m3,           m5
+
+    vpermq            m3,           m3,          11011000b
+    vextracti128      xm4,          m3,     1
+    movu             [r2],         xm3
+    movu             [r2 + r3],    xm4
+
+    lea               r2,           [r2 + r3 * 2]
+    lea               r0,           [r0 + r1 * 2]
+    test               r6d,          r6d
+    jnz               .loop
+    test              r5d,         r5d
+    je                .end
+
+    ;Row 11
+    vbroadcasti128    m3,           [r0]
+    pshufb            m3,           m1
+    pmaddubsw         m3,           m0
+    pmaddwd           m3,           m2
+
+    packssdw          m3,           m3
+    psubw             m3,           m5
+    vpermq            m3,           m3,          11011000b
+    movu             [r2],         xm3
+.end
+   RET


More information about the x265-devel mailing list