<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 17, 2015 at 5:01 AM, Min Chen <span dir="ltr"><<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Min Chen <<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>><br>
# Date 1434496332 25200<br>
# Node ID deee2eae898d7ea835a50482aaacac8205fc9fa3<br>
# Parent  6cc50a833797c6fac594710996bbf6e88f0adc93<br>
reduce shift operator on coeff remain code<br>
---<br>
 source/encoder/entropy.cpp |    7 +++++--<br>
 1 files changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff -r 6cc50a833797 -r deee2eae898d source/encoder/entropy.cpp<br>
--- a/source/encoder/entropy.cpp        Tue Jun 16 15:54:22 2015 -0700<br>
+++ b/source/encoder/entropy.cpp        Tue Jun 16 16:12:12 2015 -0700<br>
@@ -1809,6 +1809,7 @@<br>
                     // Standard path<br>
                     uint32_t goRiceParam = 0;<br>
                     int baseLevel = 3;<br>
+                    uint32_t threshold = COEF_REMAIN_BIN_REDUCTION;<br>
 #if CHECKED_BUILD || _DEBUG<br>
                     int firstCoeff2 = 1;<br>
 #endif<br>
@@ -1823,8 +1824,10 @@<br>
                         if (absCoeff[idx] >= baseLevel)<br>
                         {<br>
                             writeCoefRemainExGolomb(absCoeff[idx] - baseLevel, goRiceParam);<br>
-                            if (absCoeff[idx] > (COEF_REMAIN_BIN_REDUCTION << goRiceParam))<br>
-                                goRiceParam = (goRiceParam + 1) - (goRiceParam >> 2);<br>
+                            X265_CHECK(threshold == (uint32_t)(COEF_REMAIN_BIN_REDUCTION << goRiceParam), "COEF_REMAIN_BIN_REDUCTION check failure\n");<br>
+                            const int adjust = (absCoeff[idx] > threshold) & (goRiceParam <= 3);<br></blockquote><div><br></div><div>goRiceParam is always zero until this point?<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                            goRiceParam += adjust;<br>
+                            threshold += (adjust) ? threshold : 0;<br>
                             X265_CHECK(goRiceParam <= 4, "goRiceParam check failure\n");<br>
                         }<br>
 #if CHECKED_BUILD || _DEBUG<br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>