Log in

View Full Version : Removedirt script


Floatingshed
25th February 2018, 00:42
I've been using this script (thanks JM) for years to remove film dirt. I am now experimenting with avisynth+ 64bit and I need help to either convert this script or find something similar that will be compatible.
I think I can use RGtools instead of RemoveGrainSSE3.dll but I can't find a 64bit version of RemoveDirtSSE2.dll, it seems to be dead. Can anyone help please?

function Dirt_mt(clip clap,int "limit",bool "_grey")

{

LoadPlugin("C:\plugins\Dependencies\Dirt_mt\RemoveGrainSSE3.dll")
LoadPlugin("C:\plugins\Dependencies\Dirt_mt\RemoveDirtSSE2.dll")
LoadPlugin("C:\plugins\Dependencies\Dirt_mt\mvtools2.dll")

_grey=default(_grey, false)
limit = default(limit,30)

prefiltered = RemoveGrain(clap,2)
superfilt = MSuper(prefiltered, hpad=32, vpad=32,pel=2)
super=MSuper(clap, hpad=32, vpad=32,pel=2)

bvec = MAnalyse(superfilt,isb=true, blksize=16, overlap=2,delta=1, truemotion=true)
fvec = MAnalyse(superfilt,isb=false, blksize=16, overlap=2,delta=1, truemotion=true)

bvec_re = Mrecalculate(super,bvec,blksize=8, overlap=0,thSAD=100)
fvec_re = Mrecalculate(super,fvec,blksize=8, overlap=0,thSAD=100)

backw = MFlow(clap,super,bvec_re)
forw = MFlow(clap,super,fvec_re)

clp=interleave(backw,clap,forw)
clp=clp.RemoveDirt(limit,_grey)
clp=clp.SelectEvery(3,1)
return clp
}



function RemoveDirt(clip input, int limit, bool _grey)
{
clensed=input.Clense(grey=_grey, cache=4)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,dmode=2,debug=false,noise=limit,noisy=4, grey=_grey)
}

ChaosKing
25th February 2018, 01:17
64bit https://github.com/pinterf/RgTools/releases

Floatingshed
25th February 2018, 08:35
It is the removedirt dll I am looking for, I already have RGtools as a replacement for removegrain, thanks.

StainlessS
25th February 2018, 09:02
If its RemoveDirt v0.9 you are wanting, just took a look and seems to be mostly assembler.
There are some test comparison routines in C (for developer test), but even if someone could get it all working in C
(and I have no idea if that is easily possible), then would likely be a lot slower than x86 version, would need all rewritten
in Intrinsics, methinks.

Floatingshed
25th February 2018, 10:09
So, it is unlikely.
Is there another filter for the removal of film dirt/spots that will work with avisynth+ 64bit, or should I abandon any idea of going 64?

pinterf
25th February 2018, 10:45
Removedirt is under construction, being backported from a clean Vapoursynth version. It's in my queue, be patient.

Floatingshed
25th February 2018, 11:37
OK, thanks for the update.