Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th April 2022, 14:12   #1  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
TRMC Auxclip / prefilter error

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:
Code:
MCompensate : wrong source or super frame size
It refers to line 197:
Code:
mocomp  = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tradius,center=true,mt=true)
Any ideas?

TRMC:
Code:
# 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:
Code:
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)

Last edited by anton_foy; 9th April 2022 at 14:21.
anton_foy is offline   Reply With Quote
Old 9th April 2022, 16:56   #2  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
I did I quick read, try:
Code:
    super = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=true)
   
    vmulti  = Manalyse(super,multi=true,delta=tradius,temporal=true,truemotion=true,blksize=blocksize,overlap=blocksize/2, mt=true, chroma=true)
    vmulti2 = Mrecalculate(super,vmulti,thsad=mthresh,truemotion=true,tr=tradius,blksize=blocksize/2,overlap=blocksize/4, mt=true, chroma=true)
    vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
    super   = aux || isUHD ? MSuper(input, pel=1, hpad = 0, vpad = 0, chroma=true, mt=true, levels=1) : super
    
    mocomp  = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tradius,center=true,mt=true)
    dnmc    = mocomp.T_REP(T=Tradius,LR=LR,CR=CR)
It probabily won't work, but the idea is that one.

Last edited by Ceppo; 9th April 2022 at 17:01.
Ceppo is offline   Reply With Quote
Old 9th April 2022, 17:25   #3  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Ceppo View Post
I did I quick read, try:
Code:
    super = MSuper(inputA,pel=1, hpad = 0, vpad = 0, chroma=true, mt=true)
   
    vmulti  = Manalyse(super,multi=true,delta=tradius,temporal=true,truemotion=true,blksize=blocksize,overlap=blocksize/2, mt=true, chroma=true)
    vmulti2 = Mrecalculate(super,vmulti,thsad=mthresh,truemotion=true,tr=tradius,blksize=blocksize/2,overlap=blocksize/4, mt=true, chroma=true)
    vmulti2 = isUHD ? vmulti2.MScaleVect() : vmulti2
    super   = aux || isUHD ? MSuper(input, pel=1, hpad = 0, vpad = 0, chroma=true, mt=true, levels=1) : super
    
    mocomp  = Mcompensate(input,super,vmulti2,thsad=mthresh,tr=tradius,center=true,mt=true)
    dnmc    = mocomp.T_REP(T=Tradius,LR=LR,CR=CR)
It probabily won't work, but the idea is that one.
Thanks but same error unfortunately.
anton_foy is offline   Reply With Quote
Old 9th April 2022, 17:28   #4  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
To answer your PM since I don't have more space, it looks a bit to TemporalSoften mode in SMDegrain.
Code:
SMDegrain(6, 180, mode="TemporalSoften", prefilter=5, ContraSharp=false, RefineMotion=true, LFR=0, DCTFlicker=true)
I will have a look at the auxclip issue.

EDIT: It happens with UHD sources because you are not downscaling 'auxclip' as you do with 'inputA'

Try this:
Code:
    inputA  = aux ? auxclip : input
    inputA  = isUHD ? inputA.ConvertBits(8,dither=-1).BilinearResize(nw+nw%2, nh+nh%2) : inputA
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 9th April 2022 at 17:35.
Dogway is offline   Reply With Quote
Old 9th April 2022, 17:37   #5  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Dogway View Post
To answer your PM since I don't have more space, it looks a bit to TemporalSoften mode in SMDegrain.
Code:
SMDegrain(6, 180, mode="TemporalSoften", prefilter=5, ContraSharp=false, RefineMotion=true, LFR=0, DCTFlicker=true)
I will have a look at the auxclip issue.

EDIT: It happens with UHD sources because you are not downscaling 'auxclip' as you do with 'inputA'
Thanks you yes they are very similar and very close in speed too but I noticed TRMC retains more detail and if truemotion=false it is even better than if =true.

EDIT: It works thank you!

Last edited by anton_foy; 9th April 2022 at 17:40.
anton_foy is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.