From 5e1e7d32e83861981b777faeb9f764c163b46c68 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 3 Aug 2017 12:46:57 +0200 Subject: vo_opengl: generalize HDR tone mapping to gamut mapping Since this code was already written for HDR, and is now per-channel (because it works better for HDR as well), we can actually reuse this to get very high quality gamut mapping without clipping. The only required change is to move the tone mapping from before the gamut map to after the gamut map. Additonally, we need to also account for changes in the signal range as a result of applying the CMS when we compute ref_peak, which is fortunately pretty easy because we only need to consider the case of primaries mapping to themselves. Since `HDR` no longer really makes sense as a label, rename it to `--tone-mapping` in general. Also fits better with `--tone-mapping-desat` etc. Arguably we could also rename `--hdr-compute-peak`, but that option is basically only useful for HDR content anyway because we don't need information about the signal range for gamut mapping. This (finally!) gives us reasonably high quality gamut mapping even in the absence of an ICC profile / 3DLUT. --- video/out/opengl/video.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video/out/opengl/video.h') diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h index 5b50cdd3f2..d74f3cf576 100644 --- a/video/out/opengl/video.h +++ b/video/out/opengl/video.h @@ -110,7 +110,7 @@ struct gl_video_opts { int target_prim; int target_trc; int target_brightness; - int hdr_tone_mapping; + int tone_mapping; int compute_hdr_peak; float tone_mapping_param; float tone_mapping_desat; -- cgit v1.2.3