[x265] [PATCH 5 of 5] reduce shift operators in cost on coeffRemain

Min Chen chenm003 at 163.com
Tue May 12 01:42:27 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1431386751 25200
# Node ID c28a1ccbfa51d56181618786c6b6a6dc50393117
# Parent  a58a6e5bb3c6c4f2541d0dbd77bd35d6f40c2eb7
reduce shift operators in cost on coeffRemain
---
 source/encoder/entropy.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff -r a58a6e5bb3c6 -r c28a1ccbfa51 source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Mon May 11 16:25:48 2015 -0700
+++ b/source/encoder/entropy.cpp	Mon May 11 16:25:51 2015 -0700
@@ -1811,6 +1811,7 @@
 
                 if (!m_bitIf)
                 {
+                    uint32_t sum = 0;
                     // FastRd path
                     idx = 0;
                     do
@@ -1837,7 +1838,7 @@
 
                                 codeNumber = (length + length);
                             }
-                            m_fracBits += (COEF_REMAIN_BIN_REDUCTION + 1 + goRiceParam + codeNumber) << 15;
+                            sum += (COEF_REMAIN_BIN_REDUCTION + 1 + goRiceParam + codeNumber);
 
                             if (absCoeff[idx] > (COEF_REMAIN_BIN_REDUCTION << goRiceParam))
                                 goRiceParam = (goRiceParam + 1) - (goRiceParam >> 2);
@@ -1848,6 +1849,7 @@
                         idx++;
                     }
                     while(idx < numNonZero);
+                    m_fracBits += ((uint64_t)sum << 15);
                 }
                 else
                 {



More information about the x265-devel mailing list