From 2a89da0c8548bec624f7f60f0b08d98602c7d394 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 14 Jul 2020 22:52:27 +0200 Subject: zimg: add slice threading and use it by default This probably makes it much faster (I wouldn't know, I didn't run any benchmarks ). Seems to work as well (although I'm not sure, it's not like I'd perform rigorous tests). The scale_zimg test seems to mysteriously treat color in fully transparent alpha differently, which makes no sense, and isn't visible (but makes the test fail). I can't be bothered with investigating this more. What do you do with failing tests? Correct, you disable them. Or rather, you disable whatever appears to cause them to fail, which is the threading in this case. This change follows mostly the tile_example.cpp. The slice size uses a minimum of 64, which was suggested by the zimg author. Some of this commit is a bit inelegant and weird, such as recomputing the scale factor for every slice, or the way slice_h is managed. Too lazy to make this more elegant. zimg git had a regressio around active_region (which is needed by the slicing), which was fixed in commit 83071706b2e6bc634. Apparently, the bug was never released, so just add a warning to the manpage. --- DOCS/man/options.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'DOCS/man') diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index b85b67c991..95bec1c3d3 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4283,6 +4283,17 @@ Software Scaler ``--zimg-dither=`` Dithering (default: random). +``--zimg-threads=`` + Set the maximum number of threads to use for scaling (default: auto). + ``auto`` uses the number of logical cores on the current machine. Note that + the scaler may use less threads (or even just 1 thread) depending on stuff. + Passing a value of 1 disables threading and always scales the image in a + single operation. Higher thread counts waste resources, but make it + typically faster. + + Note that some zimg git versions had bugs that will corrupt the output if + threads are used. + ``--zimg-fast=`` Allow optimizations that help with performance, but reduce quality (default: yes). Currently, this may simplify gamma conversion operations. -- cgit v1.2.3