diff options
author | Niklas Haas <git@nand.wakku.to> | 2016-05-16 02:44:30 +0200 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2016-05-16 02:49:49 +0200 |
commit | e047cc0931a22d277d7ccd14588f905d7852f7e0 (patch) | |
tree | 6ad6d88295bf3b7ab045ce6befadd063bec84c81 /video/out/opengl/video.h | |
parent | 3cfe98c6848d888e06e5d402f9100d55ab09d755 (diff) | |
download | mpv-e047cc0931a22d277d7ccd14588f905d7852f7e0.tar.bz2 mpv-e047cc0931a22d277d7ccd14588f905d7852f7e0.tar.xz |
vo_opengl: implement more HDR tonemapping algorithms
This is now a configurable option, with tunable parameters.
I got inspiration for these algorithms off wikipedia. "simple" seems to
work pretty well, but not well enough to make it a reasonable default.
Some other notable candidates:
- Local functions (e.g. based on local contrast or gradient)
- Clamp with soft knee (linear up to a point)
- Mapping in CIE L*Ch. Map L smoothly, clamp C and h.
- Color appearance models
These will have to be implemented some other time.
Note that the parameter "peak_src" to pass_tone_map should, in
principle, be auto-detected from the SEI information of the source file
where available. This will also have to be implemented in a later
commit.
Diffstat (limited to 'video/out/opengl/video.h')
-rw-r--r-- | video/out/opengl/video.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h index 5d8c938535..01c0cca78b 100644 --- a/video/out/opengl/video.h +++ b/video/out/opengl/video.h @@ -103,6 +103,13 @@ enum prescalers { PRESCALE_NNEDI3, }; +enum tone_mapping { + TONE_MAPPING_CLIP, + TONE_MAPPING_SIMPLE, + TONE_MAPPING_GAMMA, + TONE_MAPPING_LINEAR, +}; + struct gl_video_opts { int dumb_mode; struct scaler_config scaler[4]; @@ -112,6 +119,8 @@ struct gl_video_opts { int target_prim; int target_trc; int target_brightness; + int hdr_tone_mapping; + float tone_mapping_param; int linear_scaling; int correct_downscaling; int sigmoid_upscaling; |