summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2018-02-03 14:45:01 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-05 23:11:18 -0800
commite3d93fde2f60c3eef9673e73d7fe156f27ee715f (patch)
tree57c773ce0376cdaf38d164580fc1b230848248a0 /video/decode/vd_lavc.c
parent0870859e3d3658ae7cc69201cfc4bbe41d93fbf5 (diff)
downloadmpv-e3d93fde2f60c3eef9673e73d7fe156f27ee715f.tar.bz2
mpv-e3d93fde2f60c3eef9673e73d7fe156f27ee715f.tar.xz
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 'video/decode/vd_lavc.c')
0 files changed, 0 insertions, 0 deletions