[x265] [PATCH] asm: 10bpp code for pixel_sub_24x32
murugan at multicorewareinc.com
murugan at multicorewareinc.com
Fri Dec 6 08:31:06 CET 2013
# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1386314852 -19800
# Fri Dec 06 12:57:32 2013 +0530
# Node ID 5feafa073b2990c5e8a2945dd923bbfa058cad6f
# Parent e638bc57a626d23a4276dba81023469f35d396c5
asm: 10bpp code for pixel_sub_24x32
diff -r e638bc57a626 -r 5feafa073b29 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Fri Dec 06 11:52:41 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp Fri Dec 06 12:57:32 2013 +0530
@@ -651,6 +651,7 @@
p.chroma[X265_CSP_I420].sub_ps[LUMA_32x24] = x265_pixel_sub_ps_16x12_sse2;
p.chroma[X265_CSP_I420].sub_ps[LUMA_32x32] = x265_pixel_sub_ps_16x16_sse2;
p.chroma[X265_CSP_I420].sub_ps[LUMA_32x64] = x265_pixel_sub_ps_16x32_sse2;
+ p.chroma[X265_CSP_I420].sub_ps[LUMA_48x64] = x265_pixel_sub_ps_24x32_sse2;
p.luma_sub_ps[LUMA_16x64] = x265_pixel_sub_ps_16x64_sse2;
}
if (cpuMask & X265_CPU_SSSE3)
diff -r e638bc57a626 -r 5feafa073b29 source/common/x86/pixel-util8.asm
--- a/source/common/x86/pixel-util8.asm Fri Dec 06 11:52:41 2013 +0530
+++ b/source/common/x86/pixel-util8.asm Fri Dec 06 12:57:32 2013 +0530
@@ -3067,15 +3067,46 @@
; void pixel_sub_ps_c_%1x%2(int16_t *dest, intptr_t destride, pixel *src0, pixel *src1, intptr_t srcstride0, intptr_t srcstride1);
;-----------------------------------------------------------------------------
%macro PIXELSUB_PS_W24_H2 2
-INIT_XMM sse4
+%if HIGH_BIT_DEPTH
+cglobal pixel_sub_ps_%1x%2, 6, 7, 6, dest, deststride, src0, src1, srcstride0, srcstride1
+ add r1, r1
+ mov r6d, %2/2
+ add r4, r4
+ add r5, r5
+.loop
+ movu m0, [r2]
+ movu m1, [r3]
+ movu m2, [r2 + 16]
+ movu m3, [r3 + 16]
+ movu m4, [r2 + 32]
+ movu m5, [r3 + 32]
+ psubw m0, m1
+ psubw m2, m3
+ psubw m4, m5
+
+ movu [r0], m0
+ movu [r0 + 16], m2
+ movu [r0 + 32], m4
+
+ movu m0, [r2 + r4]
+ movu m1, [r3 + r5]
+ movu m2, [r2 + r4 + 16]
+ movu m3, [r3 + r5 + 16]
+ movu m4, [r2 + r4 + 32]
+ movu m5, [r3 + r5 + 32]
+ psubw m0, m1
+ psubw m2, m3
+ psubw m4, m5
+
+ movu [r0 + r1], m0
+ movu [r0 + r1 + 16], m2
+ movu [r0 + r1 + 32], m4
+%else
cglobal pixel_sub_ps_%1x%2, 6, 7, 7, dest, deststride, src0, src1, srcstride0, srcstride1
-
-add r1, r1
-mov r6d, %2/2
-pxor m6, m6
-
+ add r1, r1
+ mov r6d, %2/2
+ pxor m6, m6
.loop
-
movu m1, [r2]
pmovzxbw m0, m1
punpckhbw m1, m6
@@ -3086,7 +3117,6 @@
punpckhbw m4, m6
movh m5, [r3 + 16]
pmovzxbw m5, m5
-
psubw m0, m3
psubw m1, m4
psubw m2, m5
@@ -3105,7 +3135,6 @@
punpckhbw m4, m6
movh m5, [r3 + r5 + 16]
pmovzxbw m5, m5
-
psubw m0, m3
psubw m1, m4
psubw m2, m5
@@ -3113,19 +3142,24 @@
movu [r0 + r1], m0
movu [r0 + r1 + 16], m1
movu [r0 + r1 + 32], m2
-
+%endif
+
+ dec r6d
lea r2, [r2 + 2 * r4]
lea r3, [r3 + 2 * r5]
lea r0, [r0 + 2 * r1]
-
- dec r6d
-
-jnz .loop
+ jnz .loop
RET
%endmacro
+%if HIGH_BIT_DEPTH
+INIT_XMM sse2
PIXELSUB_PS_W24_H2 24, 32
+%else
+INIT_XMM sse4
+PIXELSUB_PS_W24_H2 24, 32
+%endif
;-----------------------------------------------------------------------------
; void pixel_sub_ps_c_%1x%2(int16_t *dest, intptr_t destride, pixel *src0, pixel *src1, intptr_t srcstride0, intptr_t srcstride1);
More information about the x265-devel
mailing list