aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Mather <johnmather@sidefx.com>2023-10-02 13:20:49 -0400
committerJan Ekström <jeebjp@gmail.com>2023-10-11 21:50:47 +0300
commita2175ca8615d09418564fcff63c85e18dd993ad1 (patch)
tree0d467909612b6e5097fee0f0fd3a46ba8401aa7a
parent7251dfdcee2f2ec83d9de10334257531762fe42b (diff)
downloadffmpeg-a2175ca8615d09418564fcff63c85e18dd993ad1.tar.gz
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.
-rw-r--r--libavcodec/libkvazaar.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 0ebf37607a..0711d9ab38 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -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)) {