Log in

View Full Version : alternative to mt_lutxy(x y +)


Stormborec
14th January 2015, 18:35
In the Masktools manual is written:

mt_average : clip clip1, clip clip2

Equivalent to mt_lutxy("x y + 2 /"), but faster.


mt_makediff : clip clip1, clip clip2

Equivalent to mt_lutxy("x y - 128 +"), but faster.


But what is the alternative to mt_lutxy(x y +) ?

colours
14th January 2015, 19:12
http://avisynth.nl/index.php/Overlay

Stormborec
14th January 2015, 19:17
OK. I found yet:

http://forum.doom9.org/showthread.php?t=166469

This is making me a little confused ...

And what about the Layer? http://avisynth.nl/index.php/Layer

PS. Layer is not for YV12 ...
Overlay is very slow - maybe: mt_average(a,b).levels(0,1,255,0,510,coring=false), if I don't want to use LUT - e.g. when the a, b clips are already calculated in mt_lutxy before in the script

colours
15th January 2015, 11:59
This slipped my mind when I first replied, but you can also use Average (http://avisynth.nl/index.php/Average) or RedAverage (http://chaosking.de/repo/avsfilters/Unclassified/RedAverage___%281.4.3_-_2011-12-02%29.7z) to add two clips. They're both SIMD optimised and should be reasonably fast. Despite their names, they can do more than just weighted averages.

Try something like Average(clip1,1.0,clip2,1.0) or RAverageW(clip1,1.0,clip2,1.0).