Log in

View Full Version : script function RemoveNoiseMC


Pages : 1 2 3 [4]

videoFred
26th January 2010, 14:45
Lets make the long story short, I'm facing same problem as bmnot , I have the MVtools2, but still I'm getting these kind of errors.

Mvtools2 is using M....., instead of the old MV......
You will have to change this in the RemovenoiseMC script!
MAnalyse, MFlow, MDegrain etc...

Fred.

kool
26th January 2010, 14:47
how i would do that? :confused:

Edit: you mean i should change MVAnalyse to MAnalyse in RemoveNoiseMC.avsi ?

videoFred
26th January 2010, 14:52
how i would do that? :confused:

With your keyboard? :)


Edit: you mean i should change MVAnalyse to MAnalyse in RemoveNoiseMC.avsi ?

You got it! :p

Fred.

kool
26th January 2010, 14:56
to make it sure, is it this part ?

bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
backw1 = rdlimit>13 ? \

Edit: or if you have working one, could you upload it? it will makes thing more easy.

kool
26th January 2010, 15:52
doesn't help changing MVAnalyse to MAnalyse, I'm getting errors for other parts of MVTools.

videoFred
26th January 2010, 16:17
I wrote:


MAnalyse, MFlow, MDegrain etc...

Fred.

Didée
26th January 2010, 16:33
You can't just swap the names like MVAnalyse->Manalyse. You also need to provide all filters with appropriate "super" clip, and (in exchange) cancel out all "idx=.." parameters.

videoFred
26th January 2010, 16:43
You can't just swap the names like MVAnalyse->Manalyse. You also need to provide all filters with appropriate "super" clip, and (in exchange) cancel out all "idx=.." parameters.

But of cource... I forgot about this :scared:

Fred.

kool
26th January 2010, 16:43
I don't have enough scripting Knowledge and I'm not familiar with MVTools to solve this issue, could you help us to solve this problem.

videoFred
26th January 2010, 16:46
I don't have enough scripting Knowledge and I'm not familiar with MVTools to solve this issue, could you help us to solve this problem.

Simple, rename back to MVAnalyse and use MVTools1...

Fred.

kool
26th January 2010, 16:52
That sounds much easier, after doing it I get this error. I'm using MVTools v1.11.4.5

http://i46.tinypic.com/2ckgft.jpg

* And if I have MVTools2 and MVTools 1 in my plugin directory, wouldn't they make any problem in loading scripts?

kool
26th January 2010, 21:26
And also getting this error, really don't know what is the problem.

http://i49.tinypic.com/339sjzl.jpg

osgZach
27th January 2010, 01:18
Your resolution must be divisible by 8, I think is what that means.

If you're putting in a crop but not resizing (yet) for instance, that might be causing the error.

As for the second one... not sure what that means, unless its telling you that you have to declare that option in your script call.

kool
27th January 2010, 02:02
I did resize, and here is the script

SetMemoryMax(512)

