lavc/vaapi_encode_av1: insert HDR_CLL metadata if have

Only look for HDR_CLL on key frame on the output.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
This commit is contained in:
Haihao Xiang 2024-04-10 16:24:57 +08:00
parent 0bdf71ada7
commit ceace488ff
1 changed files with 15 additions and 0 deletions

View File

@ -707,6 +707,21 @@ static int vaapi_encode_av1_init_picture_params(AVCodecContext *avctx,
mdm->min_luminance.den);
}
}
sd = av_frame_get_side_data(pic->input_image,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL);
if (sd) {
AVContentLightMetadata *cllm = (AVContentLightMetadata *)sd->data;
AV1RawOBU *obu = &priv->mh[priv->nb_mh++];
AV1RawMetadata *md = &obu->obu.metadata;
AV1RawMetadataHDRCLL *cll = &md->metadata.hdr_cll;
memset(obu, 0, sizeof(*obu));
obu->header.obu_type = AV1_OBU_METADATA;
md->metadata_type = AV1_METADATA_TYPE_HDR_CLL;
cll->max_cll = cllm->MaxCLL;
cll->max_fall = cllm->MaxFALL;
}
}
end: