Log in

View Full Version : resizing without computing chroma information?


leeperry
30th October 2009, 12:58
hi there, I was discussing with mg262(who made a modded LSF version that's slightly faster) how to optimize GrainFactory3().

he told me:
When you are resizing, you are computing chroma information, but you don't need it (in this script) and will discard it later. So what you really want is to be resizing *without computing chroma information*. That should speed up the resizing by 33% (which should in turn speed up the entire script by about 25%). It would be entirely doable for someone who knows the AVISynth code base to build a resizer that ignores chroma

(Of course, the nice way to do this is to be working in the Y8 colour space... if you were doing that you wouldn't have to worry about all the "U=1,V=1" nonsense in MaskTools either. But I have no idea how support for the Y8 colour space is progressing these days!)

the avisynth wiki server is down, so I've put a copy of GrainFactory3() here: http://www.mediafire.com/?jktxmxymmjj

any insight would be much appreciated, as this is is a very demanding script at this point...ditching chroma resize would be really great!

:thanks:

leeperry
30th October 2009, 18:31
ok, I think some background is needed so you guys get a better picture...more quotes from mg262:

GrainFactory3(10,7,5,100,100,100,0.9,0.9,0.9) = 35 fps [29 ms/f]
GrainFactory3(10,7,5,100,100,100,1.0,1.0,1.0) = 160 fps [7 ms/f]

in the second call, all three grain layers have the same 1.0 size(no resizing), so it looks like 22 ms/f are spent on resizing, and 7 ms/f on other things. That in turn implies that if you want to get any significant speed gain out of this script, you need a faster way to resize. You might be able to shave off 3 or 4 percent by speeding up masktools, but really, it's not worth it.

so well, would that be possible to extract the BicubicResize from Avisynth to an external DLL, and disable chroma processing? this would make this script fly, and if you haven't tried it yet...it really looks spectacular http://forum.slysoft.com/images/smilies/agreed.gif

Gavino
30th October 2009, 18:44
so well, would that be possible to extract the BicubicResize from Avisynth to an external DLL, and disable chroma processing?
Sure, it's clearly possible.
And since the Avisynth source code is available under GPL, it could be done by anyone with the motivation and the necessary programming skills.

leeperry
30th October 2009, 19:08
ok cool! well if anyone's motivated, I think this would be a great asset for speeding up scripts that discard chroma anyway. sadly I'm not a coder :o

Fizick
1st November 2009, 12:18
leeperry, have you discussion with mg262 recently? it is great, that he can help us even with advices.

1. Y8 will be best solution, it is already available in Avisynth 2.6 alpha
2. other possible solution is Bicubicresize(...., chroma=false) syntax


(seems, it is more related to Avisynth development forum)

leeperry
1st November 2009, 14:30
ok thanks for the tip! but : http://img258.imageshack.us/img258/6931/chrof.png

yes, he's been kind enough to help me a few days ago.

will masktools support Y8? besides MT in 2.58 is pretty buggy already, so I'd rather stick to 2.57 :o