x265enc: Specify colorimetry related VUI parameters

Set the colorimetry config for the information to be embedded in encodec bitstream.
This commit is contained in:
Seungha Yang 2019-07-17 22:42:10 +09:00
parent 8753561015
commit d6680b35b4

View file

@ -676,6 +676,23 @@ gst_x265_enc_init_encoder (GstX265Enc * encoder)
encoder->x265param.vui.sarHeight = info->par_d; encoder->x265param.vui.sarHeight = info->par_d;
} }
encoder->x265param.vui.bEnableVideoSignalTypePresentFlag = 1;
/* Unspecified video format (5) */
encoder->x265param.vui.videoFormat = 5;
if (info->colorimetry.range == GST_VIDEO_COLOR_RANGE_0_255) {
encoder->x265param.vui.bEnableVideoFullRangeFlag = 1;
} else {
encoder->x265param.vui.bEnableVideoFullRangeFlag = 0;
}
encoder->x265param.vui.bEnableColorDescriptionPresentFlag = 1;
encoder->x265param.vui.matrixCoeffs =
gst_video_color_matrix_to_iso (info->colorimetry.matrix);
encoder->x265param.vui.colorPrimaries =
gst_video_color_primaries_to_iso (info->colorimetry.primaries);
encoder->x265param.vui.transferCharacteristics =
gst_video_color_transfer_to_iso (info->colorimetry.transfer);
if (encoder->qp != -1) { if (encoder->qp != -1) {
/* CQP */ /* CQP */
encoder->x265param.rc.qp = encoder->qp; encoder->x265param.rc.qp = encoder->qp;