[x265] [PATCH] asm: chroma_hps[8x2, 8x4, 8x6, 8x16, 8x32] avx2 - improved 298c->228c, 397c->312c, 455c->348c, 936c->736c, 1696c->1319c

aasaipriya at multicorewareinc.com aasaipriya at multicorewareinc.com
Wed Mar 25 05:12:48 CET 2015


# HG changeset patch
# User Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
# Date 1427256762 -19800
#      Wed Mar 25 09:42:42 2015 +0530
# Node ID 489c40ea0b7b568e5815b9aecfa60c286cd8bfbc
# Parent  e637273e2ae6391d43a037d9a4298a8be8e178ad
asm: chroma_hps[8x2, 8x4, 8x6, 8x16, 8x32] avx2 - improved 298c->228c, 397c->312c, 455c->348c, 936c->736c, 1696c->1319c

diff -r e637273e2ae6 -r 489c40ea0b7b source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Mar 24 15:31:05 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp	Wed Mar 25 09:42:42 2015 +0530
@@ -1723,6 +1723,12 @@
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x8].filter_hps = x265_interp_4tap_horiz_ps_4x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x16].filter_hps = x265_interp_4tap_horiz_ps_4x16_avx2;
 
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].filter_hps = x265_interp_4tap_horiz_ps_8x2_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x4].filter_hps = x265_interp_4tap_horiz_ps_8x4_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x6].filter_hps = x265_interp_4tap_horiz_ps_8x6_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x32].filter_hps = x265_interp_4tap_horiz_ps_8x32_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].filter_hps = x265_interp_4tap_horiz_ps_8x16_avx2;
+
         p.chroma[X265_CSP_I420].pu[CHROMA_420_16x32].filter_hps = x265_interp_4tap_horiz_ps_16x32_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_16x12].filter_hps = x265_interp_4tap_horiz_ps_16x12_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_16x8].filter_hps = x265_interp_4tap_horiz_ps_16x8_avx2;
diff -r e637273e2ae6 -r 489c40ea0b7b source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Tue Mar 24 15:31:05 2015 -0500
+++ b/source/common/x86/ipfilter8.asm	Wed Mar 25 09:42:42 2015 +0530
@@ -20145,3 +20145,81 @@
 IPFILTER_LUMA_PS_64xN_AVX2 48
 IPFILTER_LUMA_PS_64xN_AVX2 32
 IPFILTER_LUMA_PS_64xN_AVX2 16
+
+;-----------------------------------------------------------------------------------------------------------------------------
+; void interp_4tap_horiz_ps_8xN(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx, int isRowExt)
+;-----------------------------------------------------------------------------------------------------------------------------
+%macro IPFILTER_CHROMA_PS_8xN_AVX2 1
+INIT_YMM avx2 
+cglobal interp_4tap_horiz_ps_8x%1, 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,             %1/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
+    movu               [r2],            xm3
+    movu               [r2 + r3],       xm4
+
+    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
+    vpermq             m3,              m3,          11011000b
+    movu               [r2],            xm3
+.end
+   RET
+%endmacro
+
+    IPFILTER_CHROMA_PS_8xN_AVX2  2
+    IPFILTER_CHROMA_PS_8xN_AVX2  32
+    IPFILTER_CHROMA_PS_8xN_AVX2  16
+    IPFILTER_CHROMA_PS_8xN_AVX2  6
+    IPFILTER_CHROMA_PS_8xN_AVX2  4


More information about the x265-devel mailing list