anton_foy
26th September 2022, 22:02
Dynamically adjusted denoising called OIC (pronounced "Oh I see")
Only for 16-bit HBD. Very slow startup time (for me) but pretty fast otherwise(?). Two scripts, I cannot evaluate which one is better of "OIC" or "OIC_rt".
Preserves (for my test clips) more details than TemporalDegrainV2 yet removes more noise.
Required: Exools, DeblockPack, SMdegrain (Dogway's),
GradePack, SharpenersPack, MVtools2, MaskTools2, FFT3Dfilter, neo_f3kdb, RGtools, fluxsmooth, GradationCurve + ApplyGradationCurves.avsi.
## OIC with TSMC(r) mod:
function OIC(clip c, int "tr", int "mthresh", int "thresh", int "blocksize", int "rBlk",
\ int "bt", int "FFTplane", int "ncpu", clip "auxclip", bool "pref", int "UV")
{
pref = Default(pref, true)
UV = Default(UV, 3)
tr = Default(tr, 6)
mthresh = Default(mthresh, 180)
thresh = Default(thresh, 255)
blocksize = Default(blocksize, 32)
rBlk = Default(rBlk, 8)
ncpu = Default(ncpu, 2)
bt = Default(bt, 2)
FFTplane = Default(FFTplane, 0)
chroma = UV == 3
aux=Defined(auxclip)
w = width(c)
h = height(c)
isUHD = (w > 2599 || h > 1499)
nw = round(w/2.0)
nh = round(h/2.0)
######### Scriptclip:
function NoiseMask (clip c)
{
in = c.levels(6*256,1,122*256,0,255*256).tdif.ApplyGradationCurves(lumaPoints="0,128, 40,0, 128,255, 213,0, 255,128")
S=ScriptClip(c,function[in] () {
yp = in.YDifferenceFromPrevious()
yp1 = in.selectevery(1,1).YDifferenceFromPrevious()
yp2 = in.selectevery(1,2).YDifferenceFromPrevious()
yn = in.YDifferenceToNext()
yn1 = in.selectevery(1,-1).YDifferenceToNext()
yn2 = in.selectevery(1,-2).YDifferenceToNext()
y = float(yp+yp1+yp2+yn+yn1+yn2/6)
noise = float(y*0.0000072).min(0.9).max(0.1)
o=last
merge(o,o.blackness(),noise).invert()
} )
return s
}
#########
r2 = c.reduceby2().reduceby2()
### edge mask (combat ringing/compression artefacts):
em = r2.ApplyGradationCurves(lumapoints="14,0,30,32,35,69,46,110,87,126,148,138,224,141,255,0").ex_edge(mode="frei-chen",hi=26,lo=26,uv=1).mt_deflate().mt_inflate().bilinearresize(c.width,c.height)
### motion mask (compensate for damaged fast motion):
mo = r2.mt_motion(thy1=4,thy2=4,u=1,v=1).mt_deflate().mt_expand().removegrain(20,-1).bilinearresize(c.width,c.height)
### Smoothing/deringing:
sm = c.ex_fluxsmoothST(9,12)
### merge smoothing with masks:
m1 = ex_merge(c,sm,em,uv=3)
m1
o = ex_merge(m1,sm,mo,uv=3)
o
### light color nr:
ccd = o.ccd(5)
ccd
### prefilter for better sharpness and motion:
pre = c.ex_reduceflicker(strength=2).coloryuv(autogain=true).levels(0,0.8,255*256,16*256,227*256)
### motion compensation:
inputA = pre
inputA = isUHD ? inputA.ConvertBits(8,dither=-1).BilinearResize(nw+nw%2, nh+nh%2) : inputA
super = MSuper(ccd, pel=1, hpad = 0, vpad = 0, chroma=true, mt=false, levels=1)
superfilt = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=false)
vmulti = Manalyse(superfilt,multi=true,delta=tr,temporal=true,truemotion=false,blksize=blocksize,overlap=blocksize/2, mt=false, chroma=true)
vmulti2 = Mrecalculate(superfilt,vmulti,thsad=mthresh,truemotion=false,tr=tr,blksize=rBlk,overlap=rBlk/2, mt=false, chroma=true)
vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
mocomp = Mcompensate(ccd,super,vmulti2,thsad=mthresh,tr=tr,center=true,mt=false)
### 1str. denoising stage:
dnmc1 = mocomp.temporalsoften((tr)-5,thresh,thresh,23,2)
selectevery(dnmc1,tr * 2 + 1,tr)
dec1=last
## 2nd denoising stage:
dnmc2 = dnmc1.temporalsoften(tr,thresh,thresh,23,2)
selectevery(dnmc2,tr * 2 + 1,tr)
dec2 = last
FFT = dec2.fft3dfilter(sigma=2.2,sigma2=1,sigma3=1.2,sigma4=0,plane=FFTplane,bt=bt,ncpu=ncpu)
FFT
### masking and merging Spat-Temp denoising stage 1:
st_mask = noisemask().levels(190*256,1,220*256,100*256,255*256).removegrain(20,-1)
mt_merge(dec1,FFT,st_mask,Y=3,U=3,V=3, luma=true)
### debanding:
deband = last.neo_f3kdb(grainY=23,grainC=3,mt=true)
deband
### sharpening:
sharp = ex_ContraSharpening(deband,o,mc=true)
sharp
### regain shadow info while keep debanded chroma:
db = sharp
bm = c.greyscale().levels(23*256,4.49,32*256,117,255*256).ex_invert()
mt_merge(db,FFT,bm,luma=true,Y=3,U=2,V=2).mergechroma(db)
return last
}
### a raffriff42 mod of mdiff2:
function tdif(clip C)
{
mt_lutxy(C, C.Trim(1, 0), mt_polish("16*abs(x-y)"), U=-128, V=-128)
return Last
}
#######################################
#######################################################################################################
################# OIC (pronounced "Oh I see") - a Temporal-Spatial denoiser made to preserve ######
################# as much detail as possible while cleaning up most noise/grain, compression ######
################# artefacts/ringing and banding. It is automatic and detects how noisy the ######
################# footage is and regulates the denoising strength dynamically. Fast and clean. ######
################# ######
################# Enjoy! /Anton_Foy ######
#######################################################################################################
################# Dependencies: ######
################# Exools, DeblockPack, SMdegrain (Dogway's), GradePack, ######
################# SharpenersPack, MVtools2, MaskTools2, FFT3Dfilter, Deblock, ######
################# neo_f3kdb, neo_vd, RGtools, GradationCurve + ######
################# ApplyGradationCurves.avsi, (Alternatively) MatchHistogram for ######
################# prefilter ver 2. ######
################# ######
#######################################################################################################
function OIC_rt(clip c, int "tr", int "mthresh", int "blksize", int "rcBlk", int "bt", int "ncpu",
\ int "fftplane", int "grainY", Int "grainC", int "cth", bool "db_mt", int "overshoot") {
tr = Default(tr, 7)
mthresh = Default(mthresh, 230)
blksize = Default(blksize, 32)
rcBlk = Default(rcblk, 4)
bt = Default(bt, 2)
ncpu = Default(ncpu, 2)
fftplane = Default(fftplane, 0)
grainY = Default(grainY, 23)
grainC = Default(grainC, 3)
cth = Default(cth, 5).min(9)
db_mt = Default(db_mt, true)
overshoot = Default(overshoot, 0)
r2 = c.reduceby2().reduceby2()
### edge mask (combat ringing/compression artefacts):
em = r2.ApplyGradationCurves(lumapoints="14,0,30,32,35,69,46,110,87,126,148,138,224,141,255,0").
\ ex_edge(mode="frei-chen",hi=26,lo=26,uv=1).mt_deflate().mt_inflate().
\ bilinearresize(c.width,c.height)
### motion mask (compensate for damaged fast motion):
mo = r2.mt_motion(thy1=4,thy2=4,u=1,v=1).mt_deflate().mt_expand().removegrain(20,-1).
\ bilinearresize(c.width,c.height)
### Smoothing/deringing:
sm = c.ex_fluxsmoothST(9,12)
### merge smoothing with masks:
a_m = mt_merge(c,sm,em,luma=true,u=3,v=3)
a_m
b_m = mt_merge(a_m,sm,mo,luma=true,u=3,v=3)
b_m
### light color denoise:
ccd = b_m.ccd(cth)
ccd
### prefilter for better sharpness and motion:
pre = sm.ex_reduceflicker(strength=2).coloryuv(autogain=true).
\ levels(0,0.8,255*256,16*256,227*256)
# prefilter ver 2 (MatchHistogram?).
# c8 = c.convertbits(8,dither=-1)
# mini = c8.bilinearresize(32,18).temporalsoften(2,255,255,255,2).coloryuv(autogain=true).levels(0,1,255,0,236).bilinearresize(c.width,c.height)
# mh = c8.matchhistogram(mini,c8,smoothing_window=5)
# pre = merge(c8,mh,0.9).fluxsmoothST(12,12)
function TSRT(clip c)
{
in = c.levels(6*256,1,122*256,0,255*256).tdif.
\ ApplyGradationCurves(lumaPoints="0,128, 40,0, 128,255, 213,0, 255,128")
S=ScriptClip(c,function[in] () {
yp = in.YDifferenceFromPrevious()
yp1 = in.selectevery(1,1).YDifferenceFromPrevious()
yp2 = in.selectevery(1,2).YDifferenceFromPrevious()
yn = in.YDifferenceToNext()
yn1 = in.selectevery(1,-1).YDifferenceToNext()
yn2 = in.selectevery(1,-2).YDifferenceToNext()
y = float(yp+yp1+yp2+yn+yn1+yn2/6)
nthresh = int(y*0.0021 ).min(255)
ttr = int(y*0.00006).min(7).max(2)
temporalsoften(ttr,nthresh,nthresh,23,2)
} )
return S }
### TSMC with blocksize 32 and recalculate 8/4:
TS = ccd.TSMCr_rt(tr=tr,rBlock=rcBlk,auxclip=pre)
TS
### light spat denoise:
nm = c.greyscale().levels(112*256,0.62,167*256,0,255*256).removegrain(20,-1)
F=TS.FFT3dfilter(sigma=2.2,sigma2=1,sigma3=1.2,sigma4=0,plane=fftplane,bt=bt,ncpu=ncpu)
mt_merge(TS,F,nm,luma=true,u=3,v=3)
### debanding:
deband = last.neo_f3kdb(grainY=grainY,grainC=grainC,mt=db_mt)
deband
### sharpening:
sharp = ex_ContraSharpening(deband,b_m,mc=true,overshoot=overshoot)
sharp
### regain shadow luma info while keeping shadow chroma debanded:
db = sharp
bm = c.greyscale().levels(23*256,4.49,32*256,117,255*256).ex_invert()
mt_merge(db,F,bm,luma=true,Y=3,U=2,V=2).mergechroma(db)
return last
}
################# TemporalSoftenMCr_rt - TSMC modded to adjust mrecalculates blocksize and using Runtime temporalsoften:
function TSMCr_rt(clip input, int "tr", int "mthresh", int "lcthresh", int "blocksize",
\ int "rBlock",clip "auxclip", int "Y", int "UV")
{
Y = Default(Y, 3)
UV = Default(UV, 3)
tr = Default(tr, 6) # temporal radius-number of frames analyzed before/after current frame.
mthresh = Default(mthresh, 180) # motion threshold-higher numbers denoise areas with higher motion.
blocksize = Default(blocksize, 32) #larger numbers = faster processing times.
rBlock = Default(rBlock, 8) # blocksize of mrecalculate.
chroma = UV == 3
aux = Defined(auxclip)
w = width(input)
h = height(input)
isUHD = (w > 2599 || h > 1499)
nw = round(w/2.0)
nh = round(h/2.0)
inputA = aux ? auxclip : input
inputA = isUHD ? inputA.ConvertBits(8,dither=-1).BilinearResize(nw+nw%2, nh+nh%2) : inputA
super = MSuper(input, pel=1, hpad = 0, vpad = 0, chroma=true, mt=false, levels=1)
superfilt = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=false)
vmulti = Manalyse(superfilt,multi=true,delta=tr,temporal=true,truemotion=false,blksize=blocksize,overlap=blocksize/2, mt=false, chroma=true)
vmulti2 = Mrecalculate(superfilt,vmulti,thsad=mthresh,truemotion=false,tr=tr,blksize=rBlock,overlap=rBlock/2, mt=false, chroma=true)
vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
mocomp = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tr,center=true,mt=false)
dnmc = mocomp.tsrt()
dec = selectevery(dnmc,tr * 2 + 1,tr)
Y != 3 ? input.mergechroma(dec) : dec
}
Only for 16-bit HBD. Very slow startup time (for me) but pretty fast otherwise(?). Two scripts, I cannot evaluate which one is better of "OIC" or "OIC_rt".
Preserves (for my test clips) more details than TemporalDegrainV2 yet removes more noise.
Required: Exools, DeblockPack, SMdegrain (Dogway's),
GradePack, SharpenersPack, MVtools2, MaskTools2, FFT3Dfilter, neo_f3kdb, RGtools, fluxsmooth, GradationCurve + ApplyGradationCurves.avsi.
## OIC with TSMC(r) mod:
function OIC(clip c, int "tr", int "mthresh", int "thresh", int "blocksize", int "rBlk",
\ int "bt", int "FFTplane", int "ncpu", clip "auxclip", bool "pref", int "UV")
{
pref = Default(pref, true)
UV = Default(UV, 3)
tr = Default(tr, 6)
mthresh = Default(mthresh, 180)
thresh = Default(thresh, 255)
blocksize = Default(blocksize, 32)
rBlk = Default(rBlk, 8)
ncpu = Default(ncpu, 2)
bt = Default(bt, 2)
FFTplane = Default(FFTplane, 0)
chroma = UV == 3
aux=Defined(auxclip)
w = width(c)
h = height(c)
isUHD = (w > 2599 || h > 1499)
nw = round(w/2.0)
nh = round(h/2.0)
######### Scriptclip:
function NoiseMask (clip c)
{
in = c.levels(6*256,1,122*256,0,255*256).tdif.ApplyGradationCurves(lumaPoints="0,128, 40,0, 128,255, 213,0, 255,128")
S=ScriptClip(c,function[in] () {
yp = in.YDifferenceFromPrevious()
yp1 = in.selectevery(1,1).YDifferenceFromPrevious()
yp2 = in.selectevery(1,2).YDifferenceFromPrevious()
yn = in.YDifferenceToNext()
yn1 = in.selectevery(1,-1).YDifferenceToNext()
yn2 = in.selectevery(1,-2).YDifferenceToNext()
y = float(yp+yp1+yp2+yn+yn1+yn2/6)
noise = float(y*0.0000072).min(0.9).max(0.1)
o=last
merge(o,o.blackness(),noise).invert()
} )
return s
}
#########
r2 = c.reduceby2().reduceby2()
### edge mask (combat ringing/compression artefacts):
em = r2.ApplyGradationCurves(lumapoints="14,0,30,32,35,69,46,110,87,126,148,138,224,141,255,0").ex_edge(mode="frei-chen",hi=26,lo=26,uv=1).mt_deflate().mt_inflate().bilinearresize(c.width,c.height)
### motion mask (compensate for damaged fast motion):
mo = r2.mt_motion(thy1=4,thy2=4,u=1,v=1).mt_deflate().mt_expand().removegrain(20,-1).bilinearresize(c.width,c.height)
### Smoothing/deringing:
sm = c.ex_fluxsmoothST(9,12)
### merge smoothing with masks:
m1 = ex_merge(c,sm,em,uv=3)
m1
o = ex_merge(m1,sm,mo,uv=3)
o
### light color nr:
ccd = o.ccd(5)
ccd
### prefilter for better sharpness and motion:
pre = c.ex_reduceflicker(strength=2).coloryuv(autogain=true).levels(0,0.8,255*256,16*256,227*256)
### motion compensation:
inputA = pre
inputA = isUHD ? inputA.ConvertBits(8,dither=-1).BilinearResize(nw+nw%2, nh+nh%2) : inputA
super = MSuper(ccd, pel=1, hpad = 0, vpad = 0, chroma=true, mt=false, levels=1)
superfilt = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=false)
vmulti = Manalyse(superfilt,multi=true,delta=tr,temporal=true,truemotion=false,blksize=blocksize,overlap=blocksize/2, mt=false, chroma=true)
vmulti2 = Mrecalculate(superfilt,vmulti,thsad=mthresh,truemotion=false,tr=tr,blksize=rBlk,overlap=rBlk/2, mt=false, chroma=true)
vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
mocomp = Mcompensate(ccd,super,vmulti2,thsad=mthresh,tr=tr,center=true,mt=false)
### 1str. denoising stage:
dnmc1 = mocomp.temporalsoften((tr)-5,thresh,thresh,23,2)
selectevery(dnmc1,tr * 2 + 1,tr)
dec1=last
## 2nd denoising stage:
dnmc2 = dnmc1.temporalsoften(tr,thresh,thresh,23,2)
selectevery(dnmc2,tr * 2 + 1,tr)
dec2 = last
FFT = dec2.fft3dfilter(sigma=2.2,sigma2=1,sigma3=1.2,sigma4=0,plane=FFTplane,bt=bt,ncpu=ncpu)
FFT
### masking and merging Spat-Temp denoising stage 1:
st_mask = noisemask().levels(190*256,1,220*256,100*256,255*256).removegrain(20,-1)
mt_merge(dec1,FFT,st_mask,Y=3,U=3,V=3, luma=true)
### debanding:
deband = last.neo_f3kdb(grainY=23,grainC=3,mt=true)
deband
### sharpening:
sharp = ex_ContraSharpening(deband,o,mc=true)
sharp
### regain shadow info while keep debanded chroma:
db = sharp
bm = c.greyscale().levels(23*256,4.49,32*256,117,255*256).ex_invert()
mt_merge(db,FFT,bm,luma=true,Y=3,U=2,V=2).mergechroma(db)
return last
}
### a raffriff42 mod of mdiff2:
function tdif(clip C)
{
mt_lutxy(C, C.Trim(1, 0), mt_polish("16*abs(x-y)"), U=-128, V=-128)
return Last
}
#######################################
#######################################################################################################
################# OIC (pronounced "Oh I see") - a Temporal-Spatial denoiser made to preserve ######
################# as much detail as possible while cleaning up most noise/grain, compression ######
################# artefacts/ringing and banding. It is automatic and detects how noisy the ######
################# footage is and regulates the denoising strength dynamically. Fast and clean. ######
################# ######
################# Enjoy! /Anton_Foy ######
#######################################################################################################
################# Dependencies: ######
################# Exools, DeblockPack, SMdegrain (Dogway's), GradePack, ######
################# SharpenersPack, MVtools2, MaskTools2, FFT3Dfilter, Deblock, ######
################# neo_f3kdb, neo_vd, RGtools, GradationCurve + ######
################# ApplyGradationCurves.avsi, (Alternatively) MatchHistogram for ######
################# prefilter ver 2. ######
################# ######
#######################################################################################################
function OIC_rt(clip c, int "tr", int "mthresh", int "blksize", int "rcBlk", int "bt", int "ncpu",
\ int "fftplane", int "grainY", Int "grainC", int "cth", bool "db_mt", int "overshoot") {
tr = Default(tr, 7)
mthresh = Default(mthresh, 230)
blksize = Default(blksize, 32)
rcBlk = Default(rcblk, 4)
bt = Default(bt, 2)
ncpu = Default(ncpu, 2)
fftplane = Default(fftplane, 0)
grainY = Default(grainY, 23)
grainC = Default(grainC, 3)
cth = Default(cth, 5).min(9)
db_mt = Default(db_mt, true)
overshoot = Default(overshoot, 0)
r2 = c.reduceby2().reduceby2()
### edge mask (combat ringing/compression artefacts):
em = r2.ApplyGradationCurves(lumapoints="14,0,30,32,35,69,46,110,87,126,148,138,224,141,255,0").
\ ex_edge(mode="frei-chen",hi=26,lo=26,uv=1).mt_deflate().mt_inflate().
\ bilinearresize(c.width,c.height)
### motion mask (compensate for damaged fast motion):
mo = r2.mt_motion(thy1=4,thy2=4,u=1,v=1).mt_deflate().mt_expand().removegrain(20,-1).
\ bilinearresize(c.width,c.height)
### Smoothing/deringing:
sm = c.ex_fluxsmoothST(9,12)
### merge smoothing with masks:
a_m = mt_merge(c,sm,em,luma=true,u=3,v=3)
a_m
b_m = mt_merge(a_m,sm,mo,luma=true,u=3,v=3)
b_m
### light color denoise:
ccd = b_m.ccd(cth)
ccd
### prefilter for better sharpness and motion:
pre = sm.ex_reduceflicker(strength=2).coloryuv(autogain=true).
\ levels(0,0.8,255*256,16*256,227*256)
# prefilter ver 2 (MatchHistogram?).
# c8 = c.convertbits(8,dither=-1)
# mini = c8.bilinearresize(32,18).temporalsoften(2,255,255,255,2).coloryuv(autogain=true).levels(0,1,255,0,236).bilinearresize(c.width,c.height)
# mh = c8.matchhistogram(mini,c8,smoothing_window=5)
# pre = merge(c8,mh,0.9).fluxsmoothST(12,12)
function TSRT(clip c)
{
in = c.levels(6*256,1,122*256,0,255*256).tdif.
\ ApplyGradationCurves(lumaPoints="0,128, 40,0, 128,255, 213,0, 255,128")
S=ScriptClip(c,function[in] () {
yp = in.YDifferenceFromPrevious()
yp1 = in.selectevery(1,1).YDifferenceFromPrevious()
yp2 = in.selectevery(1,2).YDifferenceFromPrevious()
yn = in.YDifferenceToNext()
yn1 = in.selectevery(1,-1).YDifferenceToNext()
yn2 = in.selectevery(1,-2).YDifferenceToNext()
y = float(yp+yp1+yp2+yn+yn1+yn2/6)
nthresh = int(y*0.0021 ).min(255)
ttr = int(y*0.00006).min(7).max(2)
temporalsoften(ttr,nthresh,nthresh,23,2)
} )
return S }
### TSMC with blocksize 32 and recalculate 8/4:
TS = ccd.TSMCr_rt(tr=tr,rBlock=rcBlk,auxclip=pre)
TS
### light spat denoise:
nm = c.greyscale().levels(112*256,0.62,167*256,0,255*256).removegrain(20,-1)
F=TS.FFT3dfilter(sigma=2.2,sigma2=1,sigma3=1.2,sigma4=0,plane=fftplane,bt=bt,ncpu=ncpu)
mt_merge(TS,F,nm,luma=true,u=3,v=3)
### debanding:
deband = last.neo_f3kdb(grainY=grainY,grainC=grainC,mt=db_mt)
deband
### sharpening:
sharp = ex_ContraSharpening(deband,b_m,mc=true,overshoot=overshoot)
sharp
### regain shadow luma info while keeping shadow chroma debanded:
db = sharp
bm = c.greyscale().levels(23*256,4.49,32*256,117,255*256).ex_invert()
mt_merge(db,F,bm,luma=true,Y=3,U=2,V=2).mergechroma(db)
return last
}
################# TemporalSoftenMCr_rt - TSMC modded to adjust mrecalculates blocksize and using Runtime temporalsoften:
function TSMCr_rt(clip input, int "tr", int "mthresh", int "lcthresh", int "blocksize",
\ int "rBlock",clip "auxclip", int "Y", int "UV")
{
Y = Default(Y, 3)
UV = Default(UV, 3)
tr = Default(tr, 6) # temporal radius-number of frames analyzed before/after current frame.
mthresh = Default(mthresh, 180) # motion threshold-higher numbers denoise areas with higher motion.
blocksize = Default(blocksize, 32) #larger numbers = faster processing times.
rBlock = Default(rBlock, 8) # blocksize of mrecalculate.
chroma = UV == 3
aux = Defined(auxclip)
w = width(input)
h = height(input)
isUHD = (w > 2599 || h > 1499)
nw = round(w/2.0)
nh = round(h/2.0)
inputA = aux ? auxclip : input
inputA = isUHD ? inputA.ConvertBits(8,dither=-1).BilinearResize(nw+nw%2, nh+nh%2) : inputA
super = MSuper(input, pel=1, hpad = 0, vpad = 0, chroma=true, mt=false, levels=1)
superfilt = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=false)
vmulti = Manalyse(superfilt,multi=true,delta=tr,temporal=true,truemotion=false,blksize=blocksize,overlap=blocksize/2, mt=false, chroma=true)
vmulti2 = Mrecalculate(superfilt,vmulti,thsad=mthresh,truemotion=false,tr=tr,blksize=rBlock,overlap=rBlock/2, mt=false, chroma=true)
vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
mocomp = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tr,center=true,mt=false)
dnmc = mocomp.tsrt()
dec = selectevery(dnmc,tr * 2 + 1,tr)
Y != 3 ? input.mergechroma(dec) : dec
}