Load_Stdcall_Plugin("C:\Program Files (x86)\meGUI\tools\yadif\yadif.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avs")
DGDecode_mpeg2source("C:\Users\kool\Desktop\Test\Test.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Yadif(mode=1, order=1)
Srestore(Frate=29.970)
Crop(2, 60, -22, -64)

LQ_Filter()
LanczosResize(584, 336)

When I put the LQ_Filter() before resize I get this error

http://i46.tinypic.com/2ckgft.jpg

But if I put it after resize I get this error

http://i49.tinypic.com/339sjzl.jpg

Didée
27th January 2010, 09:15
The deblock error is because your cropping creates non-mod8 frame dimensions. Putting it after the resize makes no sense, because then the 8x8 blocks are no more in the places where the deblock-filter is looking for them. Adjust your crop values like this:
Srestore(Frate=29.970)
Crop(0, 56, -16, -64) # closest mod-8 approach to (2,60,-22,-64)
LQ_Filter()
Crop(2,4,-6,-0) # crop the rest of the borders
LanczosResize(584, 336)

The MVDenoise error is because MVDenoise is depreciated, and not supported anymore in actual MVTools2. Seen from that point, you cannot port RemoveNoiseMC to MVTools2, because MVDenoise is not available. You'd need to build an approximation for MVDenoise via MDegrain, or build manually with MCompensate/Interleave/TemporalSoften/SelectEvery.

bayex
28th January 2010, 08:26
Is it possible to run through the GPU Removenoise

Jenyok
14th February 2012, 07:53
This is a code of all known RemoveNoise and various filters functions, used RemoveNoise, collected together.
MC - moution compensated.
Code is adapted to MVTools V2.

Didee
neuron2
Gavino

Any your suggestion, addition, correction and improvment of this code ?!
Also needed your help to replace function Deen() beta1 to Deen() beta2.


#
#
# File: RemoveNoise.avsi
#
# Moution compensated RemoveNoise and variuos filters functions
#
# Functions:
#
# function RemoveNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", bool "sharp", float "csharpen", bool "_grey")
# function HQ_Filter(clip clp)
# function MQ_Filter(clip clp)
# function LQ_Filter(clip clp)
#
# function RemoveNoiseMC_HQ(clip clp, int "tlimit", int "rgrain", float "csharp")
# function HQ_Filter2(clip clp)
#
# function RemoveHighNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", float "csharp", bool "_grey")
# function VLQ_Filter(clip clp)
# function VLQ_Filter_Ultimate(clip clp)
#
#



LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirts.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAINT-1_0\removegraint.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAINT-1_0\repairt.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\removegrain.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\repair.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MVTOOLS-V2_5_11_3\mvtools2.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\FLUXSMOOTH_25_DLL_20040729\fluxsmooth.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\VAGUEDENOISER_25_DLL_20050926\vaguedenoiser.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\FFT3DFILTER_20070220\fft3dfilter.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\ZZZ_OLD\DEEN_25_DLL_20030813\deen.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEBLOCK_25_DLL_20060214\deblock.dll")

Import("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\SHARPFUNCTION_LIMITEDSHARPENFASTER\limitedsharpenfaster.avsi")
Import("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\SEESAW\seesaw.avsi")
Import("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt2.avsi")


#global idx_c = 4


# =============================================================================
#
#
function RemoveNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", bool "sharp", float "csharpen", bool "_grey")
{
_grey = Default(_grey, false)
rdlimit = Default(rdlimit, 11)
rgrain = Default(rgrain, 2)
denoise = Default(denoise, 8)
sharp = (rgrain < 1) ? Default(sharp, true) : Default(sharp, false)
csharpen = (rgrain > 2) ? Default(csharpen, 0.17) : (rgrain > 1) ? Default(csharpen, 0.15) : Default(csharpen, 0.13)

# global idx_c = idx_c + 1

dummy = clp.BlankClip(length=0)
csharpen = (sharp) ? csharpen : csharpen + 0.08
_dgr = 0.45 + rgrain * 0.4
cbs = 8
cov = (cbs > 4) ? cbs / 4 : 0
ccf = cbs * cbs / 64
cpn = (denoise > 12) ? 50 * ccf : (denoise > 8) ? 58 * ccf : (denoise > 5) ? 66 * ccf : 72 * ccf
csh = (sharp) ? 1 : 0

super = MSuper(clp, pel=2, sharp=csh)
bvec3 = MAnalyse(super, isb=true, blksize=cbs, delta=3, truemotion=true, pnew=cpn, overlap=cov)
bvec2 = MAnalyse(super, isb=true, blksize=cbs, delta=2, truemotion=true, pnew=cpn, overlap=cov)
bvec1 = MAnalyse(super, isb=true, blksize=cbs, delta=1, truemotion=true, pnew=cpn, overlap=cov)
fvec1 = MAnalyse(super, isb=false, blksize=cbs, delta=1, truemotion=true, pnew=cpn, overlap=cov)
fvec2 = MAnalyse(super, isb=false, blksize=cbs, delta=2, truemotion=true, pnew=cpn, overlap=cov)
fvec3 = MAnalyse(super, isb=false, blksize=cbs, delta=3, truemotion=true, pnew=cpn, overlap=cov)
backw1 = (rdlimit > 13) ? (rdlimit > 20) ? MFlow(clp, super, bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, bvec1).Deblock(quant=16, aOffset=4, bOffset=4) : \
MFlow(clp, super, bvec1)
forw1 = (rdlimit > 13) ? (rdlimit > 20) ? MFlow(clp, super, fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, fvec1).Deblock(quant=16, aOffset=4, bOffset=4) : \
MFlow(clp, super, fvec1)

# bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
# bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
# fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
# fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
# backw1 = (rdlimit > 13) ? (rdlimit > 20) ? clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
# clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
# clip.MVFlow(bvec1, idx=idx_c)
# forw1 = (rdlimit > 13) ? (rdlimit > 20) ? clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
# clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
# clip.MVFlow(fvec1, idx=idx_c)

clp = interleave(backw1, clp, forw1)
clp = clp.RemoveDirt2(rdlimit, rgrain, _grey)
# clp = clp.RemoveDirtMC2(rdlimit, rgrain, _grey)
dnc = (denoise == 0) ? clp.RemoveTempGrain(rgrain).SelectEvery(3, 1) : dummy
clp = clp.SelectEvery(3, 1)

dnc = MDegrain3(clp, super, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, thSAD=190 + 15 * denoise, \
thSCD1=230 + 5 * denoise)

# dnc = (denoise == 0) ? dnc : clp.MVDenoise(bvec2, bvec1, fvec1, fvec2, thT=denoise, thSAD=190 + 15 * denoise, \
# thmv=40, thSCD1=230 + 5 * denoise)

vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=7, percent=75)
vid_mo = (rgrain == 1) ? vid_mo.RemoveGrain(1) : vid_mo.RemoveGrain(5)
dnc = dnc.ConditionalFilter(dnc, vid_mo, "(YDifferenceFromPrevious()+YDifferenceToNext())/AverageLuma()", "<", "0.3")
clp = clp.SeeSaw(dnc, Sstr=csharpen, Szp=12, SdampHi=20, bias=40)

return clp
}



