From efcc1e50cf49186f3fd4784f5b72f6d2ded5a7a8 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 17 Feb 2023 16:09:10 +0100 Subject: [PATCH] tone_mapping: don't pick ST2094 for inverse tone-mapping This has no inverse curve, so don't default `auto` to it. --- src/tone_mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tone_mapping.c b/src/tone_mapping.c index 4e5e9f62..1dcbd746 100644 --- a/src/tone_mapping.c +++ b/src/tone_mapping.c @@ -116,7 +116,7 @@ void pl_tone_map_params_infer(struct pl_tone_map_params *par) float src_max = pl_hdr_rescale(par->input_scaling, PL_HDR_NORM, par->input_max); float dst_max = pl_hdr_rescale(par->output_scaling, PL_HDR_NORM, par->output_max); float ratio = src_max / dst_max; - if (par->hdr.ootf.num_anchors || par->hdr.scene_avg) { + if ((par->hdr.ootf.num_anchors || par->hdr.scene_avg) && ratio > 1) { // HDR10+ metadata available: Pick SMPTE ST2094-40 par->function = &pl_tone_map_st2094_40; } else if (ratio > 10) {