<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 19, 2020 at 3:28 PM Snehaa Giridharan <<a href="mailto:snehaa@multicorewareinc.com" target="_blank">snehaa@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"># HG changeset patch<br># User Snehaa Giridharan <<a href="mailto:snehaa@multicorewareinc.com" target="_blank">snehaa@multicorewareinc.com</a>><br># Date 1575548701 -19800<br># Thu Dec 05 17:55:01 2019 +0530<br># Node ID 495e78dfd32bcdeee0c48a8732eba135be12cb8e<br># Parent ce3a4929efca3034bce12b7449d73ed2e03f9b4d<br>zone: Fix BufferRate mismatch and log unclipped BufferFillFinal into csv<br><br>This commit fixes<br>- Mismatch in BufferRate<br></div></blockquote><div>Please brief this. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">- Log UnclippedBufferFillFinal into csv when csvloglevel greater than 1<br><br>diff --git a/doc/reST/cli.rst b/doc/reST/cli.rst<br>--- a/doc/reST/cli.rst<br>+++ b/doc/reST/cli.rst<br>@@ -107,6 +107,9 @@<br> <br> **BufferFillFinal** Buffer bits available after removing the frame out of CPB.<br> <br>+ **UnclippedBufferFillFinal** Unclipped buffer bits available after removing the frame <br>+ out of CPB only used for csv logging purpose.<br>+ <br> **Latency** Latency in terms of number of frames between when the frame <br> was given in and when the frame is given out.<br> <br>diff --git a/source/encoder/api.cpp b/source/encoder/api.cpp<br>--- a/source/encoder/api.cpp<br>+++ b/source/encoder/api.cpp<br>@@ -1294,6 +1294,8 @@<br> fprintf(csvfp, "RateFactor, ");<br> if (param->rc.vbvBufferSize)<br> fprintf(csvfp, "BufferFill, BufferFillFinal, ");<br>+ if (param->csvLogLevel >= 2)<br></div></blockquote><div>Need to check if
param->rc.vbvBufferSize is set. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">+ fprintf(csvfp, "UnclippedBufferFillFinal, ");<br> if (param->bEnablePsnr)<br> fprintf(csvfp, "Y PSNR, U PSNR, V PSNR, YUV PSNR, ");<br> if (param->bEnableSsim)<br>@@ -1405,6 +1407,8 @@<br> fprintf(param->csvfpt, "%.3lf,", frameStats->rateFactor);<br> if (param->rc.vbvBufferSize)<br> fprintf(param->csvfpt, "%.3lf, %.3lf,", frameStats->bufferFill, frameStats->bufferFillFinal);<br>+ if (param->csvLogLevel >= 2)<br></div></blockquote><div>Same here. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">+ fprintf(param->csvfpt, "%.3lf,", frameStats->unclippedBufferFillFinal);<br> if (param->bEnablePsnr)<br> fprintf(param->csvfpt, "%.3lf, %.3lf, %.3lf, %.3lf,", frameStats->psnrY, frameStats->psnrU, frameStats->psnrV, frameStats->psnr);<br> if (param->bEnableSsim)<br>diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp<br>--- a/source/encoder/encoder.cpp<br>+++ b/source/encoder/encoder.cpp<br>@@ -3012,6 +3012,8 @@<br> frameStats->ipCostRatio = curFrame->m_lowres.ipCostRatio;<br> frameStats->bufferFill = m_rateControl->m_bufferFillActual;<br> frameStats->bufferFillFinal = m_rateControl->m_bufferFillFinal;<br>+ if (m_param->csvLogLevel >= 2)<br>+ frameStats->unclippedBufferFillFinal = m_rateControl->m_unclippedBufferFillFinal;<br> frameStats->frameLatency = inPoc - poc;<br> if (m_param->rc.rateControlMode == X265_RC_CRF)<br> frameStats->rateFactor = curEncData.m_rateFactor;<br>diff --git a/source/encoder/ratecontrol.cpp b/source/encoder/ratecontrol.cpp<br>--- a/source/encoder/ratecontrol.cpp<br>+++ b/source/encoder/ratecontrol.cpp<br>@@ -2745,7 +2745,9 @@<br> x265_log(m_param, X265_LOG_WARNING, "poc:%d, VBV underflow (%.0f bits)\n", rce->poc, m_bufferFillFinal);<br> <br> m_bufferFillFinal = X265_MAX(m_bufferFillFinal, 0);<br>- m_bufferFillFinal += m_bufferRate;<br>+ m_bufferFillFinal += rce->bufferRate;<br>+ if (m_param->csvLogLevel >= 2)<br>+ m_unclippedBufferFillFinal = m_bufferFillFinal;<br> <br> if (m_param->rc.bStrictCbr)<br> {<br>@@ -2755,14 +2757,14 @@<br> filler += FILLER_OVERHEAD * 8;<br> }<br> m_bufferFillFinal -= filler;<br>- bufferBits = X265_MIN(bits + filler + m_bufferExcess, m_bufferRate);<br>+ bufferBits = X265_MIN(bits + filler + m_bufferExcess, rce->bufferRate);<br> m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits + filler, 0);<br> m_bufferFillActual += bufferBits - bits - filler;<br> }<br> else<br> {<br> m_bufferFillFinal = X265_MIN(m_bufferFillFinal, m_bufferSize);<br>- bufferBits = X265_MIN(bits + m_bufferExcess, m_bufferRate);<br>+ bufferBits = X265_MIN(bits + m_bufferExcess, rce->bufferRate);<br> m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits, 0);<br> m_bufferFillActual += bufferBits - bits;<br> m_bufferFillActual = X265_MIN(m_bufferFillActual, m_bufferSize);<br>diff --git a/source/encoder/ratecontrol.h b/source/encoder/ratecontrol.h<br>--- a/source/encoder/ratecontrol.h<br>+++ b/source/encoder/ratecontrol.h<br>@@ -157,6 +157,7 @@<br> double m_rateFactorConstant;<br> double m_bufferSize;<br> double m_bufferFillFinal; /* real buffer as of the last finished frame */<br>+ double m_unclippedBufferFillFinal; /* real unclipped buffer as of the last finished frame used to log in CSV*/<br> double m_bufferFill; /* planned buffer, if all in-progress frames hit their bit budget */<br> double m_bufferRate; /* # of bits added to buffer_fill after each frame */<br> double m_vbvMaxRate; /* in kbps */<br>diff --git a/source/x265.h b/source/x265.h<br>--- a/source/x265.h<br>+++ b/source/x265.h<br>@@ -304,6 +304,7 @@<br> double totalFrameTime;<br> double vmafFrameScore;<br> double bufferFillFinal;<br>+ double unclippedBufferFillFinal;<br></div></blockquote><div>Increment X265_BUILD. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"> } x265_frame_stats;<br> <br> typedef struct x265_ctu_info_t<br><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><i><font face="georgia, serif">Thanks and Regards,</font></i></div><div><i><b><font face="georgia, serif">Snehaa.G</font></b></i></div></div></div></div></div></div></div></div></div></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" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="georgia, serif">Regards,</font><div><b><font face="georgia, serif">Aruna Matheswaran,</font></b></div><div><font face="georgia, serif">Video Codec Engineer,</font></div><div><font face="georgia, serif">Media & AI analytics BU,</font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" width="96" height="36" style="margin-left:0px;margin-top:0px"></span></span></span><font face="georgia, serif"><br></font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" style="margin-left:0px;margin-top:0px"></span></span></span><font face="georgia, serif"><br></font></div><div><font face="georgia, serif"><br></font></div></div></div></div></div></div></div></div></div></div>