[x265] [PATCH 6 of 6] reduce shift operator on coeff remain code

chen chenm003 at 163.com
Thu Jun 18 19:38:07 CEST 2015


 
在 2015-06-18 14:21:46,"Deepthi Nandakumar" <deepthi at multicorewareinc.com> 写道:





On Wed, Jun 17, 2015 at 5:01 AM, Min Chen <chenm003 at 163.com> wrote:
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1434496332 25200
# Node ID deee2eae898d7ea835a50482aaacac8205fc9fa3
# Parent  6cc50a833797c6fac594710996bbf6e88f0adc93
reduce shift operator on coeff remain code
---
 source/encoder/entropy.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r 6cc50a833797 -r deee2eae898d source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp        Tue Jun 16 15:54:22 2015 -0700
+++ b/source/encoder/entropy.cpp        Tue Jun 16 16:12:12 2015 -0700
@@ -1809,6 +1809,7 @@
                     // Standard path
                     uint32_t goRiceParam = 0;
                     int baseLevel = 3;
+                    uint32_t threshold = COEF_REMAIN_BIN_REDUCTION;
 #if CHECKED_BUILD || _DEBUG
                     int firstCoeff2 = 1;
 #endif
@@ -1823,8 +1824,10 @@
                         if (absCoeff[idx] >= baseLevel)
                         {
                             writeCoefRemainExGolomb(absCoeff[idx] - baseLevel, goRiceParam);
-                            if (absCoeff[idx] > (COEF_REMAIN_BIN_REDUCTION << goRiceParam))
-                                goRiceParam = (goRiceParam + 1) - (goRiceParam >> 2);
+                            X265_CHECK(threshold == (uint32_t)(COEF_REMAIN_BIN_REDUCTION << goRiceParam), "COEF_REMAIN_BIN_REDUCTION check failure\n");
+                            const int adjust = (absCoeff[idx] > threshold) & (goRiceParam <= 3);



goRiceParam is always zero until this point?
 
no,  it in loop, so unprediction value


+                            goRiceParam += adjust;
+                            threshold += (adjust) ? threshold : 0;
                             X265_CHECK(goRiceParam <= 4, "goRiceParam check failure\n");
                         }
 #if CHECKED_BUILD || _DEBUG

_______________________________________________
x265-devel mailing list
x265-devel at videolan.org
https://mailman.videolan.org/listinfo/x265-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20150619/b0718033/attachment.html>


More information about the x265-devel mailing list