[x265] [PATCH] asm: ssse3 10bit code for convert_p2s[16xN]
rajesh at multicorewareinc.com
rajesh at multicorewareinc.com
Tue Apr 14 16:00:07 CEST 2015
# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1429017602 -19800
# Tue Apr 14 18:50:02 2015 +0530
# Node ID bd2972af8c4f1712936a477c76640ac0581e6ded
# Parent ff6353a2def10c00f3d9d1ff76f0682dcc9b450e
asm: ssse3 10bit code for convert_p2s[16xN]
convert_p2s[16x4](8.18x), convert_p2s[16x8](10.59x),
convert_p2s[16x12](11.01x), convert_p2s[16x16](11.00x),
convert_p2s[16x32](11.59x), convert_p2s[16x64](11.68x)
diff -r ff6353a2def1 -r bd2972af8c4f source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Tue Apr 14 18:28:02 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Tue Apr 14 18:50:02 2015 +0530
@@ -956,6 +956,12 @@
p.pu[LUMA_8x8].convert_p2s = x265_filterPixelToShort_8x8_ssse3;
p.pu[LUMA_8x16].convert_p2s = x265_filterPixelToShort_8x16_ssse3;
p.pu[LUMA_8x32].convert_p2s = x265_filterPixelToShort_8x32_ssse3;
+ p.pu[LUMA_16x4].convert_p2s = x265_filterPixelToShort_16x4_ssse3;
+ p.pu[LUMA_16x8].convert_p2s = x265_filterPixelToShort_16x8_ssse3;
+ p.pu[LUMA_16x12].convert_p2s = x265_filterPixelToShort_16x12_ssse3;
+ 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;
}
if (cpuMask & X265_CPU_SSE4)
{
diff -r ff6353a2def1 -r bd2972af8c4f source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm Tue Apr 14 18:28:02 2015 +0530
+++ b/source/common/x86/ipfilter16.asm Tue Apr 14 18:50:02 2015 +0530
@@ -5618,3 +5618,77 @@
P2S_H_8xN 32
P2S_H_8xN 12
P2S_H_8xN 64
+
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
+;-----------------------------------------------------------------------------
+%macro P2S_H_16xN 1
+INIT_XMM ssse3
+cglobal filterPixelToShort_16x%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 + r1]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+
+ movu [r2 + r3 * 0], m0
+ movu [r2 + r3 * 1], m1
+
+ movu m0, [r0 + r1 * 2]
+ movu m1, [r0 + r5]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+
+ movu [r2 + r3 * 2], m0
+ movu [r2 + r4], m1
+
+ movu m0, [r0 + 16]
+ movu m1, [r0 + r1 + 16]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+
+ movu [r2 + r3 * 0 + 16], m0
+ movu [r2 + r3 * 1 + 16], m1
+
+ movu m0, [r0 + r1 * 2 + 16]
+ movu m1, [r0 + r5 + 16]
+ psllw m0, 4
+ psubw m0, m2
+ psllw m1, 4
+ psubw m1, m2
+
+ movu [r2 + r3 * 2 + 16], m0
+ movu [r2 + r4 + 16], m1
+
+ lea r0, [r0 + r1 * 4]
+ lea r2, [r2 + r3 * 4]
+
+ dec r6d
+ jnz .loop
+ RET
+%endmacro
+P2S_H_16xN 16
+P2S_H_16xN 4
+P2S_H_16xN 8
+P2S_H_16xN 12
+P2S_H_16xN 32
+P2S_H_16xN 64
+P2S_H_16xN 24
diff -r ff6353a2def1 -r bd2972af8c4f source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h Tue Apr 14 18:28:02 2015 +0530
+++ b/source/common/x86/ipfilter8.h Tue Apr 14 18:50:02 2015 +0530
@@ -296,6 +296,12 @@
void x265_filterPixelToShort_8x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
void x265_filterPixelToShort_8x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
void x265_filterPixelToShort_8x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_16x4_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_16x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_16x12_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+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);
CHROMA_420_VERT_FILTERS(_sse2);
CHROMA_420_HORIZ_FILTERS(_sse4);
More information about the x265-devel
mailing list