[x265] [PATCH] blockcopy_pp_32x24: avx asm code, improved 621.84 cycles -> 371.94
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Wed Sep 24 14:21:11 CEST 2014
# HG changeset patch
# User Praveen Tiwari
# Date 1411561248 -19800
# Node ID 3be9356430b60c282641010747c396d5188189f1
# Parent 6567162bf00cfc2ac764e51f98d76bfcf3de5c5a
blockcopy_pp_32x24: avx asm code, improved 621.84 cycles -> 371.94
diff -r 6567162bf00c -r 3be9356430b6 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Wed Sep 24 17:05:42 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp Wed Sep 24 17:50:48 2014 +0530
@@ -1721,6 +1721,9 @@
p.chroma[X265_CSP_I420].copy_pp[CHROMA_32x16] = x265_blockcopy_pp_32x16_avx;
p.chroma[X265_CSP_I422].copy_pp[CHROMA422_32x16] = x265_blockcopy_pp_32x16_avx;
p.luma_copy_pp[LUMA_32x16] = x265_blockcopy_pp_32x16_avx;
+
+ p.chroma[X265_CSP_I420].copy_pp[CHROMA_32x24] = x265_blockcopy_pp_32x24_avx;
+ p.luma_copy_pp[LUMA_32x24] = x265_blockcopy_pp_32x24_avx;
}
if (cpuMask & X265_CPU_XOP)
{
diff -r 6567162bf00c -r 3be9356430b6 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm Wed Sep 24 17:05:42 2014 +0530
+++ b/source/common/x86/blockcopy8.asm Wed Sep 24 17:50:48 2014 +0530
@@ -683,6 +683,43 @@
movu [r0 + r4], m3
RET
+;-----------------------------------------------------------------------------
+; void blockcopy_pp_32x24(pixel *dest, intptr_t deststride, pixel *src, intptr_t srcstride)
+;-----------------------------------------------------------------------------
+INIT_YMM avx
+cglobal blockcopy_pp_32x24, 4, 7, 6
+lea r4, [3 * r1]
+lea r5, [3 * r3]
+mov r6d, 24/8
+
+.loop:
+ 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
+
+ lea r2, [r2 + 4 * r3]
+ lea r0, [r0 + 4 * r1]
+ dec r6d
+ jnz .loop
+ RET
;-----------------------------------------------------------------------------
; void blockcopy_pp_%1x%2(pixel *dest, intptr_t deststride, pixel *src, intptr_t srcstride)
diff -r 6567162bf00c -r 3be9356430b6 source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h Wed Sep 24 17:05:42 2014 +0530
+++ b/source/common/x86/blockcopy8.h Wed Sep 24 17:50:48 2014 +0530
@@ -196,6 +196,7 @@
void x265_blockcopy_pp_32x8_avx(pixel * a, intptr_t stridea, pixel * b, intptr_t strideb);
void x265_blockcopy_pp_32x16_avx(pixel * a, intptr_t stridea, pixel * b, intptr_t strideb);
+void x265_blockcopy_pp_32x24_avx(pixel * a, intptr_t stridea, pixel * b, intptr_t strideb);
#undef BLOCKCOPY_COMMON
#undef BLOCKCOPY_SS_PP
More information about the x265-devel
mailing list