"HEVC HDR UHDTV Bitstreams using HLG10 shall also contain the
alternative_transfer_characteristics SEI message. The
alternative_transfer_characteristics SEI message shall be inserted on
the HEVC DVB_RAP, and preferred_transfer_characteristics shall be set
equal to "18", indicating Recommendation ITU-R BT. 2100 [45] HLG
system."
Signed-off-by: Zhong Li <zhongli_dev@126.com>
// x265 validates the parameters internally
ctx->params->vui.colorPrimaries = avctx->color_primaries;
ctx->params->vui.transferCharacteristics = avctx->color_trc;
+#if X265_BUILD >= 159
+ if (avctx->color_trc == AVCOL_TRC_ARIB_STD_B67)
+ ctx->params->preferredTransferCharacteristics = ctx->params->vui.transferCharacteristics;
+#endif
ctx->params->vui.matrixCoeffs = avctx->colorspace;
}