[x265] [PATCH Review Only] asm: assembly code for pixel_sad_8x32

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Tue Oct 29 15:35:25 CET 2013


# HG changeset patch
# User Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
# Date 1383057246 -19800
#      Tue Oct 29 20:04:06 2013 +0530
# Node ID b817edf597d9cb4ed3a4b5737da4a4c0049339f3
# Parent  235bbc4600b8592c968e2658a46533ee032b69fd
asm: assembly code for pixel_sad_8x32

diff -r 235bbc4600b8 -r b817edf597d9 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Oct 29 18:25:54 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Oct 29 20:04:06 2013 +0530
@@ -235,6 +235,8 @@
         //p.pixelavg_pp[LUMA_4x4]  = x265_pixel_avg_4x4_mmx2;
         //PIXEL_AVE(sse2);
 
+        p.sad[LUMA_8x32]  = x265_pixel_sad_8x32_sse2;
+
         p.sad[LUMA_16x32]  = x265_pixel_sad_16x32_sse2;
         p.sad[LUMA_16x64]  = x265_pixel_sad_16x64_sse2;
 
diff -r 235bbc4600b8 -r b817edf597d9 source/common/x86/sad-a.asm
--- a/source/common/x86/sad-a.asm	Tue Oct 29 18:25:54 2013 +0530
+++ b/source/common/x86/sad-a.asm	Tue Oct 29 20:04:06 2013 +0530
@@ -173,6 +173,29 @@
     lea     r0,  [r0 + r1]
 %endmacro
 
+%macro PROCESS_SAD_8x4 0
+    movq        m1, [r2]
+    movq        m2, [r2 + r3]
+    lea         r2, [r2 + 2 * r3]
+    movq        m3, [r0]
+    movq        m4, [r0 + r1]
+    lea         r0, [r0 + 2 * r1]
+    punpcklqdq  m1, m2
+    punpcklqdq  m3, m4
+    psadbw      m1, m3
+    paddd       m0, m1
+    movq        m1, [r2]
+    movq        m2, [r2 + r3]
+    lea         r2, [r2 + 2 * r3]
+    movq        m3, [r0]
+    movq        m4, [r0 + r1]
+    lea         r0, [r0 + 2 * r1]
+    punpcklqdq  m1, m2
+    punpcklqdq  m3, m4
+    psadbw      m1, m3
+    paddd       m0, m1
+%endmacro
+
 %macro SAD_W16 0
 ;-----------------------------------------------------------------------------
 ; int pixel_sad_16x16( uint8_t *, intptr_t, uint8_t *, intptr_t )
@@ -542,6 +565,44 @@
     movd    eax, m0
     RET
 
+;-----------------------------------------------------------------------------
+; int pixel_sad_8x32( uint8_t *, intptr_t, uint8_t *, intptr_t )
+;-----------------------------------------------------------------------------
+cglobal pixel_sad_8x32, 4,4,3
+    pxor  m0,  m0
+
+    PROCESS_SAD_8x4
+    PROCESS_SAD_8x4
+    PROCESS_SAD_8x4
+    PROCESS_SAD_8x4
+    PROCESS_SAD_8x4
+    PROCESS_SAD_8x4
+    PROCESS_SAD_8x4
+
+    movq        m1, [r2]
+    movq        m2, [r2 + r3]
+    lea         r2, [r2 + 2 * r3]
+    movq        m3, [r0]
+    movq        m4, [r0 + r1]
+    lea         r0, [r0 + 2 * r1]
+    punpcklqdq  m1, m2
+    punpcklqdq  m3, m4
+    psadbw      m1, m3
+    paddd       m0, m1
+    movq        m1, [r2]
+    movq        m2, [r2 + r3]
+    movq        m3, [r0]
+    movq        m4, [r0 + r1]
+    punpcklqdq  m1, m2
+    punpcklqdq  m3, m4
+    psadbw      m1, m3
+    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