<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Mon, Jun 13, 2016 at 11:00 AM, Divya Manivannan <span dir="ltr"><<a href="mailto:divya@multicorewareinc.com" target="_blank">divya@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Divya Manivannan <<a href="mailto:divya@multicorewareinc.com" target="_blank">divya@multicorewareinc.com</a>><br>
# Date 1465554208 -19800<br>
#      Fri Jun 10 15:53:28 2016 +0530<br>
# Node ID c898428779dfbfaaf9b1e7eb2d7676d86a2f54c0<br>
# Parent  0af296185f7ae3e05493ecf164046ddfec085bb3<br>
rc: Add multi-pass data to x265_rc_stats<br>
x265_rc_stats is changed into void pointer to avoid the build number change<br>
whenever new fields are added to it in future.<br>
<br>
diff -r 0af296185f7a -r c898428779df source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt     Tue Jun 07 09:20:11 2016 +0530<br>
+++ b/source/CMakeLists.txt     Fri Jun 10 15:53:28 2016 +0530<br>
@@ -30,7 +30,7 @@<br>
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
<br>
 # X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 85)<br>
+set(X265_BUILD 86)<br>
 configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265.def.in" rel="noreferrer" target="_blank">x265.def.in</a>"<br>
                "${PROJECT_BINARY_DIR}/x265.def")<br>
 configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265_config.h.in" rel="noreferrer" target="_blank">x265_config.h.in</a>"<br>
diff -r 0af296185f7a -r c898428779df source/common/frame.cpp<br>
--- a/source/common/frame.cpp   Tue Jun 07 09:20:11 2016 +0530<br>
+++ b/source/common/frame.cpp   Fri Jun 10 15:53:28 2016 +0530<br>
@@ -42,12 +42,14 @@<br>
     m_prev = NULL;<br>
     m_param = NULL;<br>
     memset(&m_lowres, 0, sizeof(m_lowres));<br>
+    m_rcData = NULL;<br>
 }<br>
<br>
 bool Frame::create(x265_param *param, float* quantOffsets)<br>
 {<br>
     m_fencPic = new PicYuv;<br>
     m_param = param;<br>
+    CHECKED_MALLOC_ZERO(m_rcData, x265_rc_stats, 1);<br>
<br>
     if (m_fencPic->create(param->sourceWidth, param->sourceHeight, param->internalCsp) &&<br>
         m_lowres.create(m_fencPic, param->bframes, !!param->rc.aqMode))<br>
@@ -64,6 +66,8 @@<br>
         return true;<br>
     }<br>
     return false;<br>
+fail:<br>
+    return false;<br>
 }<br>
<br>
 bool Frame::allocEncodeData(x265_param *param, const SPS& sps)<br>
@@ -140,4 +144,5 @@<br>
     }<br>
<br>
     m_lowres.destroy();<br>
+    X265_FREE(m_rcData);<br>
 }<br>
diff -r 0af296185f7a -r c898428779df source/common/frame.h<br>
--- a/source/common/frame.h     Tue Jun 07 09:20:11 2016 +0530<br>
+++ b/source/common/frame.h     Fri Jun 10 15:53:28 2016 +0530<br>
@@ -72,6 +72,7 @@<br>
     Frame*                 m_prev;<br>
     x265_param*            m_param;              // Points to the latest param set for the frame.<br>
     x265_analysis_data     m_analysisData;<br>
+    x265_rc_stats*         m_rcData;<br>
     Frame();<br>
<br>
     bool create(x265_param *param, float* quantOffsets);<br>
diff -r 0af296185f7a -r c898428779df source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp        Tue Jun 07 09:20:11 2016 +0530<br>
+++ b/source/encoder/encoder.cpp        Fri Jun 10 15:53:28 2016 +0530<br>
@@ -779,17 +779,22 @@<br>
<br>
             if (pic_out && m_param->rc.bStatWrite)<br>
             {<br>
-                pic_out->rcData.qpaRc = outFrame->m_encData->m_avgQpRc;<br>
-                pic_out->rcData.qRceq = curEncoder->m_rce.qRceq;<br>
-                pic_out->rcData.qpNoVbv = curEncoder->m_rce.qpNoVbv;<br>
-                pic_out->rcData.coeffBits = outFrame->m_encData->m_frameStats.coeffBits;<br>
-                pic_out->rcData.miscBits = outFrame->m_encData->m_frameStats.miscBits;<br>
-                pic_out->rcData.mvBits = outFrame->m_encData->m_frameStats.mvBits;<br>
-                pic_out->rcData.newQScale = x265_qp2qScale(outFrame->m_encData->m_avgQpRc);<br>
-                pic_out->rcData.poc = curEncoder->m_rce.poc;<br>
-                pic_out->rcData.encodeOrder = curEncoder->m_rce.encodeOrder;<br>
-                pic_out->rcData.sliceType = curEncoder->m_rce.sliceType;<br>
-                pic_out->rcData.keptAsRef = curEncoder->m_rce.sliceType == B_SLICE && !IS_REFERENCED(outFrame) ? 0 : 1;<br>
+                pic_out->rcData = outFrame->m_rcData;<br>
+                outFrame->m_rcData->qpaRc = outFrame->m_encData->m_avgQpRc;<br>
+                outFrame->m_rcData->qRceq = curEncoder->m_rce.qRceq;<br>
+                outFrame->m_rcData->qpNoVbv = curEncoder->m_rce.qpNoVbv;<br>
+                outFrame->m_rcData->coeffBits = outFrame->m_encData->m_frameStats.coeffBits;<br>
+                outFrame->m_rcData->miscBits = outFrame->m_encData->m_frameStats.miscBits;<br>
+                outFrame->m_rcData->mvBits = outFrame->m_encData->m_frameStats.mvBits;<br>
+                outFrame->m_rcData->qScale = outFrame->m_rcData->newQScale = x265_qp2qScale(outFrame->m_encData->m_avgQpRc);<br>
+                outFrame->m_rcData->poc = curEncoder->m_rce.poc;<br>
+                outFrame->m_rcData->encodeOrder = curEncoder->m_rce.encodeOrder;<br>
+                outFrame->m_rcData->sliceType = curEncoder->m_rce.sliceType;<br>
+                outFrame->m_rcData->keptAsRef = curEncoder->m_rce.sliceType == B_SLICE && !IS_REFERENCED(outFrame) ? 0 : 1;<br>
+                outFrame->m_rcData->qpAq = outFrame->m_encData->m_avgQpAq;<br>
+                outFrame->m_rcData->iCuCount = outFrame->m_encData->m_frameStats.percent8x8Intra * m_rateControl->m_ncu;<br>
+                outFrame->m_rcData->pCuCount = outFrame->m_encData->m_frameStats.percent8x8Inter * m_rateControl->m_ncu;<br>
+                outFrame->m_rcData->skipCuCount = outFrame->m_encData->m_frameStats.percent8x8Skip  * m_rateControl->m_ncu;<br>
             }<br></blockquote><div><br></div></div></div><div>This still needs to be copied into x265_picture.....</div><div><br></div><div>It is copied into x265_picture in the above code: <span style="color:rgb(80,0,80)">pic_out->rcData = outFrame->m_rcData;</span></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
             /* Allow this frame to be recycled if no frame encoders are using it for reference */<br>
diff -r 0af296185f7a -r c898428779df source/x265.h<br>
--- a/source/x265.h     Tue Jun 07 09:20:11 2016 +0530<br>
+++ b/source/x265.h     Fri Jun 10 15:53:28 2016 +0530<br>
@@ -153,17 +153,22 @@<br>
 /* Ratecontrol statistics */<br>
 typedef struct x265_rc_stats<br>
 {<br>
-    double  qpaRc;<br>
-    double  qRceq;<br>
-    double  qpNoVbv;<br>
-    double  newQScale;<br>
-    int     mvBits;<br>
-    int     miscBits;<br>
-    int     coeffBits;<br>
-    int     poc;<br>
-    int     encodeOrder;<br>
-    int     sliceType;<br>
-    int     keptAsRef;<br>
+    double   qpaRc;<br>
+    double   qpAq;<br>
+    double   qRceq;<br>
+    double   qpNoVbv;<br>
+    double   newQScale;<br>
+    double   iCuCount;<br>
+    double   pCuCount;<br>
+    double   skipCuCount;<br>
+    double   qScale;<br>
+    int      mvBits;<br>
+    int      miscBits;<br>
+    int      coeffBits;<br>
+    int      poc;<br>
+    int      encodeOrder;<br>
+    int      sliceType;<br>
+    int      keptAsRef;<br>
 } x265_rc_stats;<br>
<br></blockquote><div><br></div></div></div><div>This definition can now be moved inside into frame.h.</div><div><br></div><div>I will move this definition and send the patch again.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">
 /* Used to pass pictures into the encoder, and to get picture data back out of<br>
@@ -240,7 +245,7 @@<br>
     /* Ratecontrol statistics for collecting the ratecontrol information.<br>
      * It is not used for collecting the last pass ratecontrol data in<br>
      * multi pass ratecontrol mode. */<br>
-    x265_rc_stats rcData;<br>
+    void*  rcData;<br>
<br>
     uint64_t framesize;<br>
<br></span>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><span class=""><font color="#888888"><br>
</font></span></blockquote></div><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div>Deepthi Nandakumar<br></div>Engineering Manager, x265<br></div>Multicoreware, Inc<br></div></div>
</font></span></div></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" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
<br></div><br></div>