[x265] [PATCH] asm: ssse3 8bpp code for convert_p2s[32xN],[64xN]
rajesh at multicorewareinc.com
rajesh at multicorewareinc.com
Fri Apr 3 15:49:25 CEST 2015
# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1428066701 -19800
# Fri Apr 03 18:41:41 2015 +0530
# Node ID 85239da2fecf1753a28f8dbce02da60bce56bb57
# Parent 099c32a3f43d46a7bfde80c5db02d7b55434694c
asm: ssse3 8bpp code for convert_p2s[32xN],[64xN]
convert_p2s[32x8](10.45x), convert_p2s[32x16](10.22x),
convert_p2s[32x24](10.98x), convert_p2s[32x32](10.17x),
convert_p2s[32x64](12.31x), convert_p2s[64x16](10.29x),
convert_p2s[64x32](10.17x), convert_p2s[64x48](10.05x),
convert_p2s[64x64](10.04x)
diff -r 099c32a3f43d -r 85239da2fecf source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Fri Apr 03 18:38:23 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Fri Apr 03 18:41:41 2015 +0530
@@ -1290,6 +1290,15 @@
p.pu[LUMA_16x16].convert_p2s = x265_filterPixelToShort_16x16_ssse3;
p.pu[LUMA_16x32].convert_p2s = x265_filterPixelToShort_16x32_ssse3;
p.pu[LUMA_16x64].convert_p2s = x265_filterPixelToShort_16x64_ssse3;
+ p.pu[LUMA_32x8].convert_p2s = x265_filterPixelToShort_32x8_ssse3;
+ p.pu[LUMA_32x16].convert_p2s = x265_filterPixelToShort_32x16_ssse3;
+ p.pu[LUMA_32x24].convert_p2s = x265_filterPixelToShort_32x24_ssse3;
+ p.pu[LUMA_32x32].convert_p2s = x265_filterPixelToShort_32x32_ssse3;
+ p.pu[LUMA_32x64].convert_p2s = x265_filterPixelToShort_32x64_ssse3;
+ p.pu[LUMA_64x16].convert_p2s = x265_filterPixelToShort_64x16_ssse3;
+ p.pu[LUMA_64x32].convert_p2s = x265_filterPixelToShort_64x32_ssse3;
+ p.pu[LUMA_64x48].convert_p2s = x265_filterPixelToShort_64x48_ssse3;
+ p.pu[LUMA_64x64].convert_p2s = x265_filterPixelToShort_64x64_ssse3;
}
if (cpuMask & X265_CPU_SSE4)
{
diff -r 099c32a3f43d -r 85239da2fecf source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Fri Apr 03 18:38:23 2015 +0530
+++ b/source/common/x86/ipfilter8.asm Fri Apr 03 18:41:41 2015 +0530
@@ -7913,6 +7913,341 @@
P2S_H_16xN 32
P2S_H_16xN 64
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int16_t dstStride)
+;-----------------------------------------------------------------------------
+%macro P2S_H_32xN 1
+INIT_XMM ssse3
+cglobal filterPixelToShort_32x%1, 3, 7, 6
+ mov r3d, r3m
+ add r3d, r3d
+ lea r4, [r3 * 3]
+ lea r5, [r1 * 3]
+
+ ; load height
+ mov r6d, %1/4
+
+ ; load constant
+ mova m4, [pb_128]
+ mova m5, [tab_c_64_n64]
+
+.loop:
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0], m0
+ movu [r2 + r3 * 1], m1
+ movu [r2 + r3 * 2], m2
+ movu [r2 + r4], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 16], m0
+ movu [r2 + r3 * 1 + 16], m1
+ movu [r2 + r3 * 2 + 16], m2
+ movu [r2 + r4 + 16], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 32], m0
+ movu [r2 + r3 * 1 + 32], m1
+ movu [r2 + r3 * 2 + 32], m2
+ movu [r2 + r4 + 32], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 48], m0
+ movu [r2 + r3 * 1 + 48], m1
+ movu [r2 + r3 * 2 + 48], m2
+ movu [r2 + r4 + 48], m3
+
+ lea r0, [r0 + r1 * 4 - 24]
+ lea r2, [r2 + r3 * 4]
+
+ dec r6d
+ jnz .loop
+ RET
+%endmacro
+P2S_H_32xN 32
+P2S_H_32xN 8
+P2S_H_32xN 16
+P2S_H_32xN 24
+P2S_H_32xN 64
+
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int16_t dstStride)
+;-----------------------------------------------------------------------------
+%macro P2S_H_64xN 1
+INIT_XMM ssse3
+cglobal filterPixelToShort_64x%1, 3, 7, 6
+ mov r3d, r3m
+ add r3d, r3d
+ lea r4, [r3 * 3]
+ lea r5, [r1 * 3]
+
+ ; load height
+ mov r6d, %1/4
+
+ ; load constant
+ mova m4, [pb_128]
+ mova m5, [tab_c_64_n64]
+
+.loop:
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0], m0
+ movu [r2 + r3 * 1], m1
+ movu [r2 + r3 * 2], m2
+ movu [r2 + r4], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 16], m0
+ movu [r2 + r3 * 1 + 16], m1
+ movu [r2 + r3 * 2 + 16], m2
+ movu [r2 + r4 + 16], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 32], m0
+ movu [r2 + r3 * 1 + 32], m1
+ movu [r2 + r3 * 2 + 32], m2
+ movu [r2 + r4 + 32], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 48], m0
+ movu [r2 + r3 * 1 + 48], m1
+ movu [r2 + r3 * 2 + 48], m2
+ movu [r2 + r4 + 48], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 64], m0
+ movu [r2 + r3 * 1 + 64], m1
+ movu [r2 + r3 * 2 + 64], m2
+ movu [r2 + r4 + 64], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 80], m0
+ movu [r2 + r3 * 1 + 80], m1
+ movu [r2 + r3 * 2 + 80], m2
+ movu [r2 + r4 + 80], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 96], m0
+ movu [r2 + r3 * 1 + 96], m1
+ movu [r2 + r3 * 2 + 96], m2
+ movu [r2 + r4 + 96], m3
+
+ lea r0, [r0 + 8]
+
+ movh m0, [r0]
+ punpcklbw m0, m4
+ pmaddubsw m0, m5
+
+ movh m1, [r0 + r1]
+ punpcklbw m1, m4
+ pmaddubsw m1, m5
+
+ movh m2, [r0 + r1 * 2]
+ punpcklbw m2, m4
+ pmaddubsw m2, m5
+
+ movh m3, [r0 + r5]
+ punpcklbw m3, m4
+ pmaddubsw m3, m5
+
+ movu [r2 + r3 * 0 + 112], m0
+ movu [r2 + r3 * 1 + 112], m1
+ movu [r2 + r3 * 2 + 112], m2
+ movu [r2 + r4 + 112], m3
+
+ lea r0, [r0 + r1 * 4 - 56]
+ lea r2, [r2 + r3 * 4]
+
+ dec r6d
+ jnz .loop
+ RET
+%endmacro
+P2S_H_64xN 64
+P2S_H_64xN 16
+P2S_H_64xN 32
+P2S_H_64xN 48
+
%macro PROCESS_LUMA_W4_4R 0
movd m0, [r0]
movd m1, [r0 + r1]
diff -r 099c32a3f43d -r 85239da2fecf source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h Fri Apr 03 18:38:23 2015 +0530
+++ b/source/common/x86/ipfilter8.h Fri Apr 03 18:41:41 2015 +0530
@@ -634,6 +634,15 @@
void x265_filterPixelToShort_16x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
void x265_filterPixelToShort_16x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
void x265_filterPixelToShort_16x64_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_32x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_32x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_32x24_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_32x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_32x64_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_64x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_64x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_64x48_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_64x64_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
#undef LUMA_FILTERS
#undef LUMA_SP_FILTERS
#undef LUMA_SS_FILTERS
More information about the x265-devel
mailing list