Log in

View Full Version : Need advice on using multithreading on a script


Chainmax
10th November 2007, 17:24
I'm currently processing some clips with variants of the following script:

DirectShowSource("X:\wherever\somevideo",fps=23.976,convertfps=true,audio=false)

ConvertToYV12()

Deblock_QED_MT2(quant1=35,aOff1=16,quant2=45,aOff2=6)

RemoveGrain(mode=5)

DeGrainMedian()

FFT3DFilter(sigma=3,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16)

GaussResize(800,448)

#dull=last
#sharp=dull.LimitedSharpenFaster(SMode=4,Strength=1000,wide=true,soft=75)
#Soothe(sharp,dull,25)
LimitedSharpenFaster(SMode=4)

nnediresize2x(true,true,true)

source=last
denoised=DegrainMedian(mode=2).FFT3DFilter(sigma=3,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16)
backward_vec2 = MVAnalyse(denoised,isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = MVAnalyse(denoised,isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = MVAnalyse(denoised,isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = MVAnalyse(denoised,isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
MVDegrain2(source,backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=2)

Spline36Resize(480,272)

LimitedSharpenFaster(SMode=4,Strength=200)

Tweak(sat=1.1)

gradfun2db(thr=2.4)

AddGrainC(5,2)

#Levels(0,1,255,16,235)

I was meaning to try multithreaded Avisynth and never got around to it, until the latest encode looked like it would take several hours to complete.
Now, I seem to recall that there were a couple of methods to do so (MT 0.7 + custom avisynth and some other method I can't recall), so I was wondering if you could tell me what were the differences between them and how to implement those on my script taking into account that my computer is Athlon X2-based. Thanks in advance.

steptoe
11th November 2007, 00:10
http://forum.doom9.org/showthread.php?t=94996

http://avisynth.org/mediawiki/MT_support_page


The simplest method is to use SetMTMode(2) as the first line in your script, it will automatically work out how many cores your processor has and uses them or you can specify by hand SetMTMode(2,2)

Remember you have to copy the MT altered avisynth.dll to yoir system32 directory, its all explained in the two links above

Chainmax
12th November 2007, 01:30
I'll check those links out, thanks :) http://smilies.vidahost.com/otn/wink/thumb.gif.