summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2018-12-27 18:34:19 +0100
committerJan Ekström <jeebjp@gmail.com>2019-02-18 01:54:06 +0200
commit3fe882d4ae80fa060a71dad0d6d1605afcfe98b6 (patch)
tree56c1a100c373d4a7800f3c016ba7b79e0306c4db /video/out/gpu/video.h
parent36600ff1633871a996fe05b8e0ff0b22c2ebb0f9 (diff)
downloadmpv-3fe882d4ae80fa060a71dad0d6d1605afcfe98b6.tar.bz2
mpv-3fe882d4ae80fa060a71dad0d6d1605afcfe98b6.tar.xz
vo_gpu: improve tone mapping desaturation
Instead of desaturating towards luma, we desaturate towards the per-channel tone mapped version. This essentially proves a smooth roll-off towards the "hollywood"-style (non-chromatic) tone mapping algorithm, which works better for bright content, while continuing to use the "linear" style (chromatic) tone mapping algorithm for primarily in-gamut content. We also split up the desaturation algorithm into strength and exponent, which allows users to use less aggressive desaturation settings without affecting the overall curve.
Diffstat (limited to 'video/out/gpu/video.h')
-rw-r--r--video/out/gpu/video.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/video/out/gpu/video.h b/video/out/gpu/video.h
index ca8b6f65d4..ee5c0a2861 100644
--- a/video/out/gpu/video.h
+++ b/video/out/gpu/video.h
@@ -98,6 +98,15 @@ enum tone_mapping {
// How many frames to average over for HDR peak detection
#define PEAK_DETECT_FRAMES 63
+struct gl_tone_map_opts {
+ int curve;
+ float curve_param;
+ int compute_peak;
+ float desat;
+ float desat_exp;
+ int gamut_warning; // bool
+};
+
struct gl_video_opts {
int dumb_mode;
struct scaler_config scaler[4];
@@ -107,11 +116,7 @@ struct gl_video_opts {
int target_prim;
int target_trc;
int target_peak;
- int tone_mapping;
- int compute_hdr_peak;
- float tone_mapping_param;
- float tone_mapping_desat;
- int gamut_warning;
+ struct gl_tone_map_opts tone_map;
int correct_downscaling;
int linear_downscaling;
int linear_upscaling;