View Single Post
Old 14th April 2011, 10:42   #15  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by pbristow View Post
If anyone can offer tuning tips to make it run any faster, without sacrificing effectiveness, please do.
mt_lutxyz takes a long time to compile and uses a lot of memory. You can speed up script loading (although not run-time) by making the calls to mt_lutxyz conditional on the corresponding option value, ie only evaluate the ones you are going to use.
Code:
OptB = option == 2 ? MT_Lutxyz(...) : NOP()
...
If you like, you can also remove the ugly Rad conditionals (and the implicit upper limit on Rad) by using a string repetition function:
Code:
function RepeatStr(string s, int n) {
  return (n<=0 ? "" : s + RepeatStr(s, n-1))
}
...
Blurred = C.Mt_Convolution(Horizontal=RepeatStr("1 ", 2*Rad+1), vertical = " 1 ", u=1, v=1)
Blurred2 = Rad%2 == 0 ? \
  C.Mt_Convolution(Horizontal=RepeatStr("1 ", Rad+1), vertical = " 1 ", u=1, v=1) : \
  C.Mt_Convolution(Horizontal="1 "+RepeatStr("2 ", Rad)+"1 ", vertical = " 1 ", u=1, v=1)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote