PDA

View Full Version : I don't understand my own script


detmek
22nd October 2009, 22:54
Its a simple script and it works, but I don't understand what some of the filters and place where those are putted do? Little help would be nice.
This is the part I don't understand:

s = last
f = s.fft3dgpu(sigma = 16, sigma2 = 12, sigma3 = 10, sigma4 = 8, plane = 4)

super = MSuper(s).degrainmedian()
superF = MSuper(f)

bv2 = MAnalyse(superF, isb = true, delta = 2)
bv1 = MAnalyse(superF, isb = true, delta = 1)
fv1 = MAnalyse(superF, isb = false, delta = 1)
fv2 = MAnalyse(superF, isb = false, delta = 2)

MDegrain2(s, super, bv1, fv1, bv2, fv2, thSAD = 800)


When I remove or change any parameter of filter, output changes.
Any explanations?
I'm looking for a denoise filter/script with good speed/quallity tradeoff. MCTemporalDegrain is great, but it is too slow. I need it with settings="high" and I get 1-2 fps.
FFT3DGPU is fast but it blurs too much.
Pure MDegrain does not denoise well.
P.S. Source is analoge TV capture from arial antena, not cable TV.

rkalwaitis
23rd October 2009, 08:43
Try using MC_Spuds it does a good job and is a bit faster than MCTemporalDenoise. MCTemporalDenoise has a GPU option that can be set to true to gain some speed.

detmek
23rd October 2009, 10:02
Yes, I know. 1-2 fps is with GPU=true.
I downloaded MC_Spuds last night but I got an error. Something about Clense?!
So, I tried do combine a few simple things that I saw in other scripts. The result is my little script which gives me 8-10 fps.
I didn't know many things about MVTools. Like, how much super clip determinates final result, or that I can denoise/degrain super clip.

rkalwaitis
23rd October 2009, 10:14
The problem with clense is the Removegrain.dll I believe. It is caused by the removedirtdust function in side the script. The script is right its a dll issue. I think that you should use set postprocess = to false. This should allow you to use MC_Spuds.

Try this.

source = last
# Prefilter the clip
calm = source.invert("Y").levels(0, 0.5, 255, 0, 255, coring = false)
calm = calm.removegrain(mode = 17)
calm = calm.removegrain(mode = 17)
calm = calm.removegrain(mode = 17)

calm_super = calm.MSuper(pel=2, sharp=2, rfilter=2)
source_super = source.MSuper(pel=2, sharp=2, levels=1)

vb3 = MAnalyse(calm_super, isb=true, truemotion=true, delta=3, blksize=8, overlap=4, lambda=1000, search=3)
vb2 = MAnalyse(calm_super, isb=true, truemotion=true, delta=2, blksize=8, overlap=4, lambda=1000, search=3)
vb1 = MAnalyse(calm_super, isb=true, truemotion=true, delta=1, blksize=8, overlap=4, lambda=1000, search=3)
vf1 = MAnalyse(calm_super,isb=false, truemotion=true, delta=1, blksize=8, overlap=4, lambda=1000, search=3)
vf2 = MAnalyse(calm_super,isb=false, truemotion=true, delta=2, blksize=8, overlap=4, lambda=1000, search=3)
vf3 = MAnalyse(calm_super,isb=false, truemotion=true, delta=3, blksize=8, overlap=4, lambda=1000, search=3)
source.MDegrain3(source_super,vb1,vf1,vb2,vf2,vb3, vf3,thSAD=240,thSCD1=320,thSCD2=115,limit=180)

or another way to try with a prefilter

source = last
preNR=source.degrainmedian(limitY=2,limitUV=3,mode =1).fft3dfilter(wintype=1,bt=3,bw=32,bh=32,ow=16,oh=16,degrid=1,sigma=6.0,plane=0)
preNR_super = preNR.MSuper(pel=2, sharp=1, rfilter=4)
source_super = source.MSuper(pel=2, sharp=1, levels=1)
vb2 = MAnalyse(preNR_super, isb=true,truemotion=true,delta=2,blksize=16,overlap=4,pelsearch=2,search=2,searchparam=2,DCT=0,chrom a=false)
vb1 = MAnalyse(preNR_super, isb=true,truemotion=true,delta=1,blksize=16,overlap=4,pelsearch=2,search=2,searchparam=2,DCT=0,chrom a=false)
vf1 = MAnalyse(preNR_super,isb=false,truemotion=true,delta=1,blksize=16,overlap=4,pelsearch=2,search=2,searchparam=2,DCT=0,chroma=false)
vf2 = MAnalyse(preNR_super,isb=false,truemotion=true,delta=2,blksize=16,overlap=4,pelsearch=2,search=2,searchparam=2,DCT=0,chroma=false)
source.MDegrain2(source_super,vb1,vf1,vb2,vf2,thSAD=400,thSCD1=500,thSCD2=135,plane=4,limit=200)

tweaking the settings can really help a lot. I'm no expert on this, but it can make a big difference.

detmek
23rd October 2009, 12:55
Thanks. I will try your script on another capture video this weekend.

rkalwaitis
23rd October 2009, 13:15
those are two little different scripts dont run them together.

detmek
23rd October 2009, 13:30
I noticed, thanks. The first uses RemoveGrain for prefiltered clip with Mdegrain3, the second uses Degrainmedian and FFT3DFilter as prefilter with Mdegrain2.
I will also try to replace FFT3DFilter with FFT3DGPU to gain some speed.
I have Athlon X2 4000+ @2.1GHz. Its quite slow, especialy when I use FFT3DFilter. Setmtmode doesn't help much as 80% speed increase of very slow is - slow.

rkalwaitis
23rd October 2009, 13:37
You could dump both fft3dfilter and fft3dgpu for prefiltering and use DeGrainMedian(limitY=5,limitUV=7,mode=0), it is a very fast filter and may do a good job.

detmek
23rd October 2009, 15:45
Degrainmedian has the same temporal radius as FFT3GPU(bt=3), right? I will try that, thanks.

rkalwaitis
23rd October 2009, 19:01
hybridfupp is a fast script, it uses alternative ways of doing things. It uses Deen. You could try it too.

Didee helped me with the postprocess option of MC_Spuds. It works for me now. You just have to make sure you use Removegrain and Removedirt ver 0.9 or newer. But here is the catch and where I messed up. I did not remove the unused dlls that come in the packages. I simply used the following:

LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MC_Spuds\RemoveGrain\RemoveGrain.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MC_Spuds\RemoveGrain\Repair.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\RemoveGrain v1.0 Pre\RSharpen.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MC_Spuds\RemoveDirt\RemoveDirt.dll")

**all other dlls in the packages can not be in the removegrain or removedirt folders. That is the rub that prevents proper working of the dlls**