CAFxX
17th March 2007, 10:59
Someone proposed it (http://forum.doom9.org/showthread.php?p=318381#post318381) a while ago, and now it has come back into my mind.
In that thread, Sh0dan explained then why he wouldn't implement it: a colorspace conversion is too costly both quality and performancewise to do it without user interaction
While its explanation is undoubtably right, I think it misses a point.
(for the sake of simplicity, let's assume we have two types of users: normal users - those who come here asking "how do I deinterlace this?" or something similar, grab the script they're provided and go home happy - and "pro" users - those writing thousand-lines scripts, and answering the afore-mentioned questions)
For the normal user this would mean that avisynth (the plugin actually, I'll explain this soon) chooses the best conversion. So many times when I first started learning avisynth I made idiotic conversions (sometimes I still find some of those old scripts and I really can't understand why I did them that way) that surely slowed the script down much more than if avisynth (correctly) did them.
For the "pro" user (that would be aware of this mechanism) this would simply mean writing less code.
Code-wise the idea would be to implement an alternative to GenericVideoFilter, which would accept in the constructor the supported and preferred colorspaces.
In the above case, we have three scenarios:
the filter's input is in a unsupported cs
the filter's input is in a supported cs, but not the preferred one
the filter's input is in the preferred cs
For the first and third case, there are no problems. For the second we shall give the user the ability to control this behaviour.
This leads us somewhat to a "configuration option" that should be settable from inside scripts.
Something like:
AutomaticColorspaceConversion(warning=true, preferred=false, enabled=true, ...)
(default values are casual)
where <enabled> would control automatic conversion, <preferred> would control if a supported cs should be converted to a preferred cs, <warning> would enable/disable an alert box/log file where the user would be warned of the automatic conversions performed and so on.
Moreover, the alternative GenericVideoFilter could be instructed to check whenever an explicit colorspace conversion was invoked immediately before and in that case disable automatic conversion (or maybe just the conversions to preferred cs).
In this way we give everyone (both developers and users) the power to control this mechanism. Plugins shall be recompiled with filters instantiated from the alternative GenericVideoFilter, and users will have to enable this explicitely (maybe just by putting it in an .avsi).
The only possible con I can spot is that plugin developers may become even more lazy and refuse to implement colorspace-specific versions of their algorithms. Though, this happens even today so...
Enough talking for me today... now it's your turn!
In that thread, Sh0dan explained then why he wouldn't implement it: a colorspace conversion is too costly both quality and performancewise to do it without user interaction
While its explanation is undoubtably right, I think it misses a point.
(for the sake of simplicity, let's assume we have two types of users: normal users - those who come here asking "how do I deinterlace this?" or something similar, grab the script they're provided and go home happy - and "pro" users - those writing thousand-lines scripts, and answering the afore-mentioned questions)
For the normal user this would mean that avisynth (the plugin actually, I'll explain this soon) chooses the best conversion. So many times when I first started learning avisynth I made idiotic conversions (sometimes I still find some of those old scripts and I really can't understand why I did them that way) that surely slowed the script down much more than if avisynth (correctly) did them.
For the "pro" user (that would be aware of this mechanism) this would simply mean writing less code.
Code-wise the idea would be to implement an alternative to GenericVideoFilter, which would accept in the constructor the supported and preferred colorspaces.
In the above case, we have three scenarios:
the filter's input is in a unsupported cs
the filter's input is in a supported cs, but not the preferred one
the filter's input is in the preferred cs
For the first and third case, there are no problems. For the second we shall give the user the ability to control this behaviour.
This leads us somewhat to a "configuration option" that should be settable from inside scripts.
Something like:
AutomaticColorspaceConversion(warning=true, preferred=false, enabled=true, ...)
(default values are casual)
where <enabled> would control automatic conversion, <preferred> would control if a supported cs should be converted to a preferred cs, <warning> would enable/disable an alert box/log file where the user would be warned of the automatic conversions performed and so on.
Moreover, the alternative GenericVideoFilter could be instructed to check whenever an explicit colorspace conversion was invoked immediately before and in that case disable automatic conversion (or maybe just the conversions to preferred cs).
In this way we give everyone (both developers and users) the power to control this mechanism. Plugins shall be recompiled with filters instantiated from the alternative GenericVideoFilter, and users will have to enable this explicitely (maybe just by putting it in an .avsi).
The only possible con I can spot is that plugin developers may become even more lazy and refuse to implement colorspace-specific versions of their algorithms. Though, this happens even today so...
Enough talking for me today... now it's your turn!