[FFmpeg-cvslog] avcodec/libkvazaar: Respect codec context color settings.
John Mather
git at videolan.org
Wed Oct 11 21:53:56 EEST 2023
ffmpeg | branch: master | John Mather <johnmather at sidefx.com> | Mon Oct 2 13:20:49 2023 -0400| [a2175ca8615d09418564fcff63c85e18dd993ad1] | committer: Jan Ekström
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2175ca8615d09418564fcff63c85e18dd993ad1
---
libavcodec/libkvazaar.c | 7 +++++++
1 file changed, 7 insertions(+)
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)) {
More information about the ffmpeg-cvslog
mailing list