View Single Post
Old 20th February 2009, 09:07   #20  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,229
The reason why this peaked my curiosity is I just got a Q9400 as an upgrade to my E6600 CPU a couple of days ago.

It works for me, although I don't use complex lengthy avisynth scripts. Just RemovegrainHD, spline64resize, gradfun2db, crop etc

On a sidenote I do believe in using gradfun2db before encoding, it not only takes out banding but other colour distortions too (with a threshold of around 1.6 is what I use). For re-encoding XVID/DIVX around 3. Not only do I believe the output looks better, but at least the encoder isn't trying to encode the banding and colour distortion (or abberations?)! Slight Debanding can also be used during playback

The settings I use for the MT is just the basic:

SetMTmode(2,4)

With 4 threads of course because of it being a quad core.

This is the very first line of the avisynth script (well filter list, as using Staxrip), and thats all thats different.

I believe using the combined functions such as
Filter().Filter2(...

Is a bad idea with the MT avisynth as the combined function will be passed as a complete fuction, and not separate functions and threads (so you negate the benefit)?

I do realise SetMTmode(1,4) would be faster but that has compatibility issues with most filters, and the benefit would be almost none I believe over using SetMTmode(2,4).

If you have a an avisynth filter list that isn't too taxing, and slow x264 settings its probably not that beneficial for older CPU's or even more modern dual cores (including the E8xxx). The Avisnth ratio is 1 thread to 2 (in terms of encoding potential). Since x264 for example can make use of 4 threads, the ratio between avisynth and x264 is 1:4, meaning unless you have an extremely fast avisynth filter list x264 is waiting for data from Avisynth.

This is an over-simplification, but consider that even if a dual core was ten times faster than those today, it just means the avisynth filters can run ten times as fast and still pass the frames on to x264 which, although is also running 10 times as fast can still only process at a ratio of 1:2!

If you use fast enough encoder settings on dual core that the encoder has to wait for the avisynth input, it would be beneficial to increase the encoder settings to make use of the CPU time and the loss of encoding speed won't be too excessive.

The only time on a dual core where I see the multithreading patch to be effective is when you have a very complex and slow script, or using a fast encoder.

I use very high settings for my encoding, so this probably becomes more visible if you use still quite reasonable settings. I think the key point when trialling this patch is to encode a couple minutes of a clip, with the typical input type and encoder settings that you usually use, and check the fps you achieve for the encoder. Then try the MT, and do the same. The cpu utilisation may not be a good indication of improved performance. If the encoder is the limiting factor, increasing the speed of avisynth won't give you any benefit and could potentially slightly slow down the system due to thread utilisation (from what I've heard), if Avisynth is the limiting factor then this patch will give you potentially a nice boost

Last edited by burfadel; 20th February 2009 at 09:25.
burfadel is offline   Reply With Quote