[x265] [PATCH] asm: chroma_vpp[64x64] for colorspace i444 in avx2: improve 15351c->7344c

Divya Manivannan divya at multicorewareinc.com
Wed Dec 10 12:10:13 CET 2014


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1418209768 -19800
#      Wed Dec 10 16:39:28 2014 +0530
# Node ID 016eb6ee9606a8d160b4c33c40e39b85c419d890
# Parent  45a3df8b653c78b1c1d1cde5bd4dcab628eb537f
asm: chroma_vpp[64x64] for colorspace i444 in avx2: improve 15351c->7344c

diff -r 45a3df8b653c -r 016eb6ee9606 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Dec 10 16:12:52 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Dec 10 16:39:28 2014 +0530
@@ -1887,6 +1887,9 @@
 #if X86_64
         p.chroma[X265_CSP_I420].filter_vpp[CHROMA_16x16] = x265_interp_4tap_vert_pp_16x16_avx2;
         p.chroma[X265_CSP_I420].filter_vpp[CHROMA_32x32] = x265_interp_4tap_vert_pp_32x32_avx2;
+
+        // colorspace i444
+        p.chroma[X265_CSP_I444].filter_vpp[LUMA_64x64] = x265_interp_4tap_vert_pp_64x64_avx2;
 #endif
     }
 #endif // if HIGH_BIT_DEPTH
diff -r 45a3df8b653c -r 016eb6ee9606 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Wed Dec 10 16:12:52 2014 +0530
+++ b/source/common/x86/ipfilter8.asm	Wed Dec 10 16:39:28 2014 +0530
@@ -4235,6 +4235,103 @@
 FILTER_V4_W16n_H2 48, 64
 FILTER_V4_W16n_H2 64, 16
 
+INIT_YMM avx2
+%if ARCH_X86_64 == 1
+cglobal interp_4tap_vert_pp_64x64, 4, 9, 13
+    mov             r4d, r4m
+    shl             r4d, 6
+
+%ifdef PIC
+    lea             r5, [tab_ChromaCoeffVer_32]
+    add             r5, r4
+%else
+    lea             r5, [tab_ChromaCoeffVer_32 + r4]
+%endif
+
+    mova            m10, [r5]
+    mova            m11, [r5 + mmsize]
+    lea             r4, [r1 * 3]
+    sub             r0, r1
+    lea             r5, [r3 * 3]
+    mova            m12, [pw_512]
+    mov             r6d, 16
+.loopH:
+    mov             r8d, 2
+.loopW:
+    movu            m0, [r0]                        ; m0 = row 0
+    movu            m1, [r0 + r1]                   ; m1 = row 1
+    punpcklbw       m2, m0, m1
+    punpckhbw       m3, m0, m1
+    pmaddubsw       m2, m10
+    pmaddubsw       m3, m10
+    movu            m0, [r0 + r1 * 2]               ; m0 = row 2
+    punpcklbw       m4, m1, m0
+    punpckhbw       m5, m1, m0
+    pmaddubsw       m4, m10
+    pmaddubsw       m5, m10
+    movu            m1, [r0 + r4]                   ; m1 = row 3
+    punpcklbw       m6, m0, m1
+    punpckhbw       m7, m0, m1
+    pmaddubsw       m8, m6, m11
+    pmaddubsw       m9, m7, m11
+    pmaddubsw       m6, m10
+    pmaddubsw       m7, m10
+    paddw           m2, m8
+    paddw           m3, m9
+    pmulhrsw        m2, m12
+    pmulhrsw        m3, m12
+    packuswb        m2, m3
+    movu            [r2], m2
+
+    lea             r7, [r0 + r1 * 4]
+    movu            m0, [r7]                        ; m0 = row 4
+    punpcklbw       m2, m1, m0
+    punpckhbw       m3, m1, m0
+    pmaddubsw       m8, m2, m11
+    pmaddubsw       m9, m3, m11
+    pmaddubsw       m2, m10
+    pmaddubsw       m3, m10
+    paddw           m4, m8
+    paddw           m5, m9
+    pmulhrsw        m4, m12
+    pmulhrsw        m5, m12
+    packuswb        m4, m5
+    movu            [r2 + r3], m4
+
+    movu            m1, [r7 + r1]                   ; m1 = row 5
+    punpcklbw       m4, m0, m1
+    punpckhbw       m5, m0, m1
+    pmaddubsw       m4, m11
+    pmaddubsw       m5, m11
+    paddw           m6, m4
+    paddw           m7, m5
+    pmulhrsw        m6, m12
+    pmulhrsw        m7, m12
+    packuswb        m6, m7
+    movu            [r2 + r3 * 2], m6
+
+    movu            m0, [r7 + r1 * 2]               ; m0 = row 6
+    punpcklbw       m6, m1, m0
+    punpckhbw       m7, m1, m0
+    pmaddubsw       m6, m11
+    pmaddubsw       m7, m11
+    paddw           m2, m6
+    paddw           m3, m7
+    pmulhrsw        m2, m12
+    pmulhrsw        m3, m12
+    packuswb        m2, m3
+    movu            [r2 + r5], m2
+
+    add             r2, 32
+    add             r0, 32
+    dec             r8d
+    jnz             .loopW
+    lea             r0, [r7 - 32]
+    lea             r2, [r2 + r3 * 4 - 64]
+    dec             r6d
+    jnz             .loopH
+    RET
+%endif
 
 ;-----------------------------------------------------------------------------
 ; void filterConvertPelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int width, int height)
diff -r 45a3df8b653c -r 016eb6ee9606 source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Wed Dec 10 16:12:52 2014 +0530
+++ b/source/common/x86/ipfilter8.h	Wed Dec 10 16:39:28 2014 +0530
@@ -586,6 +586,7 @@
 CHROMA_SS_FILTERS_422_SSE4(_sse4);
 
 CHROMA_FILTERS_444(_sse4);
+CHROMA_FILTERS_444(_avx2);
 CHROMA_SP_FILTERS_444(_sse4);
 CHROMA_SS_FILTERS_444(_sse2);
 


More information about the x265-devel mailing list