<div dir="ltr"><div id="__tbSetup"></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 18, 2013 at 6:21 PM,  <span dir="ltr"><<a href="mailto:deepthidevaki@multicorewareinc.com" target="_blank">deepthidevaki@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 Deepthi Devaki <<a href="mailto:deepthidevaki@multicorewareinc.com">deepthidevaki@multicorewareinc.com</a>><br>
# Date 1379508562 -19800<br>
# Node ID f3f6eb53a7854220ef06c5b0f925e485929ab31f<br>
# Parent  9d5d4e4e6d6ca312cb443f18fe6880127e5f6c75<br>
lookahead: fix cost estimation, use previous result when calculation is skipped<br>
<br>
diff -r 9d5d4e4e6d6c -r f3f6eb53a785 source/encoder/slicetype.cpp<br>
--- a/source/encoder/slicetype.cpp      Wed Sep 18 11:34:10 2013 +0530<br>
+++ b/source/encoder/slicetype.cpp      Wed Sep 18 18:19:22 2013 +0530<br>
@@ -363,8 +363,11 @@<br>
     for (int i = 0; i < 1 + bBidir; i++)<br>
     {<br>
         if (!bDoSearch[i])<br>
+        {<br>
+            /* Use previously calculated cost */<br>
+            COPY2_IF_LT(bcost, *fenc_costs[i], listused, i + 1);<br>
             continue;<br>
-<br>
+        }<br></blockquote><div><br></div><div>Thanks, this is a good catch. However, we also need to initialise lowresMvCosts in lowres::create to COST_MAX, to prevent the possibility of reading uninitialised memory. <br>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
         int numc = 0;<br>
         MV mvc[4], mvp;<br>
         MV *fenc_mv = fenc_mvs[i];<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" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>