# HG changeset patch
# User Vignesh Vijayakumar
# Date 1499342544 -19800
#      Thu Jul 06 17:32:24 2017 +0530
# Node ID 7283818f2dd7191c8258030c7424fa6b4ed5330f
# Parent  e59a457cfe6c0e2cd4137bf3337a2a2d0a815850
x86: AVX512 scale1D_128to64

AVX2 performance over C code   : 14.61x
AVX512 performance over C code : 16.19x

diff -r e59a457cfe6c -r 7283818f2dd7 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp      Thu Jul 06 17:00:09 2017 +0530
+++ b/source/common/x86/asm-primitives.cpp      Thu Jul 06 17:32:24 2017 +0530
@@ -3783,6 +3783,8 @@
         p.chroma[X265_CSP_I422].cu[CHROMA_422_32x64].copy_ps = 
PFX(blockcopy_ps_32x64_avx512);
         p.cu[BLOCK_64x64].copy_ps = PFX(blockcopy_ps_64x64_avx512);
 
+        p.scale1D_128to64 = PFX(scale1D_128to64_avx512);
+
     }
 #endif
 }
diff -r e59a457cfe6c -r 7283818f2dd7 source/common/x86/pixel-util.h
--- a/source/common/x86/pixel-util.h    Thu Jul 06 17:00:09 2017 +0530
+++ b/source/common/x86/pixel-util.h    Thu Jul 06 17:32:24 2017 +0530
@@ -44,6 +44,7 @@
 DEFINE_UTILS(ssse3);
 DEFINE_UTILS(sse4);
 DEFINE_UTILS(avx2);
+DEFINE_UTILS(avx512);
 
 #undef DEFINE_UTILS
 
diff -r e59a457cfe6c -r 7283818f2dd7 source/common/x86/pixel-util8.asm
--- a/source/common/x86/pixel-util8.asm Thu Jul 06 17:00:09 2017 +0530
+++ b/source/common/x86/pixel-util8.asm Thu Jul 06 17:32:24 2017 +0530
@@ -4062,6 +4062,39 @@
     RET
 %endif
 
+%if HIGH_BIT_DEPTH == 0
+INIT_ZMM avx512
+cglobal scale1D_128to64, 2, 2, 6
+    pxor            m4, m4
+    vbroadcasti32x8 m5, [pb_1]
+
+    ;Top pixel
+    movu            m0, [r1]
+    movu            m1, [r1 + 64]
+    movu            m2, [r1 + 128]
+    movu            m3, [r1 + 192]
+
+    pmaddubsw       m0, m0, m5
+    pavgw           m0, m4
+    pmaddubsw       m1, m1, m5
+    pavgw           m1, m4
+    packuswb        m0, m1
+    vpermq          m0, m0, q3120
+    vshufi64x2      m0, m0, q3120
+    movu            [r0], m0
+
+    ;Left pixel
+    pmaddubsw       m2, m2, m5
+    pavgw           m2, m4
+    pmaddubsw       m3, m3, m5
+    pavgw           m3, m4
+    packuswb        m2, m3
+    vpermq          m2, m2, q3120
+    vshufi64x2      m2, m2, q3120
+    movu            [r0 + 64], m2
+    RET
+%endif
+
 ;-----------------------------------------------------------------
 ; void scale2D_64to32(pixel *dst, pixel *src, intptr_t stride)
 ;-----------------------------------------------------------------
_______________________________________________
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to