This patch makes the libkvazaar encoder respect color settings that are present on the codec context, including color range, primaries, transfer function and colorspace.
Unified · Split
| @@ -101,6 +101,13 @@ FF_ENABLE_DEPRECATION_WARNINGS · 100 unmodified lines | |||
| 101 | cfg->rc_algorithm = KVZ_LAMBDA; | 101 | cfg->rc_algorithm = KVZ_LAMBDA; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | cfg->vui.fullrange = avctx->color_range == AVCOL_RANGE_JPEG; | ||
| 105 | cfg->vui.colorprim = avctx->color_primaries; | ||
| 106 | cfg->vui.transfer = avctx->color_trc; | ||
| 107 | cfg->vui.colormatrix = avctx->colorspace; | ||
| 108 | if (avctx->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED) | ||
| 109 | cfg->vui.chroma_loc = avctx->chroma_sample_location - 1; | ||
| 110 | |||
| 104 | if (ctx->kvz_params) { | 111 | if (ctx->kvz_params) { |
| 105 | AVDictionary *dict = NULL; | 112 | AVDictionary *dict = NULL; |
| 106 | if (!av_dict_parse_string(&dict, ctx->kvz_params, "=", ",", 0)) { | 113 | if (!av_dict_parse_string(&dict, ctx->kvz_params, "=", ",", 0)) { |