View Single Post
Old 27th June 2011, 10:03   #9  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Dogway View Post
can cretindesalpes code "h" and "s" variables be nested inside the Dither1pre function? or isn't there a way in avisynth to do this that doesn't affect performance?
Since "h" is derived from YDifferenceFromPrevious(), it varies from one frame to another, and so can only be evaluated inside ScriptClip (or one of its friends). Therefore (since, as I said, you can't get values out of the run-time environment) anything that uses "h" must also be inside ScriptClip.

However, this might work:
v=TemporalSoften(3,255,255,0,2)
s="""scriptclip("tnlmeans(ax=3,ay=3,az=1,sx=2,sy=2,bx=0,by=0,h=YDifferenceFromPrevious(v)/10+0.5,a=2.0,sse=false)")"""
filtered1=MT("Dither1Pre(flt=s,stacked=true)",2,2,true)

I'm not sure if ScriptClip works within MT (I suspect not), so you might have to remove the MT bit. But at least Dither1Pre would then be outside ScriptClip.
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 27th June 2011 at 10:19.
Gavino is offline   Reply With Quote