[x265] [PATCH 3 of 6] faster algorithm to calculate signHidden cost in codeCoeffNxN()

Min Chen chenm003 at 163.com
Wed Jun 17 01:31:16 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1434495243 25200
# Node ID 712c963c589f1d5940d7de352fcee27469b3eb7f
# Parent  6977137391b30dbc9ed55b7bf3e35dcfb40aef9a
faster algorithm to calculate signHidden cost in codeCoeffNxN()
---
 source/encoder/entropy.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r 6977137391b3 -r 712c963c589f source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Tue Jun 16 15:54:00 2015 -0700
+++ b/source/encoder/entropy.cpp	Tue Jun 16 15:54:03 2015 -0700
@@ -1755,9 +1755,9 @@
                 c1 = ((sum >> 26) & 3);
                 m_fracBits += sum & 0x00FFFFFF;
 
-                const int hiddenShift = (bHideFirstSign & signHidden) ? 1 : 0;
+                const int hiddenShift = (bHideFirstSign & signHidden) ? -1 : 0;
                 //encodeBinsEP((coeffSigns >> hiddenShift), numNonZero - hiddenShift);
-                m_fracBits += (numNonZero - hiddenShift) << 15;
+                m_fracBits += (numNonZero + hiddenShift) << 15;
 
                 if (numNonZero > firstC2Idx)
                 {



More information about the x265-devel mailing list