[x265] [PATCH] asm: avx2 code for pixel_add_ps[16x16] for 10 bpp - 57x

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Mon Mar 2 09:49:48 CET 2015


# HG changeset patch
# User Sumalatha Polureddy<sumalatha at multicorewareinc.com>
# Date 1425286174 -19800
# Node ID eadb74b415c5de7f0cd5360c74ecf0507489de52
# Parent  1be088c8bc675752ebfebc4fda3bad41659269a4
asm: avx2 code for pixel_add_ps[16x16] for 10 bpp - 57x

add_ps[16x16]  57.58x   493.78          28431.93

diff -r 1be088c8bc67 -r eadb74b415c5 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Mar 02 14:17:15 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Mar 02 14:19:34 2015 +0530
@@ -1070,6 +1070,7 @@
     if (cpuMask & X265_CPU_AVX2)
     {
         p.cu[BLOCK_8x8].add_ps = x265_pixel_add_ps_8x8_avx2;
+        p.cu[BLOCK_16x16].add_ps = x265_pixel_add_ps_16x16_avx2;
 
         p.cu[BLOCK_32x32].ssd_s = x265_pixel_ssd_s_32_avx2;
         p.cu[BLOCK_16x16].sse_ss = x265_pixel_ssd_ss_16x16_avx2;
diff -r 1be088c8bc67 -r eadb74b415c5 source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Mon Mar 02 14:17:15 2015 +0530
+++ b/source/common/x86/pixeladd8.asm	Mon Mar 02 14:19:34 2015 +0530
@@ -442,6 +442,47 @@
 
     jnz     .loop
     RET
+
+INIT_YMM avx2
+cglobal pixel_add_ps_16x%2, 6, 7, 6, dest, destride, src0, scr1, srcStride0, srcStride1
+    mova    m5,     [pw_pixel_max]
+    pxor    m4,     m4
+    mov     r6d,    %2/4
+    add     r4,     r4
+    add     r5,     r5
+    add     r1,     r1
+.loop:
+    movu    m0,     [r2]            ; row 0 of src0
+    movu    m2,     [r2 + r4]       ; row 1 of src0
+    movu    m1,     [r3]            ; row 0 of src1
+    movu    m3,     [r3 + r5]       ; row 1 of src1
+    paddw   m0,     m1
+    paddw   m2,     m3
+    CLIPW2  m0, m2, m4, m5
+    movu    [r0],       m0          ; row 0 of dst
+    movu    [r0 + r1],  m2          ; row 1 of dst
+
+    lea     r2,     [r2 + r4 * 2]
+    lea     r3,     [r3 + r5 * 2]
+    lea     r0,     [r0 + r1 * 2]
+
+    movu    m0,     [r2]            ; row 2 of src0
+    movu    m2,     [r2 + r4]       ; row 3 of src0
+    movu    m1,     [r3]            ; row 2 of src1
+    movu    m3,     [r3 + r5]       ; row 3 of src1
+    paddw   m0,     m1
+    paddw   m2,     m3
+    CLIPW2  m0, m2, m4, m5
+    movu    [r0],       m0          ; row 2 of dst
+    movu    [r0 + r1],  m2          ; row 3 of dst
+
+    lea     r2,     [r2 + r4 * 2]
+    lea     r3,     [r3 + r5 * 2]
+    lea     r0,     [r0 + r1 * 2]
+
+    dec     r6d
+    jnz     .loop
+    RET
 %else
 INIT_XMM sse4
 cglobal pixel_add_ps_16x%2, 6, 7, 8, dest, destride, src0, scr1, srcStride0, srcStride1


More information about the x265-devel mailing list