[x265] [PATCH] pixel_add_ps_12x16, asm code
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Thu Nov 21 12:57:15 CET 2013
# HG changeset patch
# User Praveen Tiwari
# Date 1385035026 -19800
# Node ID 907b99bb4a404f4d5dd1655751b47c226b574f53
# Parent 98421b5f515c79e757ab4cf2b73f6b2ed1b2424b
pixel_add_ps_12x16, asm code
diff -r 98421b5f515c -r 907b99bb4a40 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Thu Nov 21 15:35:18 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp Thu Nov 21 17:27:06 2013 +0530
@@ -645,6 +645,7 @@
p.chroma[X265_CSP_I420].add_ps[CHROMA_8x8] = x265_pixel_add_ps_8x8_sse4;
p.chroma[X265_CSP_I420].add_ps[CHROMA_8x16] = x265_pixel_add_ps_8x16_sse4;
p.chroma[X265_CSP_I420].add_ps[CHROMA_8x32] = x265_pixel_add_ps_8x32_sse4;
+ p.chroma[X265_CSP_I420].add_ps[CHROMA_12x16] = x265_pixel_add_ps_12x16_sse4;
p.chroma[X265_CSP_I420].add_ps[CHROMA_16x4] = x265_pixel_add_ps_16x4_sse4;
p.chroma[X265_CSP_I420].add_ps[CHROMA_16x8] = x265_pixel_add_ps_16x8_sse4;
p.chroma[X265_CSP_I420].add_ps[CHROMA_16x12] = x265_pixel_add_ps_16x12_sse4;
diff -r 98421b5f515c -r 907b99bb4a40 source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm Thu Nov 21 15:35:18 2013 +0530
+++ b/source/common/x86/pixeladd8.asm Thu Nov 21 17:27:06 2013 +0530
@@ -511,6 +511,95 @@
PIXEL_ADD_PS_W16_H4 16, 32
+
+;-----------------------------------------------------------------------------
+; void pixel_add_ps_%1x%2(pixel *dest, intptr_t destride, pixel *src0, int16_t *scr1, intptr_t srcStride0, intptr_t srcStride1)
+;-----------------------------------------------------------------------------
+%macro PIXEL_ADD_PS_W12_H4 2
+INIT_XMM sse4
+cglobal pixel_add_ps_%1x%2, 6, 7, 4, dest, destride, src0, scr1, srcStride0, srcStride1
+
+add r5, r5
+
+mov r6d, %2/4
+
+.loop
+ pmovzxbw m0, [r2]
+ pmovzxbw m1, [r2 + 8]
+
+ movu m2, [r3]
+ movh m3, [r3 + 16]
+
+ paddw m0, m2
+ paddw m1, m3
+
+ packuswb m0, m1
+
+ movh [r0], m0
+ pshufd m0, m0, 2
+ movd [r0 + 8], m0
+
+ pmovzxbw m0, [r2 + r4]
+ pmovzxbw m1, [r2 + r4 + 8]
+
+ movu m2, [r3 + r5]
+ movh m3, [r3 + r5 + 16]
+
+ paddw m0, m2
+ paddw m1, m3
+
+ packuswb m0, m1
+
+ movh [r0 + r1], m0
+ pshufd m0, m0, 2
+ movd [r0 + r1 + 8], m0
+
+ pmovzxbw m0, [r2 + 2 * r4]
+ pmovzxbw m1, [r2 + 2 * r4 + 8]
+
+ movu m2, [r3 + 2 * r5]
+ movh m3, [r3 + 2 * r5 + 16]
+
+ paddw m0, m2
+ paddw m1, m3
+
+ packuswb m0, m1
+
+ movh [r0 + 2 * r1], m0
+ pshufd m0, m0, 2
+ movd [r0 + 2 * r1 + 8], m0
+
+ lea r0, [r0 + 2 * r1]
+ lea r2, [r2 + 2 * r4]
+ lea r3, [r3 + 2 * r5]
+
+ pmovzxbw m0, [r2 + r4]
+ pmovzxbw m1, [r2 + r4 + 8]
+
+ movu m2, [r3 + r5]
+ movh m3, [r3 + r5 + 16]
+
+ paddw m0, m2
+ paddw m1, m3
+
+ packuswb m0, m1
+
+ movh [r0 + r1], m0
+ pshufd m0, m0, 2
+ movd [r0 + r1 + 8], m0
+
+ lea r0, [r0 + 2 * r1]
+ lea r2, [r2 + 2 * r4]
+ lea r3, [r3 + 2 * r5]
+
+ dec r6d
+ jnz .loop
+
+RET
+%endmacro
+
+PIXEL_ADD_PS_W12_H4 12, 16
+
;-----------------------------------------------------------------------------
; void pixel_add_ps_%1x%2(pixel *dest, intptr_t destride, pixel *src0, int16_t *scr1, intptr_t srcStride0, intptr_t srcStride1)
;-----------------------------------------------------------------------------
More information about the x265-devel
mailing list