diff options
author | Niklas Haas <git@haasn.xyz> | 2019-01-02 07:18:29 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2019-02-18 01:54:06 +0200 |
commit | fdd671188d7edb8d150ec2c93656fb80bf031f12 (patch) | |
tree | 4fc415e7cf8cfbf3de5891f5685a1c875bf9cde0 /video/out/gpu/video.c | |
parent | 12e58ff8a65c537a222a3fb954f88d98a3a5bfd2 (diff) | |
download | mpv-fdd671188d7edb8d150ec2c93656fb80bf031f12.tar.bz2 mpv-fdd671188d7edb8d150ec2c93656fb80bf031f12.tar.xz |
vo_gpu: improve accuracy of HDR brightness estimation
This change switches to a logarithmic mean to estimate the average
signal brightness. This handles dark scenes with isolated highlights
much more faithfully than the linear mean did, since the log of the
signal roughly corresponds to the perceptual brightness.
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r-- | video/out/gpu/video.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 6bf0bb31a1..be49551dfb 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -2494,7 +2494,7 @@ static void pass_colormanage(struct gl_video *p, struct mp_colorspace src, bool if (detect_peak && !p->hdr_peak_ssbo) { struct { float average[2]; - uint32_t frame_sum; + int32_t frame_sum; uint32_t frame_max; uint32_t counter; } peak_ssbo = { @@ -2520,7 +2520,7 @@ static void pass_colormanage(struct gl_video *p, struct mp_colorspace src, bool pass_is_compute(p, 8, 8, true); // 8x8 is good for performance gl_sc_ssbo(p->sc, "PeakDetect", p->hdr_peak_ssbo, "vec2 average;" - "uint frame_sum;" + "int frame_sum;" "uint frame_max;" "uint counter;" ); |