<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 29, 2018 at 5:15 PM,  <span dir="ltr"><<a href="mailto:kavitha@multicorewareinc.com" target="_blank">kavitha@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 Kavitha Sampath <<a href="mailto:kavitha@multicorewareinc.com">kavitha@multicorewareinc.com</a>><br>
# Date 1527499557 -19800<br>
#      Mon May 28 14:55:57 2018 +0530<br>
# Branch stable<br>
# Node ID fe3c44a200eeb3c1bdf9467071cd59<wbr>3e94959866<br>
# Parent  478bfe2b7673e93ca9283a4ce9424a<wbr>c3a1ba476e<br>
fix bug in copying vbv information when scalefactor is 0<br>
<br>
diff -r 478bfe2b7673 -r fe3c44a200ee source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp        Mon May 21 14:05:52 2018 +0530<br>
+++ b/source/encoder/encoder.cpp        Mon May 28 14:55:57 2018 +0530<br>
@@ -3408,24 +3408,28 @@<br>
     allocAnalysis(analysis);<br>
     if (m_param->bDisableLookahead && m_rateControl->m_isVbv)<br>
     {<br>
+        int vbvCount = m_param->lookaheadDepth + m_param->bframes + 2;<br>
         X265_FREAD(analysis-><wbr>lookahead.intraVbvCost, sizeof(uint32_t), analysis->numCUsInFrame, m_analysisFileIn, picData->lookahead.<wbr>intraVbvCost);<br>
         X265_FREAD(analysis-><wbr>lookahead.vbvCost, sizeof(uint32_t), analysis->numCUsInFrame, m_analysisFileIn, picData->lookahead.vbvCost);<br>
         X265_FREAD(analysis-><wbr>lookahead.satdForVbv, sizeof(uint32_t), analysis->numCuInHeight, m_analysisFileIn, picData->lookahead.satdForVbv)<wbr>;<br>
         X265_FREAD(analysis-><wbr>lookahead.intraSatdForVbv, sizeof(uint32_t), analysis->numCuInHeight, m_analysisFileIn, picData->lookahead.<wbr>intraSatdForVbv);<br>
-<br>
-        int vbvCount = m_param->lookaheadDepth + m_param->bframes + 2;<br>
-        for (int index = 0; index < vbvCount; index++)<br>
-            analysis->lookahead.<wbr>plannedSatd[index] = picData->lookahead.<wbr>plannedSatd[index] * (2 * m_param->scaleFactor);<br>
-<br>
-        for (uint32_t i = 0; i < analysis->numCuInHeight; i++)<br>
+        X265_FREAD(analysis-><wbr>lookahead.plannedSatd, sizeof(int64_t), vbvCount, m_analysisFileIn, picData->lookahead.<wbr>plannedSatd);<br>
+<br>
+        if (m_param->scaleFactor)<br>
         {<br>
-            analysis->lookahead.<wbr>satdForVbv[i] = analysis->lookahead.<wbr>satdForVbv[i] * (2* m_param->scaleFactor);<br>
-            analysis->lookahead.<wbr>intraSatdForVbv[i] = analysis->lookahead.<wbr>intraSatdForVbv[i] * (2 * m_param->scaleFactor);<br>
-        }<br>
-        for (uint32_t i = 0; i < analysis->numCUsInFrame; i++)<br>
-        {<br>
-            analysis->lookahead.vbvCost[i] = analysis->lookahead.vbvCost[i] * (2 * m_param->scaleFactor);<br>
-            analysis->lookahead.<wbr>intraVbvCost[i] = analysis->lookahead.<wbr>intraVbvCost[i] * (2 * m_param->scaleFactor);<br>
+            for (int index = 0; index < vbvCount; index++)<br>
+                analysis->lookahead.<wbr>plannedSatd[index] *= factor;<br>
+<br>
+            for (uint32_t i = 0; i < analysis->numCuInHeight; i++)<br>
+            {<br>
+                analysis->lookahead.<wbr>satdForVbv[i] *= factor;<br>
+                analysis->lookahead.<wbr>intraSatdForVbv[i] *= factor;<br>
+            }<br>
+            for (uint32_t i = 0; i < analysis->numCUsInFrame; i++)<br>
+            {<br>
+                analysis->lookahead.vbvCost[i] *= factor;<br>
+                analysis->lookahead.<wbr>intraVbvCost[i] *= factor;<br>
+            }<br>
         }<br>
     }<br>
     if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)<br>
<br>______________________________<wbr>_________________<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/<wbr>listinfo/x265-devel</a><br>
<br></blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Pushed.</div></div>