[x265] [PATCH] blockcopy_pp_32x8: avx asm code, improved 281.20 cycles -> 165.47

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Sep 24 12:14:07 CEST 2014


# HG changeset patch
# User Praveen Tiwari
# Date 1411553535 -19800
# Node ID eaa9d7a7b97759aa7b8bba91791b78422cfad083
# Parent  b2b7072ddbf73085d457bd6a71bca946e505dea8
blockcopy_pp_32x8: avx asm code, improved 281.20 cycles -> 165.47

diff -r b2b7072ddbf7 -r eaa9d7a7b977 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Sep 24 11:48:15 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Sep 24 15:42:15 2014 +0530
@@ -1714,6 +1714,9 @@
         p.luma_copy_ss[LUMA_64x32] = x265_blockcopy_ss_64x32_avx;
         p.luma_copy_ss[LUMA_64x48] = x265_blockcopy_ss_64x48_avx;
         p.luma_copy_ss[LUMA_64x64] = x265_blockcopy_ss_64x64_avx;
+
+        p.chroma[X265_CSP_I420].copy_pp[CHROMA_32x8] = x265_blockcopy_pp_32x8_avx;
+        p.luma_copy_pp[LUMA_32x8] = x265_blockcopy_pp_32x8_avx;
     }
     if (cpuMask & X265_CPU_XOP)
     {
diff -r b2b7072ddbf7 -r eaa9d7a7b977 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Wed Sep 24 11:48:15 2014 +0530
+++ b/source/common/x86/blockcopy8.asm	Wed Sep 24 15:42:15 2014 +0530
@@ -605,6 +605,34 @@
 
 BLOCKCOPY_PP_W32_H4 32, 48
 
+INIT_YMM avx
+cglobal blockcopy_pp_32x8, 4, 6, 6
+    lea    r4, [3 * r1]
+    lea    r5, [3 * r3]
+
+    movu    m0, [r2]
+    movu    m1, [r2 + r3]
+    movu    m2, [r2 + 2 * r3]
+    movu    m3, [r2 + r5]
+    lea     r2, [r2 + 4 * r3]
+    movu    m4, [r2]
+    movu    m5, [r2 + r3]
+
+    movu    [r0], m0
+    movu    [r0 + r1], m1
+    movu    [r0 + 2 * r1], m2
+    movu    [r0 + r4], m3
+    lea     r0, [r0 + 4 * r1]
+    movu    [r0], m4
+    movu    [r0 + r1], m5
+
+    movu    m0, [r2 + 2 * r3]
+    movu    m1, [r2 + r5]
+
+    movu    [r0 + 2 * r1], m0
+    movu    [r0 + r4], m1
+    RET
+
 ;-----------------------------------------------------------------------------
 ; void blockcopy_pp_%1x%2(pixel *dest, intptr_t deststride, pixel *src, intptr_t srcstride)
 ;-----------------------------------------------------------------------------
diff -r b2b7072ddbf7 -r eaa9d7a7b977 source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Wed Sep 24 11:48:15 2014 +0530
+++ b/source/common/x86/blockcopy8.h	Wed Sep 24 15:42:15 2014 +0530
@@ -194,6 +194,8 @@
 void x265_blockcopy_ss_64x48_avx(int16_t *dest, intptr_t deststride, int16_t *src, intptr_t srcstride);
 void x265_blockcopy_ss_64x64_avx(int16_t *dest, intptr_t deststride, int16_t *src, intptr_t srcstride);
 
+void x265_blockcopy_pp_32x8_avx(pixel * a, intptr_t stridea, pixel * b, intptr_t strideb);
+
 #undef BLOCKCOPY_COMMON
 #undef BLOCKCOPY_SS_PP
 #undef BLOCKCOPY_SP


More information about the x265-devel mailing list