PDA

View Full Version : IScriptEnvironment::Subframe


Leak
14th August 2004, 19:08
Is it just me, or shouldn't there be a second version of Subframe in IScriptEnvironment that wraps the other version of it in VideoFrame?

i.e.
virtual PVideoFrame __stdcall Subframe(
PVideoFrame src,
int rel_offset,
int new_pitch,
int new_row_size,
int new_height,
int rel_offsetU,
int rel_offsetV,
int pitchUV) = 0;

I'm currently rewriting/optimizing KernelDeint and one thing I'd like to change about the deinterlacing function is that you should be able (at least in the plugin itself, not neccessarily in scripts) to pass it fields instead of frames, i.e. VideoFrames with half height, a doubled pitch and possibly an offset - which is what Subframe is there for after all, but the version IScriptEnvironment exports can't cope with planar formats... :(

(I'm mainly doing this so I can easily implement a KernelBob that doesn't have to copy data around a la SeparateFields().Trim(1,0).Weave() but I'd rather not write my own Subframe function...)

What should I do? I assume adding a function to IScriptEnvironment is out of the question due to all the breakage that would produce...

np: Kit Clayton - Surba (Nek Sanalet)

sh0dan
16th August 2004, 08:48
Hmmmm.. Seems like it got left out. It would mean that the plugin would only work with avisynth 2.55 or greater.

Could you do a workaround and use env->Invoke ?

Leak
16th August 2004, 09:36
Originally posted by sh0dan
Hmmmm.. Seems like it got left out. It would mean that the plugin would only work with avisynth 2.55 or greater.

Could you do a workaround and use env->Invoke ?

Yep, that's what I came up with after a bit of pulling my hair out; a combination of AssumeTFF() and SeparateFields() does the trick, but I'd still prefer a direct way to do this...

np: Yoko Kanno - Surf (Ghost In The Shell Stand Alone Complex OST 1)