# for slight noisy video or spot/dirt removing only
#
function HQ_Filter(clip clp)
{
clp = clp.RemoveNoiseMC(rdlimit=6, rgrain=1, denoise=0)
clp = clp.LimitedSharpenFaster(Smode=4, strength=18, overshoot=0, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}


# medium noise, higher grain:
#
function MQ_Filter(clip clp)
{
clp = clp.RemoveNoiseMC(rdlimit=10, rgrain=2, denoise=8)
clp = clp.LimitedSharpenFaster(Smode=4, strength=20, overshoot=1, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}


# high noise or analog capture:
#
function LQ_Filter(clip clp)
{
clp = clp.RemoveNoiseMC(rdlimit=18, rgrain=3, denoise=14)
clp = clp.VagueDenoiser(threshold=0.6, nsteps=6, chromaT=0.6, percent=75)
clp = clp.deen("a3d", rad=3, thrY=3, thrUV=5, min=0.25, tthY=2, tthUV=3, scd=6)
clp = clp.LimitedSharpenFaster(Smode=4, strength=24, overshoot=1, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}



# =============================================================================
#
#
function RemoveNoiseMC_HQ(clip clp, int "tlimit", int "rgrain", float "csharp")
{
tlimit = Default(tlimit, 4)
rgrain = Default(rgrain, 1)
csharp = (rgrain > 1) ? Default(csharp, 0.14) : Default(csharp, 0.13)

# global idx_c = idx_c + 1

cbs = 4
ccf = cbs * cbs / 64
cpn = (tlimit > 6) ? 70 * ccf : 75 * ccf

super = MSuper(clp, pel=2, sharp=1)
bvec1 = MAnalyse(super, isb=true, blksize=cbs, delta=1, overlap=0, truemotion=true, pnew=cpn)
fvec1 = MAnalyse(super, isb=false, blksize=cbs, delta=1, overlap=0, truemotion=true, pnew=cpn)
backw1 = MFlow(clp, super, bvec1)
forw1 = MFlow(clp, super, fvec1)

# bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=1, overlap=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=1, overlap=0, truemotion=true, pnew=cpn, idx=idx_c)
# backw1 = clip.MVFlow(bvec1, idx=idx_c)
# forw1 = clip.MVFlow(fvec1, idx=idx_c)

dnc = interleave(backw1, clp, forw1)
dnc = dnc.RemoveDirt_HQ(tlimit, rgrain)
# dnc = dnc.RemoveDirtMC_HQ(tlimit, rgrain)
dnc = dnc.SelectEvery(3, 1)

return ((csharp == 0) ? dnc : clp.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40))
}


function HQ_Filter2(clip clp)
{
clp = clp.RemoveNoiseMC_HQ(tlimit=4, rgrain=1)
clp = clp.LimitedSharpenFaster(Smode=4, strength=15, overshoot=1, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}



#global idx_c = 25


# =============================================================================
#
#
function RemoveHighNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", float "csharp", bool "_grey")
{
_grey = Default(_grey, false)
rdlimit = Default(rdlimit, 24)
rgrain = Default(rgrain, 3)
denoise = Default(denoise, 15)
csharp = (rgrain > 2) ? Default(csharp, 0.32) : Default(csharp, 0.28)

# global idx_c = idx_c + 1

_dgr = 0.7 + rgrain * 0.5
cbs = 8
ccf = cbs * cbs / 64
cpn = (denoise > 12) ? 50 * ccf : 57 * ccf

super = MSuper(clp, pel=2, sharp=0)
bvec3 = MAnalyse(super, isb=true, blksize=cbs, delta=3, truemotion=true, pnew=cpn)
bvec2 = MAnalyse(super, isb=true, blksize=cbs, delta=2, truemotion=true, pnew=cpn)
bvec1 = MAnalyse(super, isb=true, blksize=cbs, delta=1, truemotion=true, pnew=cpn)
fvec1 = MAnalyse(super, isb=false, blksize=cbs, delta=1, truemotion=true, pnew=cpn)
fvec2 = MAnalyse(super, isb=false, blksize=cbs, delta=2, truemotion=true, pnew=cpn)
fvec3 = MAnalyse(super, isb=false, blksize=cbs, delta=3, truemotion=true, pnew=cpn)
backw1 = (rdlimit > 20) ? MFlow(clp, super, bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, bvec1).Deblock(quant=16, aOffset=4, bOffset=4)
forw1 = (rdlimit > 20) ? MFlow(clp, super, fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, fvec1).Deblock(quant=16, aOffset=4, bOffset=4)

# bvec3 = clip.MVAnalyse(isb=false, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec3 = clip.MVAnalyse(isb=true, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# backw1 = (rdlimit > 20) ? clip.MVFlow(bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
# clip.MVFlow(bvec1).Deblock(quant=16, aOffset=4, bOffset=4)
# forw1 = (rdlimit > 20) ? clip.MVFlow(fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
# clip.MVFlow(fvec1).Deblock(quant=16, aOffset=4, bOffset=4)

clp = interleave(backw1, clp, forw1)
clp = clp.RemoveDirt2(limit=rdlimit, rgrain=rgrain, _grey=_grey)
# clp = clp.RemoveDirtMC2(limit=rdlimit, rgrain=rgrain, _grey=_grey)
clp = clp.SelectEvery(3, 1)

dnc = MDegrain3(clp, super, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, thSAD=160 + 12 * denoise, \
thSCD1=255 + 4 * denoise)

# dnc = clp.MVDenoise(bvec3, bvec2, bvec1, fvec1, fvec2, fvec3, thT=denoise, thSAD=160 + 12 * denoise, \
# thmv=40, thSCD1=255 + 4 * denoise)

vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=6, percent=75)
vid_mo = (rgrain == 1) ? vid_mo.RemoveGrain(1) : vid_mo.RemoveGrain(5)
dnc = dnc.ConditionalFilter(dnc, vid_mo, "(YDifferenceFromPrevious()+YDifferenceToNext())/AverageLuma()", "<", "0.3")

return ((csharp == 0) ? dnc : clp.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40))
}


function VLQ_Filter(clip clp)
{
clp = clp.RemoveHighNoiseMC(rdlimit=24, rgrain=3, denoise=16, csharp=0.3)
clp = clp.VagueDenoiser(threshold=1.0, nsteps=6, chromaT=1.2, percent=75)
clp = clp.deen("a3d", rad=3, thrY=4, thrUV=7, min=0.25, tthY=2, tthUV=3, scd=7)
clp = clp.LimitedSharpenFaster(Smode=4, strength=28, overshoot=1, wide=false, ss_x=1.2, ss_y=1.2)

return clp
}


function VLQ_Filter_Ultimate(clip clp)
{
clp = clp.RemoveHighNoiseMC(rdlimit=24, rgrain=3, denoise=16)
clp = clp.fft3dfilter(sigma=1.2, sharpen=0.4, plane=4)
clp = clp.deen("a3d", rad=3, thrY=4, thrUV=7, min=0.25, tthY=2, tthUV=3, scd=7)

return clp
}

canuckerfan
6th March 2012, 07:34
^Thanks for the update. However, there is one caveat. I used to use the old MVToolsV1 version of RemoveNoiseMC and it removed spots quite well. However, with the MVToolsV2 version of RemoveNoiseMC, those spots aren't removed. It shouldn't be that way, should it?

canuckerfan
21st March 2012, 02:18
is there anyway to modify RemoveNoiseMC so that it still removes spots/scratches but doesn't remove grain/detail as much? here's the current code:

function RemoveNoiseMC(clip,int "rdlimit", int "rgrain", int "denoise", bool "sharp", float "csharpen", bool "_grey")
{
rdlimit = default(rdlimit,11)
rgrain = default(rgrain,2)
denoise = default(denoise,8)
sharp = (rgrain<1) ? default(sharp,true) : default(sharp,false)
csharpen = (rgrain>2) ? default(csharpen,0.17) : (rgrain>1) ? default(csharpen,0.15) : default(csharpen,0.13)
csharpen = sharp ? csharpen : csharpen+0.08
_grey = default(_grey,false)
_dgr = 0.45+rgrain*0.4
dummy = clip.BlankClip(length=0)
global idx_c = idx_c+1
cbs = 8
cov = (cbs>4) ? cbs/4 : 0
ccf = cbs*cbs/64
cpn = (denoise>12) ? 50*ccf : (denoise>8) ? 58*ccf : (denoise>5) ? 66*ccf : 72*ccf
csh = sharp ? 1 : 0
bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
backw1 = rdlimit>13 ? \
rdlimit>20 ? \
clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
clip.MVFlow(bvec1, idx=idx_c)
forw1 = rdlimit>13 ? \
rdlimit>20 ? \
clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
clip.MVFlow(fvec1, idx=idx_c)
clp = interleave(backw1,clip,forw1)
clp = clp.RemoveDirt(rdlimit,rgrain,_grey)
dnc = denoise==0 ? clp.RemoveTempGrain(rgrain).SelectEvery(3,1) : dummy
clp = clp.SelectEvery(3,1)
dnc = denoise==0 ? dnc : \
clp.MVDenoise(bvec2, bvec1, fvec1, fvec2, thT=denoise, thSAD=190+15*denoise, thmv=40, thSCD1=230+5*denoise)
vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=7, percent=75)
vid_mo = rgrain==1 ? vid_mo.RemoveGrain(1) : vid_mo.RemoveGrain(5)
dnc = dnc.ConditionalFilter(dnc, vid_mo, "(YDifferenceFromPrevious()+YDifferenceToNext())/AverageLuma()", "<", "0.3")
clp = clp.SeeSaw(dnc, Sstr=csharpen, Szp=12, SdampHi=20, bias=40)
return clp
}

canuckerfan
28th March 2012, 09:12
anyone?

Jenyok
25th March 2013, 19:17
Something else...
.

# http://forum.ixbt.com/topic.cgi?id=29:33640-65
#
function Super_Filter(clip video, int "Spatial", int "Strength", int "Frames", int "Radius", \
int "blksize", int "Despot", int "p", int "show")
{
Spatial = default(Spatial, 0)
Strength = default(Strength, 33)
Frames = default(Frames, 2)
Radius = default(Radius, 9)

S1 = Strength / 30
S2 = Strength / 100
S3 = Strength / 20
S4 = floor(s3 * 1.5)

blksize = default(blksize, 16)
(blksize < 4) ? 4 : (blksize > 32) ? 32 : blksize
overlap = blksize / 2

Despot = default(Despot, 0)
p = default(p, 100)
show = default(show, 0)


# Here is a code of function
#
video.ConvertToYV12()

super = MSuper(hpad=8, vpad=8, pel=2, sharp=2, rfilter=1)
bw = MAnalyse(super, isb=true, overlap=overlap, blksize=blksize)
fw = MAnalyse(super, isb=false, overlap=overlap, blksize=blksize)
bf1 = MCompensate(last, super, bw, planar=true)
ff1 = MCompensate(last, super, fw, planar=true)

interleave(bf1, last.MDegrain1(super, bw, fw, planar=true).MDegrain1(super, bw, fw, planar=true), ff1)

FluxSmoothST(Radius, Radius)
SelectEvery(3, 1)

(Spatial == 1) ? fft3dfilter(sigma=S1, sigma2=S2, sigma3=S3, sigma4=S4, plane=0, bw=32, bh=32, \
bt=Frames, ow=16, oh=16, sharpen=0.3, svr=1.0, measure=false, wintype=0, degrid=1.0, \
dehalo=2.0, hr=2.0, ht=75.0) : NOP()

super = MSuper(hpad=8, vpad=8, pel=2, sharp=2, rfilter=1)
bv = MAnalyse(super, isb=true, overlap=overlap, blksize=blksize)
fv = MAnalyse(super, isb=false, overlap=overlap, blksize=blksize)
bv1 = MCompensate(last, super, bv, planar=true)
fv1 = MCompensate(last, super, fv, planar=true)

interleave(bv1, last.MDegrain1(super, bv, fv, planar=true).MDegrain1(super, bv, fv, planar=true), fv1)

FluxSmoothST(Radius, Radius)

(DeSpot == 1) ? DeSpot(p1=40, p2=30, pwidth=p, pheight=p, mthres=35, merode=25, p1percent=10, sign=2, \
show=show, seg=1, color=true, motpn=true) : NOP()

SelectEvery(3, 1)

MSharpen(strength=40, debug=true)
XSharpen(strength=120, threshold=8)
LimitedSharpenFaster(strength=40, smode=3)

# unsharpmask(60, 1, 0)
# unsharpmask(60, 2, 50)

return (Gradfun2dbmod(thr=1.4, thrC=1.8, str=0.2, strC=0, temp=100, adapt=64))
}

GMJCZP
17th November 2014, 04:41
If I place internally in RemoveNoise _grey=true I get green screen.
Anyone has happened using greyscale() previously?

foxyshadis
18th November 2014, 00:36
_grey or uv trashes chroma in the RemoveGrain filters, which usually means green screen (sometimes magenta or garbage colors); follow it with a greyscale() for good output. (You can add it to the end of the function.) Newer filters can use Y8 to properly handle it.

GMJCZP
18th November 2014, 01:09
_grey or uv trashes chroma in the RemoveGrain filters, which usually means green screen (sometimes magenta or garbage colors); follow it with a greyscale() for good output. (You can add it to the end of the function.) Newer filters can use Y8 to properly handle it.

foxyshadis, You were right, it worked. :thanks:
Just before Return clp put clp = clp.Greyscale()

Is curious to use Greyscale more than once.

StainlessS
18th November 2014, 02:58
Is curious to use Greyscale more than once.

_grey means dont do anything with chroma, ie will contain whatever rubbish was in memory before new frame was created.

Greyscale sets chroma to 128.

EDIT: Oops, thats pretty much what foxyshadis said.

hnn
3rd June 2017, 00:09
Hi, nice filter! What do you think about an upgrade?

I have tried with the new version of masktools and mvtools, but the filter only work with masktools-v2b1 and mvtools 1.8.4.0

The new masktools have a probrem with SeeSaw

Evaluate: Unhandled C++ exception!

(SeeSaw.avs, line 128)

(SeeSaw.avs, line 80)

siella
20th July 2017, 12:58
I upgraded and imroved this script. I used mvtools v2, rgtools and masktools2. After some test i will share.

thescrapyard
5th December 2017, 09:08
Any updates on the improved and updated script as I use this for old cartoons and b&W films so an updated scriupt may help

Thanks