View Full Version : Efficiency question --Bilinearresize for example
Fallen
19th September 2008, 09:12
Lets say I need my clip size to be 720 x 480
If it already is that size then does (for example) bilinearresize do anything
(In other words does it see the clip is already to that size and just skip out or just resize it in all cases)
or am I better off using (if ... then ...) logic
from an efficiency standpoint I realize the (if then) logic is probably best (or is it)
Thanx in advance
Avenger007
19th September 2008, 09:19
http://avisynth.org/mediawiki/Resize
Important: AviSynth has completely separate vertical and horizontal resizers. If input is the same as output on one axis, that resizer will be skipped. Which one is called first, is determined by which one has the smallest downscale ratio. This is done to preserve maximum quality, so the 2nd resizer has the best possible picture to work with.
Fallen
19th September 2008, 11:02
Thanx Avenger that answers most of the question (Should have seen that it kicks out for myself :stupid:)
The rest of the question is
There is script overhead involved in implementing If then logic
Is it quicker just to call the function (and let it kick out) or jump it
The reason I'm asking is I'm processing (possibly hundreds of short clips video and audio) efficiency counts
And I've got so many things running my tests are ambiguous
(Probably only a marginal increase one way or the other but...)
Gavino
19th September 2008, 14:11
There is script overhead involved in implementing If then logic
Is it quicker just to call the function (and let it kick out) or jump it
I would expect it to be quicker just to call the function, as the check within the resizers should be quicker than parsing and evaluating a script conditional.
In both cases the overhead is a one-off on script load rather than incurred 'per-frame', so is minimal, though if you are processing lots of short clips I guess it all adds up.
And of course by putting in a script conditional, you would slow down the times where the clip does need to be resized.
Fallen
19th September 2008, 15:00
Well thanx
I guess then that Avisynth parses the script into an array of functions then gets frames and loops on the function array
And not get frame -- walk through script parsing each line>> get next frame etc
I was pretty sure it was the function array -- seems to efficient for the latter
processing lots of short clips I guess it all adds up.
Adds up even more since each script really isn't that small, and each (potentially) uses Animate with resizing
And I've been tinkering with sliding clip thumbnails(As Menu Buttons) to final screen positions from screen side in sequence
And then off screen at the end of the clip (to handle menu looping "prettily")
Not A Quick Operation
Gavino
19th September 2008, 15:43
I guess then that Avisynth parses the script into an array of functions then gets frames and loops on the function array
Actually, it's not an array but in effect a DAG (http://en.wikipedia.org/wiki/Directed_acyclic_graph) (the filter graph), but the main point, as you say, is that the parsing is done just once.
Adds up even more since each script really isn't that small, and each (potentially) uses Animate with resizing
...
Not A Quick Operation
Animate is relatively slow, because here the filter being animated does have to be evaluated and instantiated for each frame, as each has a different set of argument values.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.