Log in

View Full Version : How to Speed Up McTemporalDenoise?


VideoFanatic
21st August 2012, 16:08
I have an 8 core PC. I'm using Avisynth MT. For the 1st line and number I tried all methods below and above 5 and they were slower. For the 2nd number I tried all numbers above and below 16 and they were slower. Is the 3rd line correct or should I modify it?


setmtmode(5,16)
Mpeg2Source("J:\2 = New\Raw August 06 2001.d2v", CPU=6)
setmtmode(2,0)
McTemporalDenoise(settings="medium", interlaced=true)
ConvertToYUY2(interlaced=true)
TemporalSoften(4,4,8,15,2)
ConvertToYV12(interlaced=true)
AssumeTFF() # or AssumeBFF() depending on the source

# Deinterlace
Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
QTGMC(Preset="Ultra Fast")
Vinverse()

#Re-interlace
SeparateFields()
SelectEvery(4,0,3)
Weave()

RemoveSpots()
LSFMod(strength=50)
AddGrainC(var=1.0,uvar=1.0)
Assuming my code is correct, can anyone please suggest a way to speed up McTemporalDenoise? Here are some speeds I'm getting:


McTemporalDenoise on it's own: 10.40 FPS
Everything except McTemporalDenoise: 35 FPS
Everything & Super Fast for QTGMC (strange how it's quicker than Ultra Fast): 5.50 FPS


So it's McTemporalDenoise that's slowing everything else down.

I'm currently getting 10.40 FPS and it's taking around 5 hours 40 minutes for a 1 hour 40 minute video. I would like to get this down to 4 hours 30 minutes otherwise I can only do 4 videos in 24 hours instead of 5 which will slow my work down.

I'm open to any suggestions. I've got a CUDA VP5 graphics card and I've just bought DGDecNV and I'm waiting on my licence. Do you think that will give a faster FPS than the free version - DGMPGDec?

I think there's a way to enable the GPU for McTemporalDenoise but I don't know how to install it to get it working.

I use Simple X264 Launcher to encode my videos and it just does 1 pass.

Mounir
21st August 2012, 16:25
I haven't tried with robust filters (like mtcd) yet but probably with Ripbot you can speed up things and encode on 2 or more computers at the same time see here (http://forum.doom9.org/showthread.php?t=127611)

VideoFanatic
21st August 2012, 16:26
Thanks, but I'm quite happy with Simple x264 Launcher. I'm just looking for ways to speed up the encoding times.

I ran the fft3dgpu0.8.2a.exe installer but it still doesn't work. When I try to encode a video it gives the following error: PROCESS EXITED WITH ERROR CODE: -1073741819

cretindesalpes
21st August 2012, 19:25
FFT3DGPU cannot work in MT mode 2. It should be possible to patch McTemporalDenoise to enclose each call to FFT3DGPU between SetMTMode(5).(...).SetMTMode(2). However I don't know if it really works and if it is efficient.

The best thing you can do is to encoding multiple videos simultaneously to saturate the CPU given a reasonable memory usage. Check the overall FPS, maximizing the CPU load does not necessary means that the frame throughput is optimal.

Another lead is tweaking the MCTD settings to accelerate the whole processing. Or you can remove MCTD and use the QTGMC internal denoiser. BTW I don't really understand what you are trying to achieve with this script and why you are applying RemoveSpots and LSFMod on interlaced material.

Didée
21st August 2012, 19:46
That script is brainlessly insane (temporalsoften(4) between MCTD and QTGMC is a killer), performs wrong processing (LSF after re-interlacing - why is QTGMC used at all??), the colorspace conversion for temporalsoften must be a magic placebo trick, and after all, it's hard to imagine that this script should sucessfully run with 16 threads ....

Regarding DGDecodeNV: good choice to opt for it. It's a really nice and handy source filter. Well ... as long as you don't use MT. DGDecodeNV can cope only with MT-scripts of low complexity. Do any more than "just a little", and it'll break down right before you.

VideoFanatic
23rd August 2012, 23:36
Here's the current script I use. I have entered explanations as comments next to each part. If you find something wrong with this script then please tell me.

setmtmode(5,12)
Mpeg2Source("J:\2 = New\z = Encode\Raw 1996 11 March 47 secs.d2v")
setmtmode(2,0)
Crop(2,0,0,-12)
AddBorders(0,6,2,6)

ColorYUV(off_y=10,gamma_y=-15)
ColorYUV(cont_v=-12)

########## Not sure if I need this

ConvertToYUY2(interlaced=true)
TemporalSoften(4,4,8,15,2)
ConvertToYV12(interlaced=true)

########## Remove Dancing Pixels. AddGrain is needed as it covers up the remaining spots that RemoveSpots can't remove

RemoveSpots()
AddGrainC(var=1.0,uvar=1.0)

########### Denoise

McTemporalDenoise(settings="medium", sigma=5, Chroma=true, useQED=false, DeBlock=true, interlaced=true)

########### De-interlace and Re-interlace. Removes de-interlacing artefacts for crap TV media players that may show them

AssumeTFF() # or AssumeBFF() depending on the source
QTGMC(Preset="Super Fast") # Strangely this is faster than Ultra Fast
Vinverse() # Removes any remaining combing artefacts that QTGMC doesn't remove
SeparateFields()
SelectEvery(4,0,3)
Weave()

########### Sharpening

LSFMod(strength=50)

librarian
24th August 2012, 02:59
Try this:

bob(0,1)
Crop(2,0,0,-12)
deen("a2d",7,8,20)
awarpsharp(depth=6)
separatefields()
selectevery(4,0,3)
weave()

AddBorders(0,6,2,6)
return last

Roughly same output.
This will save a number of kilowatt and cpu cycles, in addition chroma planes will thank you.

matfra
24th August 2012, 19:24
I always tought that its better to Deinterlace 1st, Then Denoise, Then Sharpen ? What you recommand for best quality ?

LemMotlow
26th August 2012, 14:48
d l t d

mawen1250
27th August 2012, 08:04
MP_Pipeline("""

Mpeg2Source("J:\2 = New\Raw August 06 2001.d2v", CPU=6)

### prefetch: 64, 32

### ###

AssumeTFF()

QTGMC(Preset="Fast", FPSDivisor=2)

### prefetch: 32, 16

### ###

McTemporalDenoise(settings="medium", radius=2, GPU=true, useMMask=false, protect=true, sharp=false)

### prefetch: 16, 8

### ###

# Other filters

""")

matfra
4th September 2012, 18:04
Hey LemMotlow !
Can you tell me where can I get those please !!
daa3()
RemoveSpots()
DeVCR(20)
FixVHSOversharp(30,14,10)
Thank !

StainlessS
4th September 2012, 18:11
Search works pretty good. :)