<div dir="ltr"><div># HG changeset patch</div><div># User Aarthi Thirumalai<<a href="mailto:aarthi@multicorewareinc.com">aarthi@multicorewareinc.com</a>></div><div># Date 1403808050 -19800</div><div>#      Fri Jun 27 00:10:50 2014 +0530</div>
<div># Node ID 11ddf73017d44933090a8943f4fc5098b231b56d</div><div># Parent  1b669c33ff3a8d8f6c9bd1e18979c009baed2433</div><div>rc: accumulate mv bits, coeff bits per frame</div><div><br></div><div>diff -r 1b669c33ff3a -r 11ddf73017d4 source/Lib/TLibEncoder/TEncCu.cpp</div>
<div>--- a/source/Lib/TLibEncoder/TEncCu.cpp<span class="" style="white-space:pre">     </span>Wed Jun 25 22:46:45 2014 +0530</div><div>+++ b/source/Lib/TLibEncoder/TEncCu.cpp<span class="" style="white-space:pre">      </span>Fri Jun 27 00:10:50 2014 +0530</div>
<div>@@ -1365,12 +1365,14 @@</div><div>     m_entropyCoder->encodePredMode(outTempCU, 0);</div><div>     m_entropyCoder->encodePartSize(outTempCU, 0, depth);</div><div>     m_entropyCoder->encodePredInfo(outTempCU, 0);</div>
<div>+    outTempCU->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();</div><div> </div><div>     // Encode Coefficients</div><div>     bool bCodeDQP = getdQPFlag();</div><div>     m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), bCodeDQP);</div>
<div>     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);</div><div>     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();</div><div>+    outTempCU->m_coeffBits = outTempCU->m_totalBits - outTempCU->m_mvBits;</div>
<div> </div><div>     if (m_rdCost->psyRdEnabled())</div><div>     {</div><div>@@ -1411,12 +1413,14 @@</div><div>     m_entropyCoder->encodePredMode(outTempCU, 0);</div><div>     m_entropyCoder->encodePartSize(outTempCU, 0, depth);</div>
<div>     m_entropyCoder->encodePredInfo(outTempCU, 0);</div><div>+    outTempCU->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();</div><div> </div><div>     // Encode Coefficients</div><div>     bool bCodeDQP = getdQPFlag();</div>
<div>     m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), bCodeDQP);</div><div>     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);</div><div>     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();</div>
<div>+    outTempCU->m_coeffBits = outTempCU->m_totalBits - outTempCU->m_mvBits;</div><div> </div><div>     if (m_rdCost->psyRdEnabled())</div><div>     {</div><div>diff -r 1b669c33ff3a -r 11ddf73017d4 source/Lib/TLibEncoder/TEncSearch.cpp</div>
<div>--- a/source/Lib/TLibEncoder/TEncSearch.cpp<span class="" style="white-space:pre"> </span>Wed Jun 25 22:46:45 2014 +0530</div><div>+++ b/source/Lib/TLibEncoder/TEncSearch.cpp<span class="" style="white-space:pre">  </span>Fri Jun 27 00:10:50 2014 +0530</div>
<div>@@ -4059,6 +4059,7 @@</div><div>         }</div><div>         m_entropyCoder->encodeSkipFlag(cu, 0);</div><div>         m_entropyCoder->encodeMergeIndex(cu, 0);</div><div>+        cu->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();</div>
<div>         return m_entropyCoder->getNumberOfWrittenBits();</div><div>     }</div><div>     else</div><div>@@ -4073,8 +4074,11 @@</div><div>         m_entropyCoder->encodePartSize(cu, 0, cu->getDepth(0));</div>
<div>         m_entropyCoder->encodePredInfo(cu, 0);</div><div>         bool bDummy = false;</div><div>+        cu->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();</div><div>         m_entropyCoder->encodeCoeff(cu, 0, cu->getDepth(0), cu->getCUSize(0), bDummy);</div>
<div>-        return m_entropyCoder->getNumberOfWrittenBits();</div><div>+        int totalBits = m_entropyCoder->getNumberOfWrittenBits();</div><div>+        cu->m_coeffBits = totalBits - cu->m_mvBits;</div><div>
+        return totalBits;</div><div>     }</div><div> }</div><div> </div><div>diff -r 1b669c33ff3a -r 11ddf73017d4 source/encoder/compress.cpp</div><div>--- a/source/encoder/compress.cpp<span class="" style="white-space:pre">       </span>Wed Jun 25 22:46:45 2014 +0530</div>
<div>+++ b/source/encoder/compress.cpp<span class="" style="white-space:pre">   </span>Fri Jun 27 00:10:50 2014 +0530</div><div>@@ -63,6 +63,7 @@</div><div>     m_entropyCoder->encodePredMode(cu, 0);</div><div>     m_entropyCoder->encodePartSize(cu, 0, depth);</div>
<div>     m_entropyCoder->encodePredInfo(cu, 0);</div><div>+    cu->m_mvBits += m_entropyCoder->getNumberOfWrittenBits();</div><div> </div><div>     // Encode Coefficients</div><div>     bool bCodeDQP = getdQPFlag();</div>
<div>@@ -71,6 +72,7 @@</div><div>     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);</div><div> </div><div>     cu->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();</div><div>+    cu->m_coeffBits = cu->m_totalBits - cu->m_mvBits;</div>
<div>     if (m_rdCost->psyRdEnabled())</div><div>     {</div><div>         int part = g_convertToBit[cu->getCUSize(0)];</div><div>diff -r 1b669c33ff3a -r 11ddf73017d4 source/encoder/frameencoder.cpp</div><div>--- a/source/encoder/frameencoder.cpp<span class="" style="white-space:pre"> </span>Wed Jun 25 22:46:45 2014 +0530</div>
<div>+++ b/source/encoder/frameencoder.cpp<span class="" style="white-space:pre">       </span>Fri Jun 27 00:10:50 2014 +0530</div><div>@@ -694,6 +694,11 @@</div><div>         // Store probabilities of second LCU in line into buffer</div>
<div>         if (col == 1 && m_param->bEnableWavefront)</div><div>             getBufferSBac(lin)->loadContexts(getSbacCoder(subStrm));</div><div>+</div><div>+        // Collect Frame Stats for 2 pass</div>
<div>+        m_frame->m_stats.mvBits += cu->m_mvBits;</div><div>+        m_frame->m_stats.coeffBits += cu->m_coeffBits;</div><div>+        m_frame->m_stats.miscBits += cu->m_totalBits - (cu->m_mvBits + cu->m_coeffBits);</div>
<div>     }</div><div> </div><div>     if (slice->getPPS()->getCabacInitPresentFlag())</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 4:25 PM, Deepthi Nandakumar <span dir="ltr"><<a href="mailto:deepthi@multicorewareinc.com" target="_blank">deepthi@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Pls fix extra newlines and whitespace nits.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
<div><div class="h5">On Wed, Jun 25, 2014 at 10:54 PM,  <span dir="ltr"><<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@multicorewareinc.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"># HG changeset patch<br>
# User Aarthi Thirumalai<<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@multicorewareinc.com</a>><br>
# Date 1403716735 -19800<br>
#      Wed Jun 25 22:48:55 2014 +0530<br>
# Node ID 0995efabd44470c1192994e1aceeb40ae606467f<br>
# Parent  e71e34d02d7777e228eab43edf1910a71a44417d<br>
rc: accumulate mv bits, coeff bits per frame.<br>
<br>
diff -r e71e34d02d77 -r 0995efabd444 source/Lib/TLibEncoder/TEncCu.cpp<br>
--- a/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:46:45 2014 +0530<br>
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:48:55 2014 +0530<br>
@@ -555,6 +555,7 @@<br>
         m_entropyCoder->resetBits();<br>
         m_entropyCoder->encodeSplitFlag(outBestCU, 0, depth);<br>
         outBestCU->m_totalBits += m_entropyCoder->getNumberOfWrittenBits(); // split bits<br>
