pandv
7th July 2002, 20:48
I downloaded the source code and tried to see if this idea is possible. But my time is over and I don't understand the source code. So, I explain the idea and let it for the Avisynth gurus.
Objectives:
- Allow Avisynth to use more color spaces (YIV, planar spaces, one channel R,G,or B,...)
- Eliminate the need for explicit calls to ConvertTo...
- Maintain the compatibility with old filters.
Changes:
- Define new enums for the new alloweds color spaces.
- Define, of course, new functions to translate between the diferents color spaces. Example: one channel R,G,or B to RGB -> pad with 0.
- In the new filters, in AvisynthPluginInit call a new function to declare explicity the color spaces supporteds (or modify AddFunction to allow a optional parameter). Store this new info (maybe in a new member of AVSFunction struct).
- If it's a old filter, set this info to RGB24,RGB32 and YUV2. Or best, try to pass a test frame and intercept the exception produced if it's not supported (maybe modifying ScriptEnvironment::ThrowError if a flag is activated).
- When Avisynth creates the filter graph, check for compatibility and insert the color transformation functions if it's needed (or, maybe, Cache:GetFrame can be modified to do the transformation).
Can this works?. If not, sorry for your time.
If this has not sense, feel free to delete the post.
pandv.
Objectives:
- Allow Avisynth to use more color spaces (YIV, planar spaces, one channel R,G,or B,...)
- Eliminate the need for explicit calls to ConvertTo...
- Maintain the compatibility with old filters.
Changes:
- Define new enums for the new alloweds color spaces.
- Define, of course, new functions to translate between the diferents color spaces. Example: one channel R,G,or B to RGB -> pad with 0.
- In the new filters, in AvisynthPluginInit call a new function to declare explicity the color spaces supporteds (or modify AddFunction to allow a optional parameter). Store this new info (maybe in a new member of AVSFunction struct).
- If it's a old filter, set this info to RGB24,RGB32 and YUV2. Or best, try to pass a test frame and intercept the exception produced if it's not supported (maybe modifying ScriptEnvironment::ThrowError if a flag is activated).
- When Avisynth creates the filter graph, check for compatibility and insert the color transformation functions if it's needed (or, maybe, Cache:GetFrame can be modified to do the transformation).
Can this works?. If not, sorry for your time.
If this has not sense, feel free to delete the post.
pandv.