summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-07-14 22:52:27 +0200
committerwm4 <wm4@nowhere>2020-07-15 22:59:17 +0200
commit2a89da0c8548bec624f7f60f0b08d98602c7d394 (patch)
treed898c6ca78a61658041406981f51531510d6f832 /test
parentf1290f709509b950ee9d7131bfcb6e1be901f69d (diff)
downloadmpv-2a89da0c8548bec624f7f60f0b08d98602c7d394.tar.bz2
mpv-2a89da0c8548bec624f7f60f0b08d98602c7d394.tar.xz
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.
Diffstat (limited to 'test')
-rw-r--r--test/scale_zimg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/scale_zimg.c b/test/scale_zimg.c
index 5fcea20d45..f5957067c2 100644
--- a/test/scale_zimg.c
+++ b/test/scale_zimg.c
@@ -24,6 +24,7 @@ static const struct scale_test_fns fns = {
static void run(struct test_ctx *ctx)
{
struct mp_zimg_context *zimg = mp_zimg_alloc();
+ zimg->opts.threads = 1;
struct scale_test *stest = talloc_zero(NULL, struct scale_test);
stest->fns = &fns;