+<br>
         if (m_rdCost->psyRdEnabled())<br>
         {<br>
             outBestCU->m_totalPsyCost = m_rdCost->calcPsyRdCost(outBestCU->m_totalDistortion, outBestCU->m_totalBits,<br>
@@ -616,7 +617,7 @@<br>
             m_entropyCoder->encodeSplitFlag(outTempCU, 0, depth);<br>
             outTempCU->m_totalBits += m_entropyCoder->getNumberOfWrittenBits(); // split bits<br>
         }<br>
-<br>
+<br>
         if (m_rdCost->psyRdEnabled())<br>
         {<br>
             outTempCU->m_totalPsyCost = m_rdCost->calcPsyRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits,<br>
@@ -907,6 +908,7 @@<br>
         m_entropyCoder->resetBits();<br>
         m_entropyCoder->encodeSplitFlag(outBestCU, 0, depth);<br>
         outBestCU->m_totalBits += m_entropyCoder->getNumberOfWrittenBits(); // split bits<br>
+<br>
         if (m_rdCost->psyRdEnabled())<br>
         {<br>
             outBestCU->m_totalPsyCost = m_rdCost->calcPsyRdCost(outBestCU->m_totalDistortion, outBestCU->m_totalBits,<br>
@@ -1168,6 +1170,7 @@<br>
         return;<br>
     }<br>
<br>
+<br>
     if (slice->getPPS()->getTransquantBypassEnableFlag())<br>
     {<br>
         m_entropyCoder->encodeCUTransquantBypassFlag(cu, absPartIdx);<br>
@@ -1390,12 +1393,14 @@<br>
     m_entropyCoder->encodePartSize(outTempCU, 0, depth);<br>
     m_entropyCoder->encodePredInfo(outTempCU, 0);<br>
     m_entropyCoder->encodeIPCMInfo(outTempCU, 0);<br>
+    outTempCU->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();<br>
<br>
     // Encode Coefficients<br>
     bool bCodeDQP = getdQPFlag();<br>
     m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), bCodeDQP);<br>
     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);<br>
     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();<br>
+    outTempCU->m_coeffBits = outTempCU->m_totalBits - outTempCU->m_mvBits;<br>
<br>
     if (m_rdCost->psyRdEnabled())<br>
     {<br>
@@ -1437,12 +1442,13 @@<br>
     m_entropyCoder->encodePartSize(outTempCU, 0, depth);<br>
     m_entropyCoder->encodePredInfo(outTempCU, 0);<br>
     m_entropyCoder->encodeIPCMInfo(outTempCU, 0);<br>
-<br>
+    outTempCU->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();<br>
     // Encode Coefficients<br>
     bool bCodeDQP = getdQPFlag();<br>
     m_entropyCoder->encodeCoeff(outTempCU, 0, depth, outTempCU->getCUSize(0), bCodeDQP);<br>
     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);<br>
     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();<br>
+    outTempCU->m_coeffBits = outTempCU->m_totalBits - outTempCU->m_mvBits;<br>
<br>
     if (m_rdCost->psyRdEnabled())<br>
     {<br>
@@ -1492,12 +1498,14 @@<br>
     m_entropyCoder->encodeSkipFlag(outTempCU, 0);<br>
     m_entropyCoder->encodePredMode(outTempCU, 0);<br>
     m_entropyCoder->encodePartSize(outTempCU, 0, depth);<br>
+    outTempCU->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();<br>
     m_entropyCoder->encodeIPCMInfo(outTempCU, 0);<br>
<br>
     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);<br>
<br>
     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();<br>
     outTempCU->m_totalRDCost = m_rdCost->calcRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits);<br>
+    outTempCU->m_coeffBits = outTempCU->m_totalBits - outTempCU->m_mvBits;<br>
<br>
     xCheckDQP(outTempCU);<br>
     xCheckBestMode(outBestCU, outTempCU, depth);<br>
diff -r e71e34d02d77 -r 0995efabd444 source/Lib/TLibEncoder/TEncSearch.cpp<br>
--- a/source/Lib/TLibEncoder/TEncSearch.cpp     Wed Jun 25 22:46:45 2014 +0530<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp     Wed Jun 25 22:48:55 2014 +0530<br>
@@ -4211,6 +4211,7 @@<br>
         }<br>
         m_entropyCoder->encodeSkipFlag(cu, 0);<br>
         m_entropyCoder->encodeMergeIndex(cu, 0);<br>
+        cu->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();<br>
         return m_entropyCoder->getNumberOfWrittenBits();<br>
     }<br>
     else<br>
@@ -4225,8 +4226,11 @@<br>
         m_entropyCoder->encodePartSize(cu, 0, cu->getDepth(0));<br>
         m_entropyCoder->encodePredInfo(cu, 0);<br>
         bool bDummy = false;<br>
+        cu->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();<br>
         m_entropyCoder->encodeCoeff(cu, 0, cu->getDepth(0), cu->getCUSize(0), bDummy);<br>
-        return m_entropyCoder->getNumberOfWrittenBits();<br>
+        int totalBits = m_entropyCoder->getNumberOfWrittenBits();<br>
+        cu->m_coeffBits = totalBits - cu->m_mvBits;<br>
+        return totalBits;<br>
     }<br>
 }<br>
<br>
diff -r e71e34d02d77 -r 0995efabd444 source/encoder/compress.cpp<br>
--- a/source/encoder/compress.cpp       Wed Jun 25 22:46:45 2014 +0530<br>
+++ b/source/encoder/compress.cpp       Wed Jun 25 22:48:55 2014 +0530<br>
@@ -64,6 +64,7 @@<br>
     m_entropyCoder->encodePartSize(cu, 0, depth);<br>
     m_entropyCoder->encodePredInfo(cu, 0);<br>
     m_entropyCoder->encodeIPCMInfo(cu, 0);<br>
+    cu->m_mvBits += m_entropyCoder->getNumberOfWrittenBits();<br>
<br>
     // Encode Coefficients<br>
     bool bCodeDQP = getdQPFlag();<br>
@@ -72,6 +73,7 @@<br>
     m_rdGoOnSbacCoder->store(m_rdSbacCoders[depth][CI_TEMP_BEST]);<br>
<br>
     cu->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();<br>
+    cu->m_coeffBits = cu->m_totalBits - cu->m_mvBits;<br>
     cu->m_totalRDCost = m_rdCost->calcRdCost(cu->m_totalDistortion, cu->m_totalBits);<br>
 }<br>
<br>
@@ -625,7 +627,7 @@<br>
                 m_entropyCoder->resetBits();<br>
                 m_entropyCoder->encodeSplitFlag(outBestCU, 0, depth);<br>
                 outBestCU->m_totalBits += m_entropyCoder->getNumberOfWrittenBits(); // split bits<br>
-                outBestCU->m_totalRDCost  = m_rdCost->calcRdCost(outBestCU->m_totalDistortion, outBestCU->m_totalBits);<br>
+                outBestCU->m_totalRDCost = m_rdCost->calcRdCost(outBestCU->m_totalDistortion, outBestCU->m_totalBits);<br>
             }<br>
<br>
             // copy original YUV samples to PCM buffer<br>
diff -r e71e34d02d77 -r 0995efabd444 source/encoder/frameencoder.cpp<br>
--- a/source/encoder/frameencoder.cpp   Wed Jun 25 22:46:45 2014 +0530<br>
+++ b/source/encoder/frameencoder.cpp   Wed Jun 25 22:48:55 2014 +0530<br>
@@ -694,6 +694,11 @@<br>
         // Store probabilities of second LCU in line into buffer<br>
         if (col == 1 && m_param->bEnableWavefront)<br>
             getBufferSBac(lin)->loadContexts(getSbacCoder(subStrm));<br>
+<br>
+        // Collect Frame Stats for 2 pass<br>
+        m_frame->m_stats.mvBits += cu->m_mvBits;<br>
+        m_frame->m_stats.coeffBits += cu->m_coeffBits;<br>
+        m_frame->m_stats.miscBits += cu->m_totalBits - (cu->m_mvBits + cu->m_coeffBits);<br>
     }<br>
<br>
     if (slice->getPPS()->getCabacInitPresentFlag())<br></div></div>
_______________________________________________<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" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div>
<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>
<br></blockquote></div><br></div>