View Single Post
Old 3rd July 2003, 21:24   #4  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
One more question, if you don't mind I'm trying to understand the "Quantified Motion Filter: adaptive motion filter for Avisynth", in the thread: http://forum.doom9.org/showthread.php?s=&threadid=56051

This script:

# first frame: 2.271
# second frame: 0.00002
# third frame: 2.137
# fourth frame: 2.252
clip = clip.Trim(0,-4)
ScriptClip(clip, "Subtitle(String(YDifferenceFromPrevious))")


gives exactly the same output as the following script:


clip = clip.Trim(0, -4)

function g(clip c)
{
global clip=c
c=ScriptClip(c, "debug()")
c=FrameEvaluate(c, "me")
c=FrameEvaluate(c, "global text=YDifferenceFromPrevious(clip)")
return c
}

function me()
{
global t=String(text)
}

function debug(clip c)
{
c = subtitle(c, t)
return c
}

g(clip)


The problem is that I don't understand what is happening here. If you look at the function "g" it appears that the script is executed backwards (instead of forwards, which is normally the case). Thus the globale variable "text" is obtained, and used by the function "me" [which is located above that line]. Then the "debug" function is applied [which is located above that line].

I know that AviSynth parses (or reads) from bottom to top, so I guess that has something to do with it. I just don't understand this, and I'm so confused
Wilbert is offline   Reply With Quote