1
0
Fork 0

avcodec/libkvazaar: Respect codec context color settings.

This patch makes the libkvazaar encoder respect color settings that are
present on the codec context, including color range, primaries, transfer
function and colorspace.
This commit is contained in:
John Mather 2023-10-02 13:20:49 -04:00 committed by Jan Ekström
parent 7251dfdcee
commit a2175ca861
1 changed files with 7 additions and 0 deletions

View File

@ -101,6 +101,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
cfg->rc_algorithm = KVZ_LAMBDA;
}
cfg->vui.fullrange = avctx->color_range == AVCOL_RANGE_JPEG;
cfg->vui.colorprim = avctx->color_primaries;
cfg->vui.transfer = avctx->color_trc;
cfg->vui.colormatrix = avctx->colorspace;
if (avctx->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)
cfg->vui.chroma_loc = avctx->chroma_sample_location - 1;
if (ctx->kvz_params) {
AVDictionary *dict = NULL;
if (!av_dict_parse_string(&dict, ctx->kvz_params, "=", ",", 0)) {