|author||Niklas Haas <firstname.lastname@example.org>||2018-02-03 14:45:01 +0100|
|committer||Kevin Mitchell <email@example.com>||2018-02-05 23:11:18 -0800|
vo_gpu: port HDR tone mapping algorithm from libplacebo
The current peak detection algorithm was very bugged (which contributed to the excessive cross-frame flicker without long normalization) and also didn't take into account the frame average brightness level. The new algorithm both takes into account frame average brightness (in addition to peak brightness), and also computes the values in a more stable/correct way. (The old path was basically undefined behavior) In addition to improving the algorithm, we also switch to hable tone mapping by default, and try to enable peak computation automatically whever possible (compute shaders + SSBOs supported). We also make the desaturation milder, after extensive testing during libplacebo development. I also had to compensate a bit for the representational differences between mpv and libplacebo (libplacebo treats 1.0 as the reference peak, but mpv treats it as the nominal peak), but it shouldn't have caused any problems. This is still not quite the same as libplacebo, since libplacebo also allows tagging the desired scene average brightness on the output, and it also supports reading the scene average brightness from static metadata (MaxFALL) where available. But those changes are a bit more involved. It's possible we could also read this from metadata in the future, but we have problems communicating with AVFrames as it is and I don't want to touch the mpv colorimetry structs for the time being.
Diffstat (limited to 'DOCS')
1 files changed, 16 insertions, 11 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index b0e4f8a9a9..44aff271d3 100644
@@ -5063,7 +5063,7 @@ The following video options are currently all specific to ``--vo=gpu`` and
for in-range material as much as possible. Use this when you care about
color accuracy more than detail preservation. This is somewhere in
between ``clip`` and ``reinhard``, depending on the value of
- ``--tone-mapping-param``. (default)
Reinhard tone mapping algorithm. Very simple continuous curve.
Preserves overall image brightness but uses nonlinear contrast, which
@@ -5074,7 +5074,9 @@ The following video options are currently all specific to ``--vo=gpu`` and
desaturating everything. Developed by John Hable for use in video
games. Use this when you care about detail preservation more than
color/brightness accuracy. This is roughly equivalent to
- ``--hdr-tone-mapping=reinhard --tone-mapping-param=0.24``.
+ ``--hdr-tone-mapping=reinhard --tone-mapping-param=0.24``. If possible,
+ you should also enable ``--hdr-compute-peak`` for the best results.
Fits a logarithmic transfer between the tone curves.
@@ -5103,13 +5105,15 @@ The following video options are currently all specific to ``--vo=gpu`` and
Specifies the scale factor to use while stretching. Defaults to 1.0.
- Compute the HDR peak per-frame of relying on tagged metadata. These values
- are averaged over local regions as well as over several frames to prevent
- the value from jittering around too much. This option basically gives you
- dynamic, per-scene tone mapping. Requires compute shaders, which is a
- fairly recent OpenGL feature, and will probably also perform horribly on
- some drivers, so enable at your own risk.
+ Compute the HDR peak and frame average brightness per-frame instead of
+ relying on tagged metadata. These values are averaged over local regions as
+ well as over several frames to prevent the value from jittering around too
+ much. This option basically gives you dynamic, per-scene tone mapping.
+ Requires compute shaders, which is a fairly recent OpenGL feature, and will
+ probably also perform horribly on some drivers, so enable at your own risk.
+ The special value ``auto`` (default) will enable HDR peak computation
+ automatically if compute shaders and SSBOs are supported.
Apply desaturation for highlights. The parameter essentially controls the
@@ -5119,8 +5123,9 @@ The following video options are currently all specific to ``--vo=gpu`` and
into white instead. This makes images feel more natural, at the cost of
reducing information about out-of-range colors.
- The default of 1.0 provides a good balance that roughly matches the look
- and feel of the ACES ODT curves. A setting of 0.0 disables this option.
+ The default of 0.5 provides a good balance. This value is weaker than the
+ ACES ODT curves' recommendation, but works better for most content in
+ practice. A setting of 0.0 disables this option.
If enabled, mpv will mark all clipped/out-of-gamut pixels that exceed a