<div dir="ltr">planning to re-organize performance tracking charts so we thought it would be helpful if we dump input sequence and preset info in separate columns.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 11, 2015 at 6:37 PM, <span dir="ltr"><<a href="mailto:mahesh@multicorewareinc.com" target="_blank">mahesh@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 Mahesh Pittala <<a href="mailto:mahesh@multicorewareinc.com">mahesh@multicorewareinc.com</a>><br>
# Date 1441976825 -19800<br>
# Fri Sep 11 18:37:05 2015 +0530<br>
# Node ID ee6208293726f96786389b342bc810557763bd26<br>
# Parent 365f7ed4d89628d49cd6af8d81d4edc01f73ffad<br>
csv: dump input sequence and preset info in csv<br>
<br>
diff -r 365f7ed4d896 -r ee6208293726 source/x265-extras.cpp<br>
--- a/source/x265-extras.cpp Tue Sep 08 16:38:01 2015 +0530<br>
+++ b/source/x265-extras.cpp Fri Sep 11 18:37:05 2015 +0530<br>
@@ -31,7 +31,7 @@<br>
using namespace X265_NS;<br>
<br>
static const char* summaryCSVHeader =<br>
- "Command, Date/Time, Elapsed Time, FPS, Bitrate, "<br>
+ "Input Sequence, Preset, Command, Date/Time, Elapsed Time, FPS, Bitrate, "<br>
"Y PSNR, U PSNR, V PSNR, Global PSNR, SSIM, SSIM (dB), "<br>
"I count, I ave-QP, I kbps, I-PSNR Y, I-PSNR U, I-PSNR V, I-SSIM (dB), "<br>
"P count, P ave-QP, P kbps, P-PSNR Y, P-PSNR U, P-PSNR V, P-SSIM (dB), "<br>
@@ -185,7 +185,7 @@<br>
fflush(stderr);<br>
}<br>
<br>
-void x265_csvlog_encode(FILE* csvfp, const x265_api& api, const x265_param& param, const x265_stats& stats, int level, int argc, char** argv)<br>
+void x265_csvlog_encode(FILE* csvfp, const x265_api& api, const x265_param& param, const x265_stats& stats, int level, int argc, char** argv, char *prst, const char *inputseq)<br>
{<br>
if (!csvfp)<br>
return;<br>
@@ -197,11 +197,31 @@<br>
fputs(summaryCSVHeader, csvfp);<br>
}<br>
<br>
+ // strip input sequence path<br>
+ char *tok;<br>
+ char *prevtok = NULL;<br>
+ char temp[256];<br>
+ strcpy(temp,inputseq);<br>
+ tok = strtok(temp,"\\://");<br>
+ while(tok != NULL)<br>
+ {<br>
+ prevtok = tok;<br>
+ tok = strtok(NULL,"//:\\");<br>
+ }<br>
+<br>
+ fputs(prevtok, csvfp);<br>
+ fputc(',', csvfp);<br>
+ if (prst == NULL)<br>
+ fputs("medium", csvfp);<br>
+ else<br>
+ fputs(prst, csvfp);<br>
+ fputc(',', csvfp);<br>
+<br>
// CLI arguments or other<br>
- for (int i = 1; i < argc; i++)<br>
- {<br>
- if (i) fputc(' ', csvfp);<br>
- fputs(argv[i], csvfp);<br>
+ for (int i = 1; i < argc; i++)<br>
+ {<br>
+ if (i) fputc(' ', csvfp);<br>
+ fputs(argv[i], csvfp);<br>
}<br>
<br>
// current date and time<br>
diff -r 365f7ed4d896 -r ee6208293726 source/x265-extras.h<br>
--- a/source/x265-extras.h Tue Sep 08 16:38:01 2015 +0530<br>
+++ b/source/x265-extras.h Fri Sep 11 18:37:05 2015 +0530<br>
@@ -53,7 +53,7 @@<br>
/* Log final encode statistics to the CSV file handle. 'argc' and 'argv' are<br>
* intended to be command line arguments passed to the encoder. Encode<br>
* statistics should be queried from the encoder just prior to closing it. */<br>
-LIBAPI void x265_csvlog_encode(FILE* csvfp, const x265_api& api, const x265_param& param, const x265_stats& stats, int level, int argc, char** argv);<br>
+LIBAPI void x265_csvlog_encode(FILE* csvfp, const x265_api& api, const x265_param& param, const x265_stats& stats, int level, int argc, char** argv, char * prst, const char *inputseq);<br>
<br>
/* In-place downshift from a bit-depth greater than 8 to a bit-depth of 8, using<br>
* the residual bits to dither each row. */<br>
diff -r 365f7ed4d896 -r ee6208293726 source/x265.cpp<br>
--- a/source/x265.cpp Tue Sep 08 16:38:01 2015 +0530<br>
+++ b/source/x265.cpp Fri Sep 11 18:37:05 2015 +0530<br>
@@ -90,6 +90,8 @@<br>
uint64_t totalbytes;<br>
int64_t startTime;<br>
int64_t prevUpdateTime;<br>
+ char *prst;<br>
+ const char *inputseq;<br>
<br>
/* in microseconds */<br>
static const int UPDATE_INTERVAL = 250000;<br>
@@ -113,6 +115,8 @@<br>
prevUpdateTime = 0;<br>
bDither = false;<br>
csvLogLevel = 0;<br>
+ prst = NULL;<br>
+ inputseq = NULL;<br>
}<br>
<br>
void destroy();<br>
@@ -194,7 +198,10 @@<br>
if (c == -1)<br>
break;<br>
else if (c == 'p')<br>
+ {<br>
preset = optarg;<br>
+ prst = optarg;<br>
+ }<br>
else if (c == 't')<br>
tune = optarg;<br>
else if (c == 'D')<br>
@@ -204,7 +211,6 @@<br>
else if (c == '?')<br>
bShowHelp = true;<br>
}<br>
-<br>
if (!outputBitDepth && profile)<br>
{<br>
/* try to derive the output bit depth from the requested profile */<br>
@@ -373,6 +379,7 @@<br>
info.sarHeight = param->vui.sarHeight;<br>
info.skipFrames = seek;<br>
info.frameCount = 0;<br>
+ inputseq = info.filename;<br>
getParamAspectRatio(param, info.sarWidth, info.sarHeight);<br>
<br>
this->input = InputFile::open(info, this->bForceY4m);<br>
@@ -715,7 +722,7 @@<br>
<br>
api->encoder_get_stats(encoder, &stats, sizeof(stats));<br>
if (cliopt.csvfpt && !b_ctrl_c)<br>
- x265_csvlog_encode(cliopt.csvfpt, *api, *param, stats, cliopt.csvLogLevel, argc, argv);<br>
+ x265_csvlog_encode(cliopt.csvfpt, *api, *param, stats, cliopt.csvLogLevel, argc, argv, cliopt.prst, cliopt.inputseq);<br>
api->encoder_close(encoder);<br>
<br>
int64_t second_largest_pts = 0;<br>
</blockquote></div><br></div>