[x265] [PATCH 1 of 6] asm: fix bug in generic version findPosLast_x64 and improve testbench on it

Min Chen chenm003 at 163.com
Wed Apr 22 15:31:55 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1429709433 -28800
# Node ID 50eac1eaefc8b4928393b2b9a69b4aee6ea2e04a
# Parent  c135c117ffb083a00d4353279ea669e8f3f7a8ee
asm: fix bug in generic version findPosLast_x64 and improve testbench on it
---
 source/common/x86/asm-primitives.cpp |    4 ++--
 source/common/x86/pixel-util8.asm    |    2 +-
 source/test/pixelharness.cpp         |    2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff -r c135c117ffb0 -r 50eac1eaefc8 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Apr 21 13:42:36 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp	Wed Apr 22 21:30:33 2015 +0800
@@ -801,7 +801,7 @@
 #endif
 
 #if X86_64
-    //p.findPosLast = x265_findPosLast_x64;
+    p.findPosLast = x265_findPosLast_x64;
 #endif
 
     if (cpuMask & X265_CPU_SSE2)
@@ -1277,7 +1277,7 @@
 void setupAssemblyPrimitives(EncoderPrimitives &p, int cpuMask) // 8bpp
 {
 #if X86_64
-    //p.findPosLast = x265_findPosLast_x64;
+    p.findPosLast = x265_findPosLast_x64;
 #endif
 
     if (cpuMask & X265_CPU_SSE2)
diff -r c135c117ffb0 -r 50eac1eaefc8 source/common/x86/pixel-util8.asm
--- a/source/common/x86/pixel-util8.asm	Tue Apr 21 13:42:36 2015 -0500
+++ b/source/common/x86/pixel-util8.asm	Wed Apr 22 21:30:33 2015 +0800
@@ -5712,7 +5712,7 @@
 
     ; get posLast
     shl         r11d, 4
-    sub         r11d, r6d
+    sub         r11d, t3d
     lea         eax, [r11d - 1]
     RET
 IACA_END
diff -r c135c117ffb0 -r 50eac1eaefc8 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Tue Apr 21 13:42:36 2015 -0500
+++ b/source/test/pixelharness.cpp	Wed Apr 22 21:30:33 2015 +0800
@@ -1211,6 +1211,8 @@
     for (int i = 0; i < 32 * 32; i++)
     {
         ref_src[i] = rand() & SHORT_MAX;
+        if (rand() & 1)
+            ref_src[i] *= -1;
         totalCoeffs += (ref_src[i] != 0);
     }
 



More information about the x265-devel mailing list