1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-26 01:23:17 +00:00
mpv/video/out/gpu
Niklas Haas 4c2edecd7d vo_gpu: refactor HDR peak detection algorithm
The major changes are as follows:

1. Use `uint32_t` instead of `unsigned int` for the SSBO size
   calculation. This doesn't really matter, since a too-big buffer will
   still work just fine, but since `uint` is a 32-bit integer by
   definition this is the correct way to do it.

2. Pre-divide the frame_sum by the num_wg immediately at the end of a
   frame. This change was made to prevent overflow. At 4K screen size,
   this code is currently already very at risk of overflow, especially
   once I started playing with longer averaging sizes. Pre-dividing this
   out makes it just about fit into 32-bit even for worst-case PQ
   content. (It's technically also faster and easier this way, so I
   should have done it to begin with). Rename `frame_sum` to `frame_avg`
   to clearly signal the change in semantics.

3. Implement a scene transition detection algorithm. This basically
   compares the current frame's average brightness against the
   (averaged) value of the past frames. If it exceeds a threshold, which
   I experimentally configured, we reset the peak detection SSBO's state
   immediately - so that it just contains the current frame. This
   prevents annoying "eye adaptation"-like effects on scene transitions.

4. As a result of the previous change, we can now use a much larger
   buffer size by default, which results in a more stable and less
   flickery result. I experimented with values between 20 and 256 and
   settled on the new value of 64. (I also switched to a power-of-2
   array size, because I like powers of two)
2018-02-11 16:45:20 -08:00
..
context.c vo_gpu: d3d11: initial implementation 2017-11-07 20:27:13 +11:00
context.h vo_gpu: vulkan: generalize SPIR-V compiler 2017-09-26 17:25:35 +02:00
d3d11_helpers.c vo_gpu: d3d11: don't use a bgra8 swapchain 2018-01-04 22:08:10 +11:00
d3d11_helpers.h vo_gpu: move d3d11_screenshot to shared code 2017-11-07 20:27:13 +11:00
hwdec.c hwdec: detach d3d and d3d9 hwaccel from angle 2018-01-25 20:57:45 -08:00
hwdec.h vo_gpu: hwdec: remove redundant fields 2017-12-01 05:57:41 +01:00
lcms.c Fix various typos in log messages 2017-12-03 21:24:18 +01:00
lcms.h
osd.c vo_gpu: invalidate fbotex before drawing 2017-12-25 00:47:53 +01:00
osd.h vo_gpu: simplify structs / names 2017-09-22 16:58:55 +02:00
ra.c vo_gpu: export the GLSL format qualifier for ra_format 2017-11-07 20:27:13 +11:00
ra.h vo_gpu: add RA_CAP for gl_NumWorkGroups 2018-02-05 23:11:18 -08:00
shader_cache.c vo_gpu: vulkan: omit needless #define 2017-12-25 00:47:53 +01:00
shader_cache.h vo_gpu: invalidate fbotex before drawing 2017-12-25 00:47:53 +01:00
spirv_shaderc.c vo_gpu: shaderc: include debug info when --gpu-debug is set 2017-10-11 12:22:21 +11:00
spirv.c vo_gpu: fix memleak in spirv.c 2017-09-26 17:32:36 +02:00
spirv.h vo_gpu: vulkan: generalize SPIR-V compiler 2017-09-26 17:25:35 +02:00
user_shaders.c
user_shaders.h vo_gpu: make the vertex attribs dynamic 2017-09-28 01:54:38 +02:00
utils.c msg: reinterpret a bunch of message levels 2017-12-15 22:28:47 -08:00
utils.h vo_gpu: simplify structs / names 2017-09-22 16:58:55 +02:00
video_shaders.c vo_gpu: refactor HDR peak detection algorithm 2018-02-11 16:45:20 -08:00
video_shaders.h vo_gpu: d3d11: add RA caps for ra_d3d11 2017-11-07 20:27:13 +11:00
video.c vo_gpu: refactor HDR peak detection algorithm 2018-02-11 16:45:20 -08:00
video.h vo_gpu: refactor HDR peak detection algorithm 2018-02-11 16:45:20 -08:00