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