anton_foy
9th April 2022, 14:12
Hey, I modified TSMC to TRMC based off of a Didée idea but when I try to use auxclip to prefilter I get this error message:
MCompensate : wrong source or super frame size
It refers to line 197: mocomp = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tradius,center=true,mt=true)
Any ideas?
TRMC:
# TRMC
function TRMC(clip input, int "tradius", int "mthresh", int "lumathresh", int "LR", int "CR",
\ int "blocksize",clip "auxclip", bool "pref", int "Y", int "UV")
{
pref = Default(pref, true)
Y = Default(Y, 3)
UV = Default(UV, 2)
t=Defined(tradius)
tradius=t ? tradius : 6
# temporal radius-number of frames analyzed before/after current frame.
LR = Default( LR, 12)
CR = Default( CR, 30)
m=Defined(mthresh)
mthresh=m ? mthresh : 180
# motion threshold-higher numbers denoise areas with higher motion.
#Anything above this number does not get denoised.
l=Defined(lumathresh)
lumathresh=l ? lumathresh : 255
# luma threshold- Denoise pixels that match in surrounding frames.
#255 is the maximum and default. 0-255 are valid numbers.
#Also adjusts chroma threshold.
b=Defined(blocksize)
blocksize=b ? blocksize : 16
#larger numbers = faster processing times
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 = input
inputA = aux ? auxclip : 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=true, levels=1)
superfilt = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=true)
vmulti = Manalyse(superfilt,multi=true,delta=tradius,temporal=true,truemotion=true,blksize=blocksize,overlap=blocksize/2, mt=true, chroma=true)
vmulti2 = Mrecalculate(superfilt,vmulti,thsad=mthresh,truemotion=true,tr=tradius,blksize=blocksize/2,overlap=blocksize/4, mt=true, chroma=true)
vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
mocomp = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tradius,center=true,mt=true)
dnmc = mocomp.T_REP(T=Tradius,LR=LR,CR=CR)
dec = selectevery(dnmc,tradius * 2 + 1,tradius)
Y != 3 ? input.mergechroma(dec) : dec }
function T_rep(clip c, int "t", int "lr", int "cr"){
T = Default( T, 6)
LR = Default( LR, 12)
CR = Default( CR, 30)
c.temporalsoften(t,lr,cr,28,2)
last.clense().repair(last,1)
}
Avs script line:
p = coloryuv(autogain=true).fft3dfilter(sigma=0.7,sigma2=1,sigma3=1.7,sigma4=1.7,plane=0,bt=1,ncpu=4)
Trmc(auxclip=p)
MCompensate : wrong source or super frame size
It refers to line 197: mocomp = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tradius,center=true,mt=true)
Any ideas?
TRMC:
# TRMC
function TRMC(clip input, int "tradius", int "mthresh", int "lumathresh", int "LR", int "CR",
\ int "blocksize",clip "auxclip", bool "pref", int "Y", int "UV")
{
pref = Default(pref, true)
Y = Default(Y, 3)
UV = Default(UV, 2)
t=Defined(tradius)
tradius=t ? tradius : 6
# temporal radius-number of frames analyzed before/after current frame.
LR = Default( LR, 12)
CR = Default( CR, 30)
m=Defined(mthresh)
mthresh=m ? mthresh : 180
# motion threshold-higher numbers denoise areas with higher motion.
#Anything above this number does not get denoised.
l=Defined(lumathresh)
lumathresh=l ? lumathresh : 255
# luma threshold- Denoise pixels that match in surrounding frames.
#255 is the maximum and default. 0-255 are valid numbers.
#Also adjusts chroma threshold.
b=Defined(blocksize)
blocksize=b ? blocksize : 16
#larger numbers = faster processing times
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 = input
inputA = aux ? auxclip : 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=true, levels=1)
superfilt = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=true)
vmulti = Manalyse(superfilt,multi=true,delta=tradius,temporal=true,truemotion=true,blksize=blocksize,overlap=blocksize/2, mt=true, chroma=true)
vmulti2 = Mrecalculate(superfilt,vmulti,thsad=mthresh,truemotion=true,tr=tradius,blksize=blocksize/2,overlap=blocksize/4, mt=true, chroma=true)
vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
mocomp = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tradius,center=true,mt=true)
dnmc = mocomp.T_REP(T=Tradius,LR=LR,CR=CR)
dec = selectevery(dnmc,tradius * 2 + 1,tradius)
Y != 3 ? input.mergechroma(dec) : dec }
function T_rep(clip c, int "t", int "lr", int "cr"){
T = Default( T, 6)
LR = Default( LR, 12)
CR = Default( CR, 30)
c.temporalsoften(t,lr,cr,28,2)
last.clense().repair(last,1)
}
Avs script line:
p = coloryuv(autogain=true).fft3dfilter(sigma=0.7,sigma2=1,sigma3=1.7,sigma4=1.7,plane=0,bt=1,ncpu=4)
Trmc(auxclip=p)