diff options
author | Niklas Haas <git@haasn.xyz> | 2018-02-14 14:14:48 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-02-20 22:02:51 +0200 |
commit | b9e7478760a34827ae5e4f202713509ee553dd9a (patch) | |
tree | 19b3d59b5a71908608c894ccd60dc6de1d924a44 /video/out/gpu/video_shaders.h | |
parent | 5d6fb5267d9ddc85e6084665ab6b20a06d214bbc (diff) | |
download | mpv-b9e7478760a34827ae5e4f202713509ee553dd9a.tar.bz2 mpv-b9e7478760a34827ae5e4f202713509ee553dd9a.tar.xz |
vo_gpu: simplify and correct color scale handling
The primary need for this change is the fact that the OOTF was
incorrectly scaled, due to the fact that the application of the OOTF can
itself change the required normalization peak. (Plus, an oversight in
pass_inverse_ootf meant we forgot to normalize at the end of it)
The linearize/delinearize functions still normalize the scale since it's
used in a number of places throughout gpu/video.c, but the color
management function now converts to absolute scale right away, instead
of in an awkward way inside the tone mapping branch. The OOTF functions
now work in absolute scale only.
In addition, minor changes have been made to the way normalization is
handled for tone mapping - we now divide out the dst_peak *after* peak
detection, in order to make the scale of the peak detection buffer
consistent even if the dst_peak were to (hypothetically) change
mid-stream. In theory, we could also do this for desaturation, but doing
the desaturation before tone mapping has the advantage of preserving
much more brightness than the other way around - and even mid-stream
changes are not that drastic here.
Finally, some preparation work has been done for allowing the user to
customize the `dst.sig_peak` in the future.
Diffstat (limited to 'video/out/gpu/video_shaders.h')
-rw-r--r-- | video/out/gpu/video_shaders.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/video/out/gpu/video_shaders.h b/video/out/gpu/video_shaders.h index 2ae2ac3fa9..cd395d6377 100644 --- a/video/out/gpu/video_shaders.h +++ b/video/out/gpu/video_shaders.h @@ -39,8 +39,6 @@ void pass_sample_oversample(struct gl_shader_cache *sc, struct scaler *scaler, void pass_linearize(struct gl_shader_cache *sc, enum mp_csp_trc trc); void pass_delinearize(struct gl_shader_cache *sc, enum mp_csp_trc trc); -void pass_ootf(struct gl_shader_cache *sc, enum mp_csp_light light, float peak); -void pass_inverse_ootf(struct gl_shader_cache *sc, enum mp_csp_light light, float peak); void pass_color_map(struct gl_shader_cache *sc, struct mp_colorspace src, struct mp_colorspace dst, |