Closed mysteryx93 closed 3 weeks ago
I've confirmed this bug locally. After some debugging, it's related to overlap
being set to None
. If you specify overlap=4
, then the green/bogus output goes away. I suspect that overlap
isn't being calculated properly by default.
I'm going to read through the code now to see what I can see.
I suspect the issue is somewhere in here: https://github.com/adworacz/vapoursynth-mvtools/blob/7ebc72e745ef4575dfeb2084ff4ce48e7f6eabc1/src/MVCompensate.c#L225-L257
I'm not 100% sure though, but the Avisynth and SF versions of MVtools have a few distinct differences, not the least of which is taking subsampling into account:
More research is required, as I'm not exactly sure what this code is even doing, aside from a general idea that it's making strategic copies.
I found the root cause of the issue, and it's a line that @sekrit-twc added to the copy code a few years ago:
It was added in this commit: https://github.com/dubhater/vapoursynth-mvtools/commit/093cb0927e2dfd0bd4de40b6c51b033f255597a3
That commit was entirely focused on SAD, but the CopyCode is used a few places in MVTools, with Compensate being one of them.
I'm not entirely sure of its purpose, so I need to do a bit more reading to see what's safe to remove/alter. But simply deleting that line fixes Compensate with overlap = 0
.
Great work figuring this out!
Great work figuring this out!
Sure thing! It was bugging me since everything looked pretty legit when I first glanced at the code. Glad I was able to hunt it down with a little bit of effort.
The Compensate function returns green horizontal lines -- completely bogus output. This function works with the 32-bit plugin and gives crap output in 8-bit or 16-bit.
Also, any chance you could implement MultiVec features? Allowing radius greater than 3
This would allow writing SpotLess with much less code