<div dir="ltr">Pushed to default.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 7, 2020 at 5:44 PM Aruna Matheswaran <<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 <<a href="mailto:aruna@multicorewareinc.com" target="_blank">aruna@multicorewareinc.com</a>><br>
# Date 1578287653 -19800<br>
# Mon Jan 06 10:44:13 2020 +0530<br>
# Node ID 542653f9c733c0b41d33e204497bed1126455d17<br>
# Parent b82891180e7e9e13545791f739837d977d472d43<br>
hdr-opt: Replace --hdr-opt with --hdr10-opt<br>
<br>
This patch deprecates the existing option '--hdr-opt' as the name sounds generic<br>
even though the feature does QP optimizations only for HDR10 content and<br>
introduces '--hdr10-opt' as an alternate.<br>
<br>
This patch also fixes nits in a warning message.<br>
<br>
Note: '--hdr-opt' will be removed in the upcoming major release of x265.<br>
<br>
diff -r b82891180e7e -r 542653f9c733 doc/reST/cli.rst<br>
--- a/doc/reST/cli.rst Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/doc/reST/cli.rst Mon Jan 06 10:44:13 2020 +0530<br>
@@ -2259,11 +2259,13 @@<br>
specified. Useful when there is a desire to signal 0 values for max-cll<br>
and max-fall. Default disabled.<br>
<br>
-.. option:: --hdr-opt, --no-hdr-opt<br>
-<br>
- Add luma and chroma offsets for HDR/WCG content.<br>
- Input video should be 10 bit 4:2:0. Applicable for HDR content. It is recommended<br>
- that AQ-mode be enabled along with this feature. Default disabled.<br>
+.. option:: --hdr10-opt, --no-hdr10-opt<br>
+<br>
+ Enable block-level luma and chroma QP optimization for HDR10 content<br>
+ as suggested in ITU-T H-series Recommendations – Supplement 15.<br>
+ Source video should have HDR10 characteristics such as 10-bit depth 4:2:0<br>
+ with Bt.2020 color primaries and SMPTE ST.2084 transfer characteristics.<br>
+ It is recommended that AQ-mode be enabled along with this feature. Default disabled.<br>
<br>
.. option:: --dhdr10-info <filename><br>
<br>
diff -r b82891180e7e -r 542653f9c733 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/source/CMakeLists.txt Mon Jan 06 10:44:13 2020 +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 186)<br>
+set(X265_BUILD 187)<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 b82891180e7e -r 542653f9c733 source/common/param.cpp<br>
--- a/source/common/param.cpp Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/source/common/param.cpp Mon Jan 06 10:44:13 2020 +0530<br>
@@ -322,7 +322,8 @@<br>
param->bOptRefListLengthPPS = 0;<br>
param->bOptCUDeltaQP = 0;<br>
param->bAQMotion = 0;<br>
- param->bHDROpt = 0;<br>
+ param->bHDROpt = 0; /*DEPRECATED*/<br>
+ param->bHDR10Opt = 0;<br>
param->analysisReuseLevel = 0; /*DEPRECATED*/<br>
param->analysisSaveReuseLevel = 0;<br>
param->analysisLoadReuseLevel = 0;<br>
@@ -1244,7 +1245,8 @@<br>
}<br>
}<br>
OPT("hdr") p->bEmitHDRSEI = atobool(value);<br>
- OPT("hdr-opt") p->bHDROpt = atobool(value);<br>
+ OPT("hdr-opt") p->bHDR10Opt = atobool(value); /*DEPRECATED*/<br>
+ OPT("hdr10-opt") p->bHDR10Opt = atobool(value);<br>
OPT("limit-sao") p->bLimitSAO = atobool(value);<br>
OPT("dhdr10-info") p->toneMapFile = strdup(value);<br>
OPT("dhdr10-opt") p->bDhdr10opt = atobool(value);<br>
@@ -2169,7 +2171,7 @@<br>
BOOL(p->bOptCUDeltaQP, "opt-cu-delta-qp");<br>
BOOL(p->bAQMotion, "aq-motion");<br>
BOOL(p->bEmitHDRSEI, "hdr");<br>
- BOOL(p->bHDROpt, "hdr-opt");<br>
+ BOOL(p->bHDR10Opt, "hdr10-opt");<br>
BOOL(p->bDhdr10opt, "dhdr10-opt");<br>
BOOL(p->bEmitIDRRecoverySEI, "idr-recovery-sei");<br>
if (p->analysisSave)<br>
@@ -2495,7 +2497,8 @@<br>
dst->dynamicRd = src->dynamicRd;<br>
dst->bEmitHDRSEI = src->bEmitHDRSEI;<br>
dst->bEmitHRDSEI = src->bEmitHRDSEI;<br>
- dst->bHDROpt = src->bHDROpt;<br>
+ dst->bHDROpt = src->bHDROpt; /*DEPRECATED*/<br>
+ dst->bHDR10Opt = src->bHDR10Opt;<br>
dst->analysisReuseLevel = src->analysisReuseLevel;<br>
dst->analysisSaveReuseLevel = src->analysisSaveReuseLevel;<br>
dst->analysisLoadReuseLevel = src->analysisLoadReuseLevel;<br>
diff -r b82891180e7e -r 542653f9c733 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/source/encoder/encoder.cpp Mon Jan 06 10:44:13 2020 +0530<br>
@@ -3281,7 +3281,7 @@<br>
<br>
pps->chromaQpOffset[0] = m_param->cbQpOffset;<br>
pps->chromaQpOffset[1] = m_param->crQpOffset;<br>
- pps->pps_slice_chroma_qp_offsets_present_flag = m_param->bHDROpt;<br>
+ pps->pps_slice_chroma_qp_offsets_present_flag = m_param->bHDR10Opt;<br>
<br>
pps->bConstrainedIntraPred = m_param->bEnableConstrainedIntra;<br>
pps->bUseWeightPred = m_param->bEnableWeightedPred;<br>
@@ -3747,7 +3747,7 @@<br>
<br>
if (!p->rc.bStatWrite && !p->rc.bStatRead && (p->analysisMultiPassRefine || p->analysisMultiPassDistortion))<br>
{<br>
- x265_log(p, X265_LOG_WARNING, "analysis-multi-pass/distortion is enabled only when rc multi pass is enabled. Disabling multi-pass-opt-analysis and multi-pass-opt-distortion");<br>
+ x265_log(p, X265_LOG_WARNING, "analysis-multi-pass/distortion is enabled only when rc multi pass is enabled. Disabling multi-pass-opt-analysis and multi-pass-opt-distortion\n");<br>
p->analysisMultiPassRefine = 0;<br>
p->analysisMultiPassDistortion = 0;<br>
}<br>
@@ -4072,21 +4072,21 @@<br>
x265_log(p, X265_LOG_WARNING, "maxSlices can not be more than min(rows, MAX_NAL_UNITS-1), force set to %d\n", slicesLimit);<br>
p->maxSlices = slicesLimit;<br>
}<br>
- if (p->bHDROpt)<br>
+ if (p->bHDR10Opt)<br>
{<br>
if (p->internalCsp != X265_CSP_I420 || p->internalBitDepth != 10 || p->vui.colorPrimaries != 9 ||<br>
p->vui.transferCharacteristics != 16 || p->vui.matrixCoeffs != 9)<br>
{<br>
- x265_log(p, X265_LOG_ERROR, "Recommended Settings for HDR: colour primaries should be BT.2020,\n"<br>
+ x265_log(p, X265_LOG_ERROR, "Recommended Settings for HDR10-opt: colour primaries should be BT.2020,\n"<br>
" transfer characteristics should be SMPTE ST.2084,\n"<br>
" matrix coeffs should be BT.2020,\n"<br>
" the input video should be 10 bit 4:2:0\n"<br>
- " Disabling offset tuning for HDR videos\n");<br>
- p->bHDROpt = 0;<br>
+ " Disabling hdr10-opt.\n");<br>
+ p->bHDR10Opt = 0;<br>
}<br>
}<br>
<br>
- if (m_param->toneMapFile || p->bHDROpt || p->bEmitHDRSEI)<br>
+ if (m_param->toneMapFile || p->bHDR10Opt || p->bEmitHDRSEI)<br>
{<br>
if (!p->bRepeatHeaders)<br>
{<br>
diff -r b82891180e7e -r 542653f9c733 source/encoder/frameencoder.cpp<br>
--- a/source/encoder/frameencoder.cpp Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/source/encoder/frameencoder.cpp Mon Jan 06 10:44:13 2020 +0530<br>
@@ -591,7 +591,7 @@<br>
<br>
/* Clip slice QP to 0-51 spec range before encoding */<br>
slice->m_sliceQp = x265_clip3(-QP_BD_OFFSET, QP_MAX_SPEC, qp);<br>
- if (m_param->bHDROpt)<br>
+ if (m_param->bHDR10Opt)<br>
{<br>
int qpCb = x265_clip3(-12, 0, (int)floor((m_top->m_cB * ((-.46) * qp + 9.26)) + 0.5 ));<br>
int qpCr = x265_clip3(-12, 0, (int)floor((m_top->m_cR * ((-.46) * qp + 9.26)) + 0.5 ));<br>
diff -r b82891180e7e -r 542653f9c733 source/encoder/slicetype.cpp<br>
--- a/source/encoder/slicetype.cpp Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/source/encoder/slicetype.cpp Mon Jan 06 10:44:13 2020 +0530<br>
@@ -593,7 +593,7 @@<br>
qp_adj = strength * (X265_LOG2(X265_MAX(energy, 1)) - (modeOneConst + 2 * (X265_DEPTH - 8)));<br>
}<br>
<br>
- if (param->bHDROpt)<br>
+ if (param->bHDR10Opt)<br>
{<br>
uint32_t sum = lumaSumCu(curFrame, blockX, blockY, param->rc.qgSize);<br>
uint32_t lumaAvg = sum / (loopIncr * loopIncr);<br>
diff -r b82891180e7e -r 542653f9c733 source/x265.h<br>
--- a/source/x265.h Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/source/x265.h Mon Jan 06 10:44:13 2020 +0530<br>
@@ -1653,7 +1653,7 @@<br>
int bEmitHDRSEI;<br>
<br>
/* Enable luma and chroma offsets for HDR/WCG content.<br>
- * Default is disabled */<br>
+ * Default is disabled. Now deprecated.*/<br>
int bHDROpt;<br>
<br>
/* A value between 1 and 10 (both inclusive) determines the level of<br>
@@ -1893,6 +1893,9 @@<br>
* from the corresponding analysis-save. */<br>
<br>
int confWinBottomOffset;<br>
+<br>
+ /* Block-level QP optimization for HDR10 content. Default is disabled.*/<br>
+ int bHDR10Opt;<br>
} x265_param;<br>
<br>
/* x265_param_alloc:<br>
diff -r b82891180e7e -r 542653f9c733 source/x265cli.h<br>
--- a/source/x265cli.h Mon Jan 06 23:08:36 2020 +0530<br>
+++ b/source/x265cli.h Mon Jan 06 10:44:13 2020 +0530<br>
@@ -301,6 +301,8 @@<br>
{ "no-hdr", no_argument, NULL, 0 },<br>
{ "hdr-opt", no_argument, NULL, 0 },<br>
{ "no-hdr-opt", no_argument, NULL, 0 },<br>
+ { "hdr10-opt", no_argument, NULL, 0 },<br>
+ { "no-hdr10-opt", no_argument, NULL, 0 },<br>
{ "limit-sao", no_argument, NULL, 0 },<br>
{ "no-limit-sao", no_argument, NULL, 0 },<br>
{ "dhdr10-info", required_argument, NULL, 0 },<br>
@@ -635,7 +637,8 @@<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(" --[no-]hdr-opt Add luma and chroma offsets for HDR/WCG content. Default %s. Now deprecated.\n", OPT(param->bHDROpt));<br>
+ H0(" --[no-]HDR10-opt Block-level QP optimization for HDR10 content. Default %s.\n", OPT(param->bHDR10Opt));<br>
H0(" --min-luma <integer> Minimum luma plane value of input source picture\n");<br>
H0(" --max-luma <integer> Maximum luma plane value of input source picture\n");<br>
H0("\nBitstream options:\n");<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><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>