<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div><div># HG changeset patch</div><div># User Min Chen <min.chen@multicorewareinc.com></div><div># Date 1479149577 21600</div><div># Node ID a4376f9b27749620c9beee1c401dbed34a570751</div><div># Parent  a378efc939e37f13ec1673fda055b1c3d0632e68</div><div>fix logic bug in weight module (the latest row was not weighted)</div><div>---</div><div> source/encoder/reference.cpp |   11 ++++++-----</div><div> 1 files changed, 6 insertions(+), 5 deletions(-)</div><div><br></div><div>diff -r a378efc939e3 -r a4376f9b2774 source/encoder/reference.cpp</div><div>--- a/source/encoder/reference.cpp<span class="Apple-tab-span" style="white-space:pre"> </span>Sun Nov 06 23:24:16 2016 +0100</div><div>+++ b/source/encoder/reference.cpp<span class="Apple-tab-span" style="white-space:pre">     </span>Mon Nov 14 12:52:57 2016 -0600</div><div>@@ -128,11 +128,12 @@</div><div>     intptr_t stride = reconPic->m_stride;</div><div>     int width   = reconPic->m_picWidth;</div><div>     int height  = (finishedRows - numWeightedRows) * g_maxCUSize;</div><div>-    if ((finishedRows == maxNumRows) && (reconPic->m_picHeight % g_maxCUSize))</div><div>+    /* the last row may be partial height */</div><div>+    if (finishedRows == maxNumRows - 1)</div><div>     {</div><div>-        /* the last row may be partial height */</div><div>-        height -= g_maxCUSize;</div><div>-        height += reconPic->m_picHeight % g_maxCUSize;</div><div>+        const int leftRows = (reconPic->m_picHeight & (g_maxCUSize - 1));</div><div>+</div><div>+        height += leftRows ? leftRows : g_maxCUSize;</div><div>     }</div><div>     int cuHeight = g_maxCUSize;</div><div> </div><div>@@ -172,7 +173,7 @@</div><div>         }</div><div> </div><div>         // Extending Bottom</div><div>-        if (finishedRows == maxNumRows)</div><div>+        if (finishedRows == maxNumRows - 1)</div><div>         {</div><div>             int picHeight = reconPic->m_picHeight;</div><div>             if (c) picHeight >>= reconPic->m_vChromaShift;</div></div><div><br></div></div>