Log in

View Full Version : why leaving out () when using filters with default values is BAD


tsp
17th September 2005, 23:00
I discovered why it's bad to leave out the () when using filters with default values like this:

LoadPlugin("d:\Programmer\AviSynth 2.5\plugins\2.0\loadpluginex.dll")
LoadPlugin("d:\Programmer\AviSynth 2.5\plugins\2.0\dustv5.dll")
mpeg2source("F:\VIDEO_TS\v1.d2v")
reduceby2
ConvertToYUY2
PixieDust
VagueDenoiser

instead of this:

LoadPlugin("d:\Programmer\AviSynth 2.5\plugins\2.0\loadpluginex.dll")
LoadPlugin("d:\Programmer\AviSynth 2.5\plugins\2.0\dustv5.dll")
mpeg2source("F:\VIDEO_TS\v1.d2v")
reduceby2()
ConvertToYUY2()
PixieDust()
VagueDenoiser()

when I was testing the multithreading extension (MT).
It disables the internal cache that is inserted between the filters. So it is very very bad to leave them out when using temporalfilters (maybe it would be nice to disallow leaving the () out in avisynth 2.6?).

mg262
17th September 2005, 23:12
!!That's serious. Thank you for pointing that out. Is anyone using this as it is presumably supposed to be used (i.e. to disable the internal cache, presumably for very fast filters)?

stickboy
17th September 2005, 23:45
neuron2 has been saying this for a while, although it's nice to know what's causing it.

(Does the parser actually handle ()-less calls differently?)

tsp
17th September 2005, 23:56
neuron2 has been saying this for a while, although it's nice to know what's causing it.

(Does the parser actually handle ()-less calls differently?)
Yes it does. I was making some modifications to the parser(expression.cpp to be more precise) when I discovered it and the code that insert the cache was never called meaning that my breakpoint was never triggered (caused some confusion until I figured out what was happening)

unskinnyboy
17th September 2005, 23:59
I take it tangible effects of neglecting () is only on the encoding times? Or are there other disadvantages from a user perspective?

tsp
18th September 2005, 00:09
unless you are enabling multithreading in a multithreaded version of avisynth only the encoding time should be affected (and it will only be noteable with computable heavy filters)

unskinnyboy
18th September 2005, 00:24
Thanks tsp. Now that you mention multithreading, I recently enabled HT on my PC, so I should be trying out your MT filter. :)

Guest
18th September 2005, 04:35
Hallelujah. Everybody thought I was crazy. But I still have this in the Decomb reference manual:

Don't Invoke an Avisynth Strangeness This one is very important and can easily cost you a 25% speed penalty! It appears that Avisynth has a strangeness that causes it to waste enormous amounts of time when there are no parentheses with the commands. For example, this script:

Telecide
Decimate

…will run much slower than this one:

Telecide()
Decimate()

If you doubt this, try it both ways and see. It is critical, therefore, to always include at least one parameter or the set of empty parentheses. That is why the scenarios below all are coded that way.

tritical
18th September 2005, 05:29
Thank you for pointing that out. Is anyone using this as it is presumably supposed to be used (i.e. to disable the internal cache, presumably for very fast filters)? I wonder whether it was/is actually intended that a cache instance not be placed afterwards when there is no "()"? It just happens that without the "()" it goes through ExpVariableReference::Evaluate which does not add a cache instead of going through ExpFunctionCall::Evaluate where a cache is inserted.

mg262
18th September 2005, 09:49
I still have this in the Decomb reference manualYou can tell I'm in PAL-land! Anyway, I vote we request that this be altered to use the cache, unless anyone has any convincing objections... .