<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 2, 2017 at 6:40 PM, <span dir="ltr"><<a href="mailto:bhavna@multicorewareinc.com" target="_blank">bhavna@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 Bhavna Hariharan <<a href="mailto:bhavna@multicorewareinc.com">bhavna@multicorewareinc.com</a>><br>
# Date 1496390566 -19800<br>
# Fri Jun 02 13:32:46 2017 +0530<br>
# Node ID 4f0d56f5faf7eeba55a97f276e4af2<wbr>f147258522<br>
# Parent f850cdbe381c196758fd445a367487<wbr>416fef62f9<br>
csv: add scenecut information and improve docs<br></blockquote><div><br></div><div>Pushed to default branch</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r f850cdbe381c -r 4f0d56f5faf7 doc/reST/cli.rst<br>
--- a/doc/reST/cli.rst Tue May 23 12:42:54 2017 +0530<br>
+++ b/doc/reST/cli.rst Fri Jun 02 13:32:46 2017 +0530<br>
@@ -83,9 +83,45 @@<br>
it adds one line per run. If :option:`--csv-log-level` is greater than<br>
0, it writes one line per frame. Default none<br>
<br>
+ The following statistics are available when :option:`--csv-log-level` is<br>
+ greater than or equal to 1:<br>
+<br>
+ **Encode Order** The frame order in which the encoder encodes.<br>
+<br>
+ **Type** Slice type of the frame.<br>
+<br>
+ **POC** Picture Order Count - The display order of the frames.<br>
+<br>
+ **QP** Quantization Parameter decided for the frame.<br>
+<br>
+ **Bits** Number of bits consumed by the frame.<br>
+<br>
+ **Scenecut** 1 if the frame is a scenecut, 0 otherwise.<br>
+<br>
+ **RateFactor** Applicable only when CRF is enabled. The rate factor depends<br>
+ on the CRF given by the user. This is used to determine the QP so as to<br>
+ target a certain quality.<br>
+<br>
+ **BufferFill** Bits available for the next frame. Includes bits carried<br>
+ over from the current frame.<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>
+ **PSNR** Peak signal to noise ratio for Y, U and V planes.<br>
+<br>
+ **SSIM** A quality metric that denotes the structural similarity between frames.<br>
+<br>
+ **Ref lists** POC of references in lists 0 and 1 for the frame.<br>
+<br>
Several statistics about the encoded bitstream and encoder performance are<br>
available when :option:`--csv-log-level` is greater than or equal to 2:<br>
<br>
+ **I/P cost ratio:** The ratio between the cost when a frame is decided as an<br>
+ I frame to that when it is decided as a P frame as computed from the<br>
+ quarter-resolution frame in look-ahead. This, in combination with other parameters<br>
+ such as position of the frame in the GOP, is used to decide scene transitions.<br>
+<br>
**Analysis statistics:**<br>
<br>
**CU Statistics** percentage of CU modes.<br>
@@ -132,6 +168,8 @@<br>
**Stall Time ms** the number of milliseconds of the reported wall<br>
time that were spent with zero worker threads, aka all compression<br>
was completely stalled.<br>
+<br>
+ **Total frame time** Total time spent to encode the frame.<br>
<br>
**Avg WPP** the average number of worker threads working on this<br>
frame, at any given time. This value is sampled at the completion of<br>
diff -r f850cdbe381c -r 4f0d56f5faf7 source/common/framedata.h<br>
--- a/source/common/framedata.h Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/common/framedata.h Fri Jun 02 13:32:46 2017 +0530<br>
@@ -62,6 +62,7 @@<br>
double percentMergeCu[NUM_CU_DEPTH];<br>
double percentIntraDistribution[NUM_<wbr>CU_DEPTH][INTRA_MODES];<br>
double percentInterDistribution[NUM_<wbr>CU_DEPTH][3]; // 2Nx2N, RECT, AMP modes percentage<br>
+ double ipCostRatio;<br>
<br>
uint64_t cntIntraNxN;<br>
uint64_t totalCu;<br>
diff -r f850cdbe381c -r 4f0d56f5faf7 source/common/lowres.h<br>
--- a/source/common/lowres.h Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/common/lowres.h Fri Jun 02 13:32:46 2017 +0530<br>
@@ -118,6 +118,8 @@<br>
bool bKeyframe;<br>
bool bLastMiniGopBFrame;<br>
<br>
+ double ipCostRatio;<br>
+<br>
/* lookahead output data */<br>
int64_t costEst[X265_BFRAME_MAX + 2][X265_BFRAME_MAX + 2];<br>
int64_t costEstAq[X265_BFRAME_MAX + 2][X265_BFRAME_MAX + 2];<br>
diff -r f850cdbe381c -r 4f0d56f5faf7 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/encoder/encoder.cpp Fri Jun 02 13:32:46 2017 +0530<br>
@@ -1723,6 +1723,7 @@<br>
frameStats->qp = curEncData.m_avgQpAq;<br>
frameStats->bits = bits;<br>
frameStats->bScenecut = curFrame->m_lowres.bScenecut;<br>
+ frameStats->ipCostRatio = curFrame->m_lowres.<wbr>ipCostRatio;<br>
frameStats->bufferFill = m_rateControl->m_<wbr>bufferFillActual;<br>
frameStats->frameLatency = inPoc - poc;<br>
if (m_param->rc.rateControlMode == X265_RC_CRF)<br>
diff -r f850cdbe381c -r 4f0d56f5faf7 source/encoder/slicetype.cpp<br>
--- a/source/encoder/slicetype.cpp Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/encoder/slicetype.cpp Fri Jun 02 13:32:46 2017 +0530<br>
@@ -1638,6 +1638,13 @@<br>
m_isSceneTransition = false; /* Signal end of scene transitioning */<br>
}<br>
<br>
+ if (m_param->logLevel >= 2)<br>
+ {<br>
+ int64_t icost = frames[p1]->costEst[0][0];<br>
+ int64_t pcost = frames[p1]->costEst[p1 - p0][0];<br>
+ frames[p1]->ipCostRatio = (double)icost / pcost;<br>
+ }<br>
+<br>
/* A frame is always analysed with bRealScenecut = true first, and then bRealScenecut = false,<br>
the former for I decisions and the latter for P/B decisions. It's possible that the first<br>
analysis detected scenecuts which were later nulled due to scene transitioning, in which<br>
diff -r f850cdbe381c -r 4f0d56f5faf7 source/x265-extras.cpp<br>
--- a/source/x265-extras.cpp Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/x265-extras.cpp Fri Jun 02 13:32:46 2017 +0530<br>
@@ -62,6 +62,8 @@<br>
if (level)<br>
{<br>
fprintf(csvfp, "Encode Order, Type, POC, QP, Bits, Scenecut, ");<br>
+ if (level >= 2)<br>
+ fprintf(csvfp, "I/P cost ratio, ");<br>
if (param.rc.rateControlMode == X265_RC_CRF)<br>
fprintf(csvfp, "RateFactor, ");<br>
if (param.rc.vbvBufferSize)<br>
@@ -159,6 +161,8 @@<br>
const x265_frame_stats* frameStats = &pic.frameData;<br>
fprintf(csvfp, "%d, %c-SLICE, %4d, %2.2lf, %10d, %d,", frameStats->encoderOrder, frameStats->sliceType, frameStats->poc,<br>
frameStats->qp, (int)frameStats->bits, frameStats->bScenecut);<br>
+ if (level >= 2)<br>
+ fprintf(csvfp, "%.2f,", frameStats->ipCostRatio);<br>
if (param.rc.rateControlMode == X265_RC_CRF)<br>
fprintf(csvfp, "%.3lf,", frameStats->rateFactor);<br>
if (param.rc.vbvBufferSize)<br>
diff -r f850cdbe381c -r 4f0d56f5faf7 source/x265.h<br>
--- a/source/x265.h Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/x265.h Fri Jun 02 13:32:46 2017 +0530<br>
@@ -181,6 +181,7 @@<br>
<br>
char sliceType;<br>
int bScenecut;<br>
+ double ipCostRatio;<br>
int frameLatency;<br>
x265_cu_stats cuStats;<br>
x265_pu_stats puStats;<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>
</blockquote></div><br></div></div>