[x265] [PATCH] asm: avx2 10bit code for convert_p2s[24xN],[48x64]
rajesh at multicorewareinc.com
rajesh at multicorewareinc.com
Fri Apr 17 07:50:12 CEST 2015
# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1429249760 -19800
# Fri Apr 17 11:19:20 2015 +0530
# Node ID d967fc6a12dcfb2984172d5fadb1f06148ab4eef
# Parent 925a29ed81a4697655d9716f93ff29b246a17756
asm: avx2 10bit code for convert_p2s[24xN],[48x64]
convert_p2s[24x32](20.90x), convert_p2s[48x64](18.89x)
diff -r 925a29ed81a4 -r d967fc6a12dc source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Thu Apr 16 14:18:03 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Fri Apr 17 11:19:20 2015 +0530
@@ -1239,6 +1239,8 @@
p.pu[LUMA_64x32].convert_p2s = x265_filterPixelToShort_64x32_avx2;
p.pu[LUMA_64x48].convert_p2s = x265_filterPixelToShort_64x48_avx2;
p.pu[LUMA_64x64].convert_p2s = x265_filterPixelToShort_64x64_avx2;
+ p.pu[LUMA_24x32].convert_p2s = x265_filterPixelToShort_24x32_avx2;
+ p.pu[LUMA_48x64].convert_p2s = x265_filterPixelToShort_48x64_avx2;
}
}
#else // if HIGH_BIT_DEPTH
diff -r 925a29ed81a4 -r d967fc6a12dc source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm Thu Apr 16 14:18:03 2015 +0530
+++ b/source/common/x86/ipfilter16.asm Fri Apr 17 11:19:20 2015 +0530
@@ -6476,6 +6476,71 @@
P2S_H_24xN 32
P2S_H_24xN 64
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
+;-----------------------------------------------------------------------------
+%macro P2S_H_24xN_avx2 1
+INIT_YMM avx2
+cglobal filterPixelToShort_24x%1, 3, 7, 3
+ add r1d, r1d
+ mov r3d, r3m
+ add r3d, r3d
+ lea r4, [r3 * 3]
+ lea r5, [r1 * 3]
+
+ ; load height
+ mov r6d, %1/4
+
+ ; load constant
+ mova m2, [pw_2000]
+
+.loop
+ movu m0, [r0]
+ movu m1, [r0 + 32]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+ movu [r2 + r3 * 0], m0
+ movu [r2 + r3 * 0 + 32], xm1
+
+ movu m0, [r0 + r1]
+ movu m1, [r0 + r1 + 32]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+ movu [r2 + r3 * 1], m0
+ movu [r2 + r3 * 1 + 32], xm1
+
+ movu m0, [r0 + r1 * 2]
+ movu m1, [r0 + r1 * 2 + 32]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+ movu [r2 + r3 * 2], m0
+ movu [r2 + r3 * 2 + 32], xm1
+
+ movu m0, [r0 + r5]
+ movu m1, [r0 + r5 + 32]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+ movu [r2 + r4], m0
+ movu [r2 + r4 + 32], xm1
+
+ lea r0, [r0 + r1 * 4]
+ lea r2, [r2 + r3 * 4]
+
+ dec r6d
+ jnz .loop
+ RET
+%endmacro
+P2S_H_24xN_avx2 32
+P2S_H_24xN_avx2 64
+
;-----------------------------------------------------------------------------
; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
;-----------------------------------------------------------------------------
@@ -6673,3 +6738,80 @@
dec r6d
jnz .loop
RET
+
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
+;-----------------------------------------------------------------------------
+INIT_YMM avx2
+cglobal filterPixelToShort_48x64, 3, 7, 4
+ add r1d, r1d
+ mov r3d, r3m
+ add r3d, r3d
+ lea r4, [r3 * 3]
+ lea r5, [r1 * 3]
+
+ ; load height
+ mov r6d, 16
+
+ ; load constant
+ mova m3, [pw_2000]
+
+.loop
+ movu m0, [r0]
+ movu m1, [r0 + 32]
+ movu m2, [r0 + 64]
+ psllw m0, 4
+ psubw m0, m3
+ psllw m1, 4
+ psubw m1, m3
+ psllw m2, 4
+ psubw m2, m3
+ movu [r2 + r3 * 0], m0
+ movu [r2 + r3 * 0 + 32], m1
+ movu [r2 + r3 * 0 + 64], m2
+
+ movu m0, [r0 + r1]
+ movu m1, [r0 + r1 + 32]
+ movu m2, [r0 + r1 + 64]
+ psllw m0, 4
+ psubw m0, m3
+ psllw m1, 4
+ psubw m1, m3
+ psllw m2, 4
+ psubw m2, m3
+ movu [r2 + r3 * 1], m0
+ movu [r2 + r3 * 1 + 32], m1
+ movu [r2 + r3 * 1 + 64], m2
+
+ movu m0, [r0 + r1 * 2]
+ movu m1, [r0 + r1 * 2 + 32]
+ movu m2, [r0 + r1 * 2 + 64]
+ psllw m0, 4
+ psubw m0, m3
+ psllw m1, 4
+ psubw m1, m3
+ psllw m2, 4
+ psubw m2, m3
+ movu [r2 + r3 * 2], m0
+ movu [r2 + r3 * 2 + 32], m1
+ movu [r2 + r3 * 2 + 64], m2
+
+ movu m0, [r0 + r5]
+ movu m1, [r0 + r5 + 32]
+ movu m2, [r0 + r5 + 64]
+ psllw m0, 4
+ psubw m0, m3
+ psllw m1, 4
+ psubw m1, m3
+ psllw m2, 4
+ psubw m2, m3
+ movu [r2 + r4], m0
+ movu [r2 + r4 + 32], m1
+ movu [r2 + r4 + 64], m2
+
+ lea r0, [r0 + r1 * 4]
+ lea r2, [r2 + r3 * 4]
+
+ dec r6d
+ jnz .loop
+ RET
diff -r 925a29ed81a4 -r d967fc6a12dc source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h Thu Apr 16 14:18:03 2015 +0530
+++ b/source/common/x86/ipfilter8.h Fri Apr 17 11:19:20 2015 +0530
@@ -329,6 +329,8 @@
void x265_filterPixelToShort_64x32_avx2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
void x265_filterPixelToShort_64x48_avx2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
void x265_filterPixelToShort_64x64_avx2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_24x32_avx2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_48x64_avx2(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
#define SETUP_CHROMA_P2S_FUNC_DEF(W, H, cpu) \
void x265_filterPixelToShort_ ## W ## x ## H ## cpu(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
More information about the x265-devel
mailing list