[x265] [PATCH] asm: code for pixel_sse_sp_4xN

murugan at multicorewareinc.com murugan at multicorewareinc.com
Thu Nov 28 10:27:27 CET 2013


# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1385630830 -19800
#      Thu Nov 28 14:57:10 2013 +0530
# Node ID a0fbadcf1f913211e0d0915778e6c8bf462da754
# Parent  949f85337789c8d00f39ed1a010990efe67ebcf4
asm: code for pixel_sse_sp_4xN

diff -r 949f85337789 -r a0fbadcf1f91 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Nov 27 18:10:14 2013 -0600
+++ b/source/common/x86/asm-primitives.cpp	Thu Nov 28 14:57:10 2013 +0530
@@ -648,6 +648,9 @@
         p.sse_pp[LUMA_64x48] = x265_pixel_ssd_64x48_sse4;
         p.sse_pp[LUMA_64x64] = x265_pixel_ssd_64x64_sse4;
 
+        p.sse_sp[LUMA_4x4] = x265_pixel_ssd_sp_4x4_sse4;
+        p.sse_sp[LUMA_4x8] = x265_pixel_ssd_sp_4x8_sse4;
+        p.sse_sp[LUMA_4x16] = x265_pixel_ssd_sp_4x16_sse4;
         p.sse_sp[LUMA_8x4] = x265_pixel_ssd_sp_8x4_sse4;
         p.sse_sp[LUMA_8x8] = x265_pixel_ssd_sp_8x8_sse4;
         p.sse_sp[LUMA_8x16] = x265_pixel_ssd_sp_8x16_sse4;
diff -r 949f85337789 -r a0fbadcf1f91 source/common/x86/pixel-a.asm
--- a/source/common/x86/pixel-a.asm	Wed Nov 27 18:10:14 2013 -0600
+++ b/source/common/x86/pixel-a.asm	Thu Nov 28 14:57:10 2013 +0530
@@ -1400,6 +1400,81 @@
 ; int pixel_ssd_sp ( int16_t *, intptr_t, uint8_t *, intptr_t )
 ;-----------------------------------------------------------------------------
 
+cglobal pixel_ssd_sp_4x4_internal
+    movh          m0,    [r0]
+    movh          m1,    [r0 + r1]
+    punpcklqdq    m0,    m1
+    movd          m2,    [r2]
+    movd          m3,    [r2 + r3]
+    punpckldq     m2,    m3
+    pmovzxbw      m2,    m2
+    psubw         m0,    m2
+    movh          m4,    [r0 + 2 * r1]
+    movh          m5,    [r0 + r4]
+    punpcklqdq    m4,    m5
+    movd          m6,    [r2 + 2 * r3]
+    lea           r2,    [r2 + 2 * r3]
+    movd          m1,    [r2 + r3]
+    punpckldq     m6,    m1
+    pmovzxbw      m6,    m6
+    psubw         m4,    m6
+    pmaddwd       m0,    m0
+    pmaddwd       m4,    m4
+    paddd         m0,    m4
+    paddd         m7,    m0
+    ret
+
+;-----------------------------------------------------------------------------
+; int pixel_ssd_sp_4x4( int16_t *, intptr_t, uint8_t *, intptr_t )
+;-----------------------------------------------------------------------------
+INIT_XMM sse4
+cglobal pixel_ssd_sp_4x4, 4, 6, 8, src1, stride1, src2, stride2
+    pxor     m7,     m7
+    add      r1,     r1
+    lea      r4,     [r1 * 3]
+    call     pixel_ssd_sp_4x4_internal
+    HADDD    m7,     m1
+    movd     eax,    m7
+    RET
+
+;-----------------------------------------------------------------------------
+; int pixel_ssd_sp_4x8( int16_t *, intptr_t, uint8_t *, intptr_t )
+;-----------------------------------------------------------------------------
+INIT_XMM sse4
+cglobal pixel_ssd_sp_4x8, 4, 6, 8, src1, stride1, src2, stride2
+    pxor     m7,     m7
+    add      r1,     r1
+    lea      r4,     [r1 * 3]
+    call     pixel_ssd_sp_4x4_internal
+    lea      r0,     [r0 + 4 * r1]
+    lea      r2,     [r2 + 2 * r3]
+    call     pixel_ssd_sp_4x4_internal
+    HADDD    m7,     m1
+    movd     eax,    m7
+    RET
+
+;-----------------------------------------------------------------------------
+; int pixel_ssd_sp_4x16( int16_t *, intptr_t, uint8_t *, intptr_t )
+;-----------------------------------------------------------------------------
+INIT_XMM sse4
+cglobal pixel_ssd_sp_4x16, 4, 6, 8, src1, stride1, src2, stride2
+    pxor     m7,     m7
+    add      r1,     r1
+    lea      r4,     [r1 * 3]
+    call     pixel_ssd_sp_4x4_internal
+    lea      r0,     [r0 + 4 * r1]
+    lea      r2,     [r2 + 2 * r3]
+    call     pixel_ssd_sp_4x4_internal
+    lea      r0,     [r0 + 4 * r1]
+    lea      r2,     [r2 + 2 * r3]
+    call     pixel_ssd_sp_4x4_internal
+    lea      r0,     [r0 + 4 * r1]
+    lea      r2,     [r2 + 2 * r3]
+    call     pixel_ssd_sp_4x4_internal
+    HADDD    m7,     m1
+    movd     eax,    m7
+    RET
+
 cglobal pixel_ssd_sp_8x4_internal
     movu         m0,    [r0]
     movu         m1,    [r0 + r1]
diff -r 949f85337789 -r a0fbadcf1f91 source/common/x86/pixel.h
--- a/source/common/x86/pixel.h	Wed Nov 27 18:10:14 2013 -0600
+++ b/source/common/x86/pixel.h	Thu Nov 28 14:57:10 2013 +0530
@@ -402,6 +402,9 @@
 void x265_weight_pp_sse4(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
 void x265_weight_sp_sse4(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
 
+int x265_pixel_ssd_sp_4x4_sse4(int16_t *, intptr_t, pixel *, intptr_t);
+int x265_pixel_ssd_sp_4x8_sse4(int16_t *, intptr_t, pixel *, intptr_t);
+int x265_pixel_ssd_sp_4x16_sse4(int16_t *, intptr_t, pixel *, intptr_t);
 int x265_pixel_ssd_sp_8x4_sse4(int16_t *, intptr_t, pixel *, intptr_t);
 int x265_pixel_ssd_sp_8x8_sse4(int16_t *, intptr_t, pixel *, intptr_t);
 int x265_pixel_ssd_sp_8x16_sse4(int16_t *, intptr_t, pixel *, intptr_t);


More information about the x265-devel mailing list