View Single Post
Old 8th August 2007, 23:07   #6  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Quote:
Originally Posted by IanB View Post
You want to build a small farm of resizers, each one doing a particular movement and then select each based on the desired movement for that frame number.
As I said prebuild all the resizers in the constructor. Save them in a class scope array. Use these in the GetFrame instead of env->Invoke'ing a new one every frame.

Remember the resizer core does horizontal and vertical resizing as 2 distinct steps, you do likewise to minimise the number of resizers instances needed. Generate X only movement separately from Y only movement resizers and then chain them in the GetFrame. By quantizing your movement vectors cleverly you would be able to do 256 distinct movements with only 16 X only resizers and 16 Y only resizers.

You will need an intermediate dummy class to act as a selector so you can have a constant 'child' member for every resizer.

:Edit: In fact completly separate your filter into a horizontal only shaker and a vertical only shaker. In the create call do "return new HShake(new VShake(child,...), ...)"

Last edited by IanB; 8th August 2007 at 23:18.
IanB is offline   Reply With Quote