[x265] [PATCH] asm: chroma_hps[6x8] avx2 - improved 670c->602c

aasaipriya at multicorewareinc.com aasaipriya at multicorewareinc.com
Thu Mar 26 05:13:57 CET 2015


# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1427343229 -19800
#      Thu Mar 26 09:43:49 2015 +0530
# Node ID e890493d1b2241fe0d9bd581da95837a011d6bfe
# Parent  24fdb661bb57273270014217ec52daa2546be699
asm: chroma_hps[6x8] avx2 - improved 670c->602c

diff -r 24fdb661bb57 -r e890493d1b22 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Mar 25 12:49:01 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp	Thu Mar 26 09:43:49 2015 +0530
@@ -1782,6 +1782,7 @@
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x8].filter_hps = x265_interp_4tap_horiz_ps_32x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].filter_hps = x265_interp_4tap_horiz_ps_2x4_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_2x8].filter_hps = x265_interp_4tap_horiz_ps_2x8_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_6x8].filter_hps = x265_interp_4tap_horiz_ps_6x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_24x32].filter_hpp = x265_interp_4tap_horiz_pp_24x32_avx2;
 
         p.chroma[X265_CSP_I422].pu[CHROMA_422_4x4].filter_vpp = x265_interp_4tap_vert_pp_4x4_avx2;
diff -r 24fdb661bb57 -r e890493d1b22 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Wed Mar 25 12:49:01 2015 -0500
+++ b/source/common/x86/ipfilter8.asm	Thu Mar 26 09:43:49 2015 +0530
@@ -20484,3 +20484,75 @@
     dec               r4d
     jnz               .loop
     RET
+
+;-----------------------------------------------------------------------------------------------------------------------------
+; void interp_4tap_horiz_ps_6x8(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx, int isRowExt)
+;-----------------------------------------------------------------------------------------------------------------------------;
+INIT_YMM avx2 
+cglobal interp_4tap_horiz_ps_6x8, 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,             8/2
+    dec               r0
+    test              r5d,             r5d
+    jz                .loop
+    sub               r0 ,             r1
+    inc               r6d
+
+.loop
+    ; 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
+    movq              [r2],            xm3
+    pextrd            [r2 + 8],        xm3,         2
+    movq              [r2 + r3],       xm4
+    pextrd            [r2 + r3 + 8],   xm4,         2
+    lea               r2,              [r2 + r3 * 2]
+    lea               r0,              [r0 + r1 * 2]
+    dec               r6d
+    jnz              .loop
+    test              r5d,             r5d
+    jz               .end
+
+    ;Row 11
+    vbroadcasti128    m3,              [r0]
+    pshufb            m3,              m1
+    pmaddubsw         m3,              m0
+    pmaddwd           m3,              m2
+    packssdw          m3,              m3
+    psubw             m3,              m5
+    vextracti128      xm4,             m3,          1
+    movq              [r2],            xm3
+    movd              [r2+8],          xm4
+.end
+    RET


More information about the x265-devel mailing list