[x265] [PATCH] asm: assembly code for pixel_sad_16x4

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Tue Oct 29 10:38:12 CET 2013


# HG changeset patch
# User Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
# Date 1383039422 -19800
#      Tue Oct 29 15:07:02 2013 +0530
# Node ID 634d20a7ab402af2edc23a1c6ccb0323cee44c1a
# Parent  4c618e33c25f98597d529d4e6ec9fb899bdc1d41
asm: assembly code for pixel_sad_16x4

diff -r 4c618e33c25f -r 634d20a7ab40 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Oct 29 11:16:32 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Oct 29 15:07:02 2013 +0530
@@ -235,6 +235,7 @@
         //p.pixelavg_pp[LUMA_4x4]  = x265_pixel_avg_4x4_mmx2;
         //PIXEL_AVE(sse2);
 
+        p.sad[LUMA_16x4 ]  = x265_pixel_sad_16x4_sse2;
         p.sad[LUMA_16x32]  = x265_pixel_sad_16x32_sse2;
         p.sad[LUMA_16x64]  = x265_pixel_sad_16x64_sse2;
 
diff -r 4c618e33c25f -r 634d20a7ab40 source/common/x86/sad-a.asm
--- a/source/common/x86/sad-a.asm	Tue Oct 29 11:16:32 2013 +0530
+++ b/source/common/x86/sad-a.asm	Tue Oct 29 15:07:02 2013 +0530
@@ -319,6 +319,30 @@
     movd    eax, m0
     RET
 
+;-----------------------------------------------------------------------------
+; int pixel_sad_16x4( uint8_t *, intptr_t, uint8_t *, intptr_t )
+;-----------------------------------------------------------------------------
+cglobal pixel_sad_16x4, 4,4,3
+
+    movu    m0,  [r2]
+    movu    m1,  [r2 + r3]
+    psadbw  m0,  [r0]
+    psadbw  m1,  [r0 + r1]
+    paddd   m0,  m1
+    lea     r2,  [r2 + 2 * r3]
+    lea     r0,  [r0 + 2 * r1]
+    movu    m1,  [r2]
+    movu    m2,  [r2 + r3]
+    psadbw  m1,  [r0]
+    psadbw  m2,  [r0 + r1]
+    paddd   m1,  m2
+    paddd   m0,  m1
+
+    movhlps m1,  m0
+    paddd   m0,  m1
+    movd    eax, m0
+    RET
+
 %endmacro
 
 INIT_XMM sse2


More information about the x265-devel mailing list