[x265] [PATCH] correct macro to find first bit set position from LSB to MSB

mahesh at multicorewareinc.com mahesh at multicorewareinc.com
Thu May 26 13:20:54 CEST 2016


# HG changeset patch
# User Mahesh Pittala <mahesh at multicorewareinc.com>
# Date 1464261309 -19800
#      Thu May 26 16:45:09 2016 +0530
# Node ID 79c3022a0d6756ed8174069e4339bbe469375dc7
# Parent  4723933fdec920debefe606d50a9a312f7bc7f6b
correct macro to find first bit set position from LSB to MSB

diff -r 4723933fdec9 -r 79c3022a0d67 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Fri May 13 09:32:11 2016 +0530
+++ b/source/encoder/slicetype.cpp	Thu May 26 16:45:09 2016 +0530
@@ -459,7 +459,7 @@
     if (mindenom > 0 && !(minscale & 1))
     {
         unsigned long idx;
-        CLZ(idx, minscale);
+        CTZ(idx, minscale);
         int shift = X265_MIN((int)idx, mindenom);
         mindenom -= shift;
         minscale >>= shift;
diff -r 4723933fdec9 -r 79c3022a0d67 source/encoder/weightPrediction.cpp
--- a/source/encoder/weightPrediction.cpp	Fri May 13 09:32:11 2016 +0530
+++ b/source/encoder/weightPrediction.cpp	Thu May 26 16:45:09 2016 +0530
@@ -460,7 +460,7 @@
                 if (mindenom > 0 && !(minscale & 1))
                 {
                     unsigned long idx;
-                    CLZ(idx, minscale);
+                    CTZ(idx, minscale);
                     int shift = X265_MIN((int)idx, mindenom);
                     mindenom -= shift;
                     minscale >>= shift;


More information about the x265-devel mailing list