<div dir="ltr"># HG changeset patch<br># User Aruna Matheswaran<br># Date 1558620527 -19800<br># Thu May 23 19:38:47 2019 +0530<br># Node ID b57fe10e387942335fb88bc49e9d746a5d7503f3<br># Parent 220cdb4328a1e2c7419546b50c4d07e652ae1537<br>Introducing cli/param to signal content light level SEI. <div><br></div><div>Pushed to x265 default repo.</div><div><br></div><div>Thanks & Regards,</div><div>Dinesh <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 24, 2019 at 10:10 AM <<a href="mailto:aruna@multicorewareinc.com">aruna@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"># HG changeset patch<br>
# User Aruna Matheswaran<br>
# Date 1558620527 -19800<br>
# Thu May 23 19:38:47 2019 +0530<br>
# Node ID b57fe10e387942335fb88bc49e9d746a5d7503f3<br>
# Parent 220cdb4328a1e2c7419546b50c4d07e652ae1537<br>
Introducing cli/param to signal content light level SEI.<br>
<br>
This patch also fixes indentation issues.<br>
<br>
diff -r 220cdb4328a1 -r b57fe10e3879 doc/reST/cli.rst<br>
--- a/doc/reST/cli.rst Thu May 23 11:28:44 2019 +0800<br>
+++ b/doc/reST/cli.rst Thu May 23 19:38:47 2019 +0530<br>
@@ -2154,6 +2154,12 @@<br>
Note that this string value will need to be escaped or quoted to<br>
protect against shell expansion on many platforms. No default.<br>
<br>
+.. option:: --cll, --no-cll<br>
+<br>
+ Emit content light level SEI. Enabled automatically when :option:`--dolby-vision-profile` 8.1<br>
+ is specified. When enabled, signals max-cll and max-fall as 0 if :option:`max-cll` is unspecified.<br>
+ Default enabled.<br>
+<br>
.. option:: --hdr, --no-hdr<br>
<br>
Force signalling of HDR parameters in SEI packets. Enabled<br>
diff -r 220cdb4328a1 -r b57fe10e3879 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Thu May 23 11:28:44 2019 +0800<br>
+++ b/source/CMakeLists.txt Thu May 23 19:38:47 2019 +0530<br>
@@ -29,7 +29,7 @@<br>
option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br>
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
# X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 175)<br>
+set(X265_BUILD 176)<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 220cdb4328a1 -r b57fe10e3879 source/common/param.cpp<br>
--- a/source/common/param.cpp Thu May 23 11:28:44 2019 +0800<br>
+++ b/source/common/param.cpp Thu May 23 19:38:47 2019 +0530<br>
@@ -332,6 +332,7 @@<br>
/* SEI messages */<br>
param->preferredTransferCharacteristics = -1;<br>
param->pictureStructure = -1;<br>
+ param->bEmitCLL = 1;<br>
<br>
/* SVT Hevc Encoder specific params */<br>
param->bEnableSvtHevc = 0;<br>
@@ -573,10 +574,10 @@<br>
param->deblockingFilterBetaOffset = 1;<br>
param->deblockingFilterTCOffset = 1;<br>
}<br>
- else if (!strcmp(tune, "vmaf")) /*Adding vmaf for x265 + SVT-HEVC integration support*/<br>
- {<br>
- /*vmaf is under development, currently x265 won't support vmaf*/<br>
- }<br>
+ else if (!strcmp(tune, "vmaf")) /*Adding vmaf for x265 + SVT-HEVC integration support*/<br>
+ {<br>
+ /*vmaf is under development, currently x265 won't support vmaf*/<br>
+ }<br>
else<br>
return -1;<br>
}<br>
@@ -1269,6 +1270,7 @@<br>
#endif<br>
OPT("fades") p->bEnableFades = atobool(value);<br>
OPT("field") p->bField = atobool( value );<br>
+ OPT("cll") p->bEmitCLL = atobool(value);<br>
else<br>
return X265_PARAM_BAD_NAME;<br>
}<br>
@@ -2016,7 +2018,8 @@<br>
p->vui.defDispWinRightOffset, p->vui.defDispWinBottomOffset);<br>
if (p->masteringDisplayColorVolume)<br>
s += sprintf(s, " master-display=%s", p->masteringDisplayColorVolume);<br>
- s += sprintf(s, " max-cll=%hu,%hu", p->maxCLL, p->maxFALL);<br>
+ if (p->bEmitCLL)<br>
+ s += sprintf(s, "cll=%hu,%hu", p->maxCLL, p->maxFALL);<br>
s += sprintf(s, " min-luma=%hu", p->minLuma);<br>
s += sprintf(s, " max-luma=%hu", p->maxLuma);<br>
s += sprintf(s, " log2-max-poc-lsb=%d", p->log2MaxPocLsb);<br>
@@ -2314,6 +2317,7 @@<br>
else dst->masteringDisplayColorVolume = NULL;<br>
dst->maxLuma = src->maxLuma;<br>
dst->minLuma = src->minLuma;<br>
+ dst->bEmitCLL = src->bEmitCLL;<br>
dst->maxCLL = src->maxCLL;<br>
dst->maxFALL = src->maxFALL;<br>
dst->log2MaxPocLsb = src->log2MaxPocLsb;<br>
@@ -2439,7 +2443,7 @@<br>
svtHevcParam->frameRateNumerator = 0;<br>
svtHevcParam->frameRateDenominator = 0;<br>
svtHevcParam->encoderBitDepth = 8;<br>
- svtHevcParam->encoderColorFormat = EB_YUV420;<br>
+ svtHevcParam->encoderColorFormat = EB_YUV420;<br>
svtHevcParam->compressedTenBitFormat = 0;<br>
svtHevcParam->rateControlMode = 0;<br>
svtHevcParam->sceneChangeDetection = 1;<br>
@@ -2477,11 +2481,11 @@<br>
svtHevcParam->maxCLL = 0;<br>
svtHevcParam->maxFALL = 0;<br>
svtHevcParam->useMasteringDisplayColorVolume = 0;<br>
- svtHevcParam->useNaluFile = 0;<br>
- svtHevcParam->whitePointX = 0;<br>
- svtHevcParam->whitePointY = 0;<br>
- svtHevcParam->maxDisplayMasteringLuminance = 0;<br>
- svtHevcParam->minDisplayMasteringLuminance = 0;<br>
+ svtHevcParam->useNaluFile = 0;<br>
+ svtHevcParam->whitePointX = 0;<br>
+ svtHevcParam->whitePointY = 0;<br>
+ svtHevcParam->maxDisplayMasteringLuminance = 0;<br>
+ svtHevcParam->minDisplayMasteringLuminance = 0;<br>
svtHevcParam->dolbyVisionProfile = 0;<br>
svtHevcParam->targetSocket = -1;<br>
svtHevcParam->logicalProcessors = 0;<br>
@@ -2513,7 +2517,7 @@<br>
else if (!strcmp(tune, "ssim")) svtHevcParam->tune = 1;<br>
else if (!strcmp(tune, "grain")) svtHevcParam->tune = 0;<br>
else if (!strcmp(tune, "animation")) svtHevcParam->tune = 0;<br>
- else if (!strcmp(tune, "vmaf")) svtHevcParam->tune = 2;<br>
+ else if (!strcmp(tune, "vmaf")) svtHevcParam->tune = 2;<br>
else if (!strcmp(tune, "zero-latency") || !strcmp(tune, "zerolatency")) svtHevcParam->latencyMode = 1;<br>
else return -1;<br>
}<br>
diff -r 220cdb4328a1 -r b57fe10e3879 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Thu May 23 11:28:44 2019 +0800<br>
+++ b/source/encoder/encoder.cpp Thu May 23 19:38:47 2019 +0530<br>
@@ -444,8 +444,6 @@<br>
<br>
m_nalList.m_annexB = !!m_param->bAnnexB;<br>
<br>
- m_emitCLLSEI = p->maxCLL || p->maxFALL || (p->dolbyProfile == 81);<br>
-<br>
if (m_param->naluFile)<br>
{<br>
m_naluFile = x265_fopen(m_param->naluFile, "r");<br>
@@ -2462,10 +2460,13 @@<br>
<br>
if (m_param->bEmitHDRSEI)<br>
{<br>
- SEIContentLightLevel cllsei;<br>
- cllsei.max_content_light_level = m_param->maxCLL;<br>
- cllsei.max_pic_average_light_level = m_param->maxFALL;<br>
- cllsei.writeSEImessages(bs, m_sps, NAL_UNIT_PREFIX_SEI, list, m_param->bSingleSeiNal);<br>
+ if (m_param->bEmitCLL)<br>
+ {<br>
+ SEIContentLightLevel cllsei;<br>
+ cllsei.max_content_light_level = m_param->maxCLL;<br>
+ cllsei.max_pic_average_light_level = m_param->maxFALL;<br>
+ cllsei.writeSEImessages(bs, m_sps, NAL_UNIT_PREFIX_SEI, list, m_param->bSingleSeiNal);<br>
+ }<br>
<br>
if (m_param->masteringDisplayColorVolume)<br>
{<br>
@@ -2711,7 +2712,7 @@<br>
p->vui.matrixCoeffs = dovi[doviProfile].matrixCoeffs;<br>
<br>
if (dovi[doviProfile].doviProfileId == 81)<br>
- p->bEmitHDRSEI = 1;<br>
+ p->bEmitHDRSEI = p->bEmitCLL = 1;<br>
<br>
if (dovi[doviProfile].doviProfileId == 50)<br>
p->crQpOffset = 3;<br>
diff -r 220cdb4328a1 -r b57fe10e3879 source/encoder/encoder.h<br>
--- a/source/encoder/encoder.h Thu May 23 11:28:44 2019 +0800<br>
+++ b/source/encoder/encoder.h Thu May 23 19:38:47 2019 +0530<br>
@@ -203,7 +203,6 @@<br>
ScalingList m_scalingList; // quantization matrix information<br>
Window m_conformanceWindow;<br>
<br>
- bool m_emitCLLSEI;<br>
bool m_bZeroLatency; // x265_encoder_encode() returns NALs for the input picture, zero lag<br>
bool m_aborted; // fatal error detected<br>
bool m_reconfigure; // Encoder reconfigure in progress<br>
diff -r 220cdb4328a1 -r b57fe10e3879 source/x265.h<br>
--- a/source/x265.h Thu May 23 11:28:44 2019 +0800<br>
+++ b/source/x265.h Thu May 23 19:38:47 2019 +0530<br>
@@ -1780,6 +1780,9 @@<br>
<br>
/* Enable field coding */<br>
int bField;<br>
+<br>
+ /*Emit content light level info SEI*/<br>
+ int bEmitCLL;<br>
} x265_param;<br>
/* x265_param_alloc:<br>
* Allocates an x265_param instance. The returned param structure is not<br>
diff -r 220cdb4328a1 -r b57fe10e3879 source/x265cli.h<br>
--- a/source/x265cli.h Thu May 23 11:28:44 2019 +0800<br>
+++ b/source/x265cli.h Thu May 23 19:38:47 2019 +0530<br>
@@ -336,6 +336,8 @@<br>
{ "svt-fps-in-vps", no_argument , NULL, 0 },<br>
{ "no-svt-fps-in-vps", no_argument , NULL, 0 },<br>
#endif<br>
+ { "cll", no_argument, NULL, 0 },<br>
+ { "no-cll", no_argument, NULL, 0 },<br>
{ 0, 0, 0, 0 },<br>
{ 0, 0, 0, 0 },<br>
{ 0, 0, 0, 0 },<br>
@@ -602,7 +604,8 @@<br>
H1(" --chromaloc <integer> Specify chroma sample location (0 to 5). Default of %d\n", param->vui.chromaSampleLocTypeTopField);<br>
H0(" --master-display <string> SMPTE ST 2086 master display color volume info SEI (HDR)\n");<br>
H0(" format: G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)\n");<br>
- H0(" --max-cll <string> Emit content light level info SEI as \"cll,fall\" (HDR)\n");<br>
+ H0(" --max-cll <string> Specify content light level info SEI as \"cll,fall\" (HDR).\n");<br>
+ H0(" --[no-]cll Emit content light level info SEI. Default %s\n", OPT(param->bEmitCLL));<br>
H0(" --[no-]hdr Control dumping of HDR SEI packet. If max-cll or master-display has non-zero values, this is enabled. Default %s\n", OPT(param->bEmitHDRSEI));<br>
H0(" --[no-]hdr-opt Add luma and chroma offsets for HDR/WCG content. Default %s\n", OPT(param->bHDROpt));<br>
H0(" --min-luma <integer> Minimum luma plane value of input source picture\n");<br>
_______________________________________________<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>