<div dir="ltr">Hmm, queued. But interesting that these 2 patches do not change outputs.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 12, 2015 at 2:45 PM,  <span dir="ltr"><<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@multicorewareinc.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 Aarthi Thirumalai<br>
# Date 1447240285 -19800<br>
#      Wed Nov 11 16:41:25 2015 +0530<br>
# Node ID 44c08c1f5d3c88cf9cb3dd85cd9e2c4904cebb16<br>
# Parent  ca5137a54613304a6351a31c022806686898a52a<br>
rc: change the predictors update algorithm<br>
<br>
diff -r ca5137a54613 -r 44c08c1f5d3c source/encoder/ratecontrol.cpp<br>
--- a/source/encoder/ratecontrol.cpp    Wed Nov 11 16:24:10 2015 +0530<br>
+++ b/source/encoder/ratecontrol.cpp    Wed Nov 11 16:41:25 2015 +0530<br>
@@ -928,16 +928,20 @@<br>
     /* Frame Predictors used in vbv */<br>
     for (int i = 0; i < 4; i++)<br>
     {<br>
+        m_pred[i].coeffMin = 1.0 / 4;<br>
         m_pred[i].coeff = 1.0;<br>
         m_pred[i].count = 1.0;<br>
         m_pred[i].decay = 0.5;<br>
         m_pred[i].offset = 0.0;<br>
     }<br>
     m_pred[0].coeff = m_pred[3].coeff = 0.75;<br>
+    m_pred[0].coeffMin = m_pred[3].coeffMin = 0.75 / 4;<br>
     if (m_param->rc.qCompress >= 0.8) // when tuned for grain<br>
     {<br>
+        m_pred[1].coeffMin = 0.75 / 4;<br>
         m_pred[1].coeff = 0.75;<br>
-        m_pred[0].coeff = m_pred[3].coeff = 0.50;<br>
+        m_pred[0].coeff = m_pred[3].coeff = 0.5;<br>
+        m_pred[0].coeffMin = m_pred[3].coeffMin = 0.5 / 4;<br>
     }<br>
 }<br>
<br>
@@ -997,6 +1001,7 @@<br>
             {<br>
                 for (int j = 0; j < 2; j++)<br>
                 {<br>
+                    rce->rowPreds[i][j].coeffMin = 0.25 / 4;<br>
                     rce->rowPreds[i][j].coeff = 0.25;<br>
                     rce->rowPreds[i][j].count = 1.0;<br>
                     rce->rowPreds[i][j].decay = 0.5;<br>
@@ -2149,7 +2154,8 @@<br>
         return;<br>
     const double range = 2;<br>
     double old_coeff = p->coeff / p->count;<br>
-    double new_coeff = bits * q / var;<br>
+    double old_offset = p->offset / p->count;<br>
+    double new_coeff = X265_MAX((bits * q - old_offset) / var, p->coeffMin );<br>
     double new_coeff_clipped = x265_clip3(old_coeff / range, old_coeff * range, new_coeff);<br>
     double new_offset = bits * q - new_coeff_clipped * var;<br>
     if (new_offset >= 0)<br>
diff -r ca5137a54613 -r 44c08c1f5d3c source/encoder/ratecontrol.h<br>
--- a/source/encoder/ratecontrol.h      Wed Nov 11 16:24:10 2015 +0530<br>
+++ b/source/encoder/ratecontrol.h      Wed Nov 11 16:41:25 2015 +0530<br>
@@ -48,6 +48,7 @@<br>
<br>
 struct Predictor<br>
 {<br>
+    double coeffMin;<br>
     double coeff;<br>
     double count;<br>
     double decay;<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">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><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Deepthi Nandakumar<br></div>Engineering Manager, x265<br></div>Multicoreware, Inc<br></div></div>
</div>