<div dir="ltr"><div>No. maxCLL and maxFall are written into frame_stats regardless of user-input for now. <br><br></div>The user input p->contentLightLevelInfo is what gets written into the SEI, again, for now. We need to figure out a way to re-generate the content level SEI with stats->maxCLL and stats->maxFall. At that point, we'll also take a call on whether to ignore user-input maxCLL/maxFALL or disallow both options at the same time.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 14, 2015 at 3:20 PM, <span dir="ltr"><<a href="mailto:kavitha@multicorewareinc.com" target="_blank">kavitha@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 Kavitha Sampath <<a href="mailto:kavitha@multicorewareinc.com">kavitha@multicorewareinc.com</a>><br>
# Date 1439545723 -19800<br>
# Fri Aug 14 15:18:43 2015 +0530<br>
# Node ID f51276cb53f15b335112742fc48fe35009f4cb66<br>
# Parent d56b2466c04459205287e1581d8a36eebf372ba6<br>
stats: log maxCLL and maxFALL values calculated from input pictures<br>
<br>
diff -r d56b2466c044 -r f51276cb53f1 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Wed Aug 12 18:12:20 2015 +0530<br>
+++ b/source/encoder/encoder.cpp Fri Aug 14 15:18:43 2015 +0530<br>
@@ -1038,6 +1038,16 @@<br>
stats->statsB.psnrU = m_analyzeB.m_psnrSumU / (double)m_analyzeB.m_numPics;<br>
stats->statsB.psnrV = m_analyzeB.m_psnrSumV / (double)m_analyzeB.m_numPics;<br>
stats->statsB.ssim = x265_ssim2dB(m_analyzeB.m_globalSsim / (double)m_analyzeB.m_numPics);<br>
+<br>
+ if (!m_param->contentLightLevelInfo)<br>
+ {<br>
+ stats->maxCLL = m_analyzeAll.m_maxCLL;<br>
+ stats->maxFALL = (uint16_t)(m_analyzeAll.m_maxFALL / m_analyzeAll.m_numPics);<br>
+ }<br>
+ else<br>
+ {<br>
+ sscanf(m_param->contentLightLevelInfo, "%hu,%hu", &stats->maxCLL, &stats->maxFALL);<br>
+ }<br>
}<br>
<br>
/* If new statistics are added to x265_stats, we must check here whether the<br>
@@ -1111,6 +1121,12 @@<br>
m_analyzeB.addSsim(ssim);<br>
}<br>
<br>
+ if (!m_param->contentLightLevelInfo)<br>
+ {<br>
+ m_analyzeAll.m_maxFALL += curFrame->m_fencPic->m_avgLumaLevel;<br>
+ m_analyzeAll.m_maxCLL = X265_MAX(m_analyzeAll.m_maxCLL, curFrame->m_fencPic->m_maxLumaLevel);<br>
+ }<br>
+<br>
char c = (slice->isIntra() ? 'I' : slice->isInterP() ? 'P' : 'B');<br>
int poc = slice->m_poc;<br>
if (!IS_REFERENCED(curFrame))<br>
diff -r d56b2466c044 -r f51276cb53f1 source/encoder/encoder.h<br>
--- a/source/encoder/encoder.h Wed Aug 12 18:12:20 2015 +0530<br>
+++ b/source/encoder/encoder.h Fri Aug 14 15:18:43 2015 +0530<br>
@@ -47,6 +47,8 @@<br>
double m_totalQp;<br>
uint64_t m_accBits;<br>
uint32_t m_numPics;<br>
+ uint16_t m_maxCLL;<br>
+ double m_maxFALL;<br>
<br>
EncStats()<br>
{<br>
@@ -54,6 +56,8 @@<br>
m_accBits = 0;<br>
m_numPics = 0;<br>
m_totalQp = 0;<br>
+ m_maxCLL = 0;<br>
+ m_maxFALL = 0;<br>
}<br>
<br>
void addQP(double aveQp);<br>
diff -r d56b2466c044 -r f51276cb53f1 source/x265-extras.cpp<br>
--- a/source/x265-extras.cpp Wed Aug 12 18:12:20 2015 +0530<br>
+++ b/source/x265-extras.cpp Fri Aug 14 15:18:43 2015 +0530<br>
@@ -36,7 +36,7 @@<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>
"B count, B ave-QP, B kbps, B-PSNR Y, B-PSNR U, B-PSNR V, B-SSIM (dB), "<br>
- "Version\n";<br>
+ "MaxCLL, MaxFALL, Version\n";<br>
<br>
FILE* x265_csvlog_open(const x265_api& api, const x265_param& param, const char* fname, int level)<br>
{<br>
@@ -273,7 +273,7 @@<br>
else<br>
fprintf(csvfp, " -, -, -, -, -, -, -,");<br>
<br>
- fprintf(csvfp, " %s\n", api.version_str);<br>
+ fprintf(csvfp, " %-6u, %-6u, %s\n", stats.maxCLL, stats.maxFALL, api.version_str);<br>
}<br>
<br>
/* The dithering algorithm is based on Sierra-2-4A error diffusion. */<br>
diff -r d56b2466c044 -r f51276cb53f1 source/x265.h<br>
--- a/source/x265.h Wed Aug 12 18:12:20 2015 +0530<br>
+++ b/source/x265.h Fri Aug 14 15:18:43 2015 +0530<br>
@@ -385,6 +385,8 @@<br>
x265_sliceType_stats statsI; /* statistics of I slice */<br>
x265_sliceType_stats statsP; /* statistics of P slice */<br>
x265_sliceType_stats statsB; /* statistics of B slice */<br>
+ uint16_t maxCLL; /* maximum content light level */<br>
+ uint16_t maxFALL; /* maximum frame average light level */<br>
} x265_stats;<br>
<br>
/* String values accepted by x265_param_parse() (and CLI) for various parameters */<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>
</blockquote></div><br></div>