[x265] [PATCH] asm code for pixel_add_ps_4x2

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 20 14:00:56 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384952448 -19800
# Node ID 797ea2ae16acfa480319e04a2660f1151952c118
# Parent  77d97d720b654dd16de291df56aea33810960776
asm code for pixel_add_ps_4x2

diff -r 77d97d720b65 -r 797ea2ae16ac source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Nov 20 18:21:43 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Nov 20 18:30:48 2013 +0530
@@ -639,6 +639,7 @@
         // until all partitions are coded and commit smaller patches, easier to
         // review.
 
+        p.chroma_add_ps[X265_CSP_I420][CHROMA_4x2] = x265_pixel_add_ps_4x2_sse4;
         p.chroma_add_ps[X265_CSP_I420][CHROMA_4x4] = x265_pixel_add_ps_4x4_sse4;
         p.chroma_add_ps[X265_CSP_I420][CHROMA_4x8] = x265_pixel_add_ps_4x8_sse4;
         p.chroma_add_ps[X265_CSP_I420][CHROMA_4x16] = x265_pixel_add_ps_4x16_sse4;
diff -r 77d97d720b65 -r 797ea2ae16ac source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Wed Nov 20 18:21:43 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Wed Nov 20 18:30:48 2013 +0530
@@ -28,6 +28,33 @@
 
 SECTION .text
 
+
+;-----------------------------------------------------------------------------
+; void pixel_add_ps_4x2(pixel *dest, intptr_t destride, pixel *src0, int16_t *scr1, intptr_t srcStride0, intptr_t srcStride1)
+;-----------------------------------------------------------------------------
+INIT_XMM sse4
+cglobal pixel_add_ps_4x2, 6, 6, 2, dest, destride, src0, scr1, srcStride0, srcStride1
+
+add         r5,            r5
+
+pmovzxbw    m0,            [r2]
+movh        m1,            [r3]
+
+paddw       m0,            m1
+packuswb    m0,            m0
+
+movd        [r0],          m0
+
+pmovzxbw    m0,            [r2 + r4]
+movh        m1,            [r3 + r5]
+
+paddw       m0,            m1
+packuswb    m0,            m0
+
+movd        [r0 + r1],     m0
+
+RET
+
 ;-----------------------------------------------------------------------------
 ; void pixel_add_ps_4x4(pixel *dest, int destride, pixel *src0, int16_t *scr1, int srcStride0, int srcStride1)
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list