summaryrefslogtreecommitdiffstats
path: root/wscript_build.py
diff options
context:
space:
mode:
authorBin Jin <bjin@ctrl-d.org>2019-03-16 11:19:51 +0000
committersfan5 <sfan5@live.de>2019-06-16 11:19:44 +0200
commitca2f193671f70022143a344257763735f759bd2d (patch)
tree43b8f33cc4d6f16c2e1d500150785330aff5c4e1 /wscript_build.py
parent6aecd10ebad03f02486722f4f54e3236867f972f (diff)
downloadmpv-ca2f193671f70022143a344257763735f759bd2d.tar.bz2
mpv-ca2f193671f70022143a344257763735f759bd2d.tar.xz
vo_gpu: implement error diffusion for dithering
This is a straightforward parallel implementation of error diffusion algorithms in compute shader. Basically we use single work group with maximal possible size to process the whole image. After a shift mapping we are able to process all pixels column by column. A large ring buffer are allocated in shared memory to speed things up. However the size of required shared memory depends linearly on the height of video window (or screen height in fullscreen mode). In case there is no enough shared memory, it will fallback to `--dither=fruit`. The maximal allowed work group size is hardcoded as 1024. Ideally we could query `GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS`. But for whatever reason, it seems most high end card from nvidia and amd support only the minimal required value, so I guess we can stick to it for now.
Diffstat (limited to 'wscript_build.py')
-rw-r--r--wscript_build.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/wscript_build.py b/wscript_build.py
index 6306c28d72..0814b9122e 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -433,6 +433,7 @@ def build(ctx):
( "video/out/filter_kernels.c" ),
( "video/out/gpu/context.c" ),
( "video/out/gpu/d3d11_helpers.c", "d3d11 || egl-angle-win32" ),
+ ( "video/out/gpu/error_diffusion.c" ),
( "video/out/gpu/hwdec.c" ),
( "video/out/gpu/lcms.c" ),
( "video/out/gpu/libmpv_gpu.c" ),