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

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th June 2023, 19:30   #1  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Clay - Denoising script

Back again with yet another denoising function.

Clay tries to remove all noise while keeping the details intact. Simple, fast and temporally stable.
(loads of thanks to DTL, Dogway and StainlessS for the ideas and development etc.)

How it works:
Clay denoises bright areas in one mdegrain call and the dark areas in another then merging them together with a mask.
Dogway's brilliant ccd + iqmv + sbr combo for prefiltering.
To regain sharpness and detail it uses ex_unsharp before MSuper.
To smooth out bad blocks it uses vsdegrainmedian before mdegrain.
Neo VagueDenoiser in the dark areas for spatial smoothness.

(The same settings were used for all three images, see usage settings on the bottom of the page)
Before-After (ImgSli is compressing the images so banding occurs here)
House (Requested by Coolgit)
Test Clips (93mb)

#vsdegrainmedian = FAST!
#iqmv + ex_sbr = FAST!
#neo_vd = FAST!
#ex_unsharp = FAST!
#Clay - mdegrain = medium-fast.
#Results in combination = fine quality and fast!

requirements:
mvtools2, masktools2, neo vaguedenoiser

Additional(with my settings):
Vsdegrainmedian, deblock, neo_F3KDB, (Dogway's): extools, sharpeners pack, deblock pack


Function:
Code:
function clay(clip Input, clip "preclip", clip "superclip", clip "darkclip", clip "brightclip", int "DthSAD", int "DthSADC",
\ int "BthSAD", int "BthSADC", int "TR", int "BLKSize", int "Rb", int "Overlap", int "Pel", bool "Chroma",
\ float "VDTh", bool "tm", float "Falloff", int "UV", int "lo", int "hi", float "mid", int "mix", bool "fast")
{
DthSAD = default(DthSAD,  150)
DthSADC= default(DthSADC, 150)
BthSAD = default(BthSAD,   70)
BthSADC= default(BthSADC,  70)
TR = default(TR, 6)
BLKSize = default(BLKSize, 32)
Overlap = default(Overlap, 16)
Rb = default(Rb, 8)
Pel = default(Pel, 1)
Chroma = default(Chroma, true)
Tm = default(Tm, false)
Falloff = default(Falloff, 0.9)
VDth = default(VDth, 1.5)
lo = default(lo,     60)
mid = default(mid, 0.57)
hi = default(hi,    127)
mix = default(mix,  230)
UV = default(UV, 3)
Fast = default(Fast, false)
Bt= BitLShift(1,input.BitsPerComponent - 8)

preclip = Default(preclip,input)
superclip = Default(superclip,input)
darkclip = Default(darkclip,input)
brightclip = Default(brightclip,input)

super = MSuper(superclip, pel=pel, hpad = 0, vpad = 0, chroma=chroma, mt=false, levels=1, sharp=1)
superB = MSuper(superclip.merge(input), pel=pel, hpad = 0, vpad = 0, chroma=chroma, mt=false, levels=1, sharp=1)
superfilt = MSuper(preclip, pel=pel, hpad = 0, vpad = 0, mt=false,sharp=1)
Multi_Vector = Superfilt.MAnalyse(Multi=True, Delta=tr, BLKSize=BLKSize, Overlap=Overlap, Chroma=Chroma, truemotion=tm ,global=true)
vmulti2 = Mrecalculate(superfilt,multi_vector,thsad=Dthsad,truemotion=tm,tr=tr,blksize=rb,overlap=rb/2,mt=false,chroma=true)

mv_bw1=SelectEvery(multi_vector, tr*2, 0)
mv_fw1=SelectEvery(multi_vector, tr*2, 1)
mv_bw2=SelectEvery(multi_vector, tr*2, 2)
mv_fw2=SelectEvery(multi_vector, tr*2, 3)

dark=darkclip.MDegrainN(Super, vmulti2, TR, thSAD=DthSAD, thSAD2=Int(DthSAD*Falloff), thSADC=DthSADC, thSADC2=Int(DthSADC*Falloff)).neo_vd(VDth,1,6,90)

bright = Fast ? input : brightclip.MDegrain2(SuperB, mv_bw1, mv_fw1, mv_bw2, mv_fw2, thSAD=BthSAD, thSADC=BthSADC)

mask=dark.extractY().levels(lo*bt, mid, hi*bt, 0, mix*bt)

mt_merge(dark, bright, mask, luma=true, u=uv, v=uv)

return last
}
Usage (my own settings):
Code:
convertbits(16)
converttoYUV444()

# My prefiltering (or use your own desired prefilter):
cd=convertbits(8,dither=-1).convertToYv12()
pre=cd.CCD(13).ex_median("IQMV",Y=3,UV=3).ex_sbr(2)

# Clay with preclip, superclip, darkclip and brightclip:
Clay(tr=7,dthsad=170,dthsadc=170,bthsad=100,preclip=pre,superclip=ex_unsharp(1.77,th=1.1,fc=width(),safe=true,UV=1),darkclip=vsdegrainmedian(),brightclip=last,chroma=true)

# Deblocking chroma and debanding luma:
deblock(planes="UV")
neo_F3KDB(grainY=0,grainC=0,Y=46,mt=true,output_depth=16,range=22,sample_mode=3).mergechroma(last)
Convertbits(10,dither=1)
prefetch(4)
Please give input
Enjoy!

Edit: changed "input" to "bright" in mt_merge call and inputD instead of darkclip, inputB instead of brightclip.
Edit2: updated function and usage with DTL's, StainlessS's and Gavino's input. Thanks guys!
Edit3: StainlessS cleanup for preclip, superclip, darkclip and brightclip, thanks!
Edit4: New "settings", changed params for neo_f3kdb for less smearing of details in dark areas.

Last edited by anton_foy; 22nd August 2023 at 17:49.
anton_foy is offline   Reply With Quote
Old 19th June 2023, 23:31   #2  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,058
For better MVs search in MAnalyse it may be recommended for 'slow/slowest/placebo' mode search=3, searchparam>2 and pelsearch>2, trymany=true. And may be some manual play with all penalties (non-zero values).

Also after yet another time reading the docs:
multi
When set to true, MAnalyse generates the motion vectors for all the reference frames −delta…−1 and +1…+delta. The resulting clip is made of single MAnalyse results interleaved in the delta order −1, +1, −2, +2, …, −delta, +delta, where negative values indicate backward searchs. This order is similar to the motion vector parameters in MDegrain3. The output clip is intended to be used directly in MDegrainN. Single motion vector clips can be extracted with a SelectEvery(delta*2, n).

So may be if it is required to use different MDegrainN with different tr-settings (for lower denoise and better details saving for example at one of the processing stream) - may be it is possible to extract required 'mv-frames' from single MAnalyse and reuse at different MDegrainN with different tr-settings ? With old stable 2.7.45 version from pinterf. It will make better performance of script because of AVS caching required mv-frames from single MAnalyse output to different MDegrainN.

At least before tr>6 the MDegrainX may be used as 'low-tr' degrain with extracted bv/fv mv-frames using SelectEvery ?

Last edited by DTL; 19th June 2023 at 23:39.
DTL is offline   Reply With Quote
Old 20th June 2023, 00:21   #3  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by DTL View Post
For better MVs search in MAnalyse it may be recommended for 'slow/slowest/placebo' mode search=3, searchparam>2 and pelsearch>2, trymany=true. And may be some manual play with all penalties (non-zero values).
Thank you I will experiment with these params.

Quote:
It will make better performance of script because of AVS caching required mv-frames from single MAnalyse output to different MDegrainN.

At least before tr>6 the MDegrainX may be used as 'low-tr' degrain with extracted bv/fv mv-frames using SelectEvery ?
Sounds great but I do not know how to script that to my function correctly, could you show me an example maybe? I am tired now and maybe I can understand better tomorrow.
anton_foy is offline   Reply With Quote
Old 20th June 2023, 01:15   #4  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 223
Nice one. The photo was a good example, the face doesn't look plasticity and the winkle lines are still there. How about a photo example of a building?
coolgit is offline   Reply With Quote
Old 20th June 2023, 08:38   #5  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by coolgit View Post
Nice one. The photo was a good example, the face doesn't look plasticity and the winkle lines are still there. How about a photo example of a building?
Thanks! Yes I actually have one old building with an uneven facade thats a bit noisy. Will do.
anton_foy is offline   Reply With Quote
Old 20th June 2023, 10:06   #6  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,058
This idea:
Code:
tr = 6 # Temporal radius
super = MSuper ()
multi_vec = MAnalyse (super, multi=true, delta=tr)
big_tr=MDegrainN(super, multi_vec, tr, thSAD=400, thSAD2=150)

mv_bw1=SelectEvery(tr*2, 1) // or may be correct start from 0 ?
mv_fw1=SelectEvery(tr*2, 2)
mv_bw2=SelectEvery(tr*2, 3)
mv_fw2=SelectEvery(tr*2, 4)
mv_bw3=SelectEvery(tr*2, 5)
mv_fw4=SelectEvery(tr*2, 6)

mdgn3=MDegrain3(super, mvbw=mv_bw1, mvfw=mv_fw1,  mvbw2=mv_bw2, mvfw2=mv_fw2, mvbw3=mv_bw3, mvfw3=mv_fw3, ...)
Also may be mv_bw1...mv_fwN may be interleaved to feed other MDegrainN with different tr so only MDegrainN may be used with any tr up to max supported. The tr-converting of multi-MAnalyse output may be assembled into some function to use.
DTL is offline   Reply With Quote
Old 20th June 2023, 11:31   #7  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by DTL View Post
This idea:
Code:
tr = 6 # Temporal radius
super = MSuper ()
multi_vec = MAnalyse (super, multi=true, delta=tr)
big_tr=MDegrainN(super, multi_vec, tr, thSAD=400, thSAD2=150)

mv_bw1=SelectEvery(tr*2, 1) // or may be correct start from 0 ?
mv_fw1=SelectEvery(tr*2, 2)
mv_bw2=SelectEvery(tr*2, 3)
mv_fw2=SelectEvery(tr*2, 4)
mv_bw3=SelectEvery(tr*2, 5)
mv_fw4=SelectEvery(tr*2, 6)

mdgn3=MDegrain3(super, mvbw=mv_bw1, mvfw=mv_fw1,  mvbw2=mv_bw2, mvfw2=mv_fw2, mvbw3=mv_bw3, mvfw3=mv_fw3, ...)
Also may be mv_bw1...mv_fwN may be interleaved to feed other MDegrainN with different tr so only MDegrainN may be used with any tr up to max supported. The tr-converting of multi-MAnalyse output may be assembled into some function to use.
You mean like this if using mdegrain2?
Code:
function clay(clip Input, clip "preclip", clip "superclip", clip "darkclip", clip "brightclip", int "DthSAD", int "DthSADC", int "BthSAD", int "BthSADC", int "TR", int "BLKSize", int "Rb", int "Overlap", int "Pel", bool "Chroma",
\ float "VDTh", int "Shrp", int "Rad", float "thr", bool "tm", float "Falloff", int "UV", int "lo", int "hi", float "mid", int "mix", bool "fast")
{
DthSAD = default(DthSAD,  150)
DthSADC= default(DthSADC, 150)
BthSAD = default(BthSAD,   70)
BthSADC= default(BthSADC,  70)
TR = default(TR1, 6)
#TR2 = default(TR2, 2) #not needed for mdg2
BLKSize = default(BLKSize, 32)
Overlap = default(Overlap, 16)
Rb = default(Rb, 8)
Pel = default(Pel, 1)
Chroma = default(Chroma, true)
Tm = default(Tm, false)
Falloff = default(Falloff, 0.9)
VDth = default(VDth, 1.5)
lo = default(lo,     60)
mid = default(mid, 0.57)
hi = default(hi,    127)
mix = default(mix,  230)
UV = default(UV, 3)
Fast = default(Fast, false)
Bt= BitLShift(1,input.BitsPerComponent - 8)

pre = defined(preclip)
inputP = pre ? preclip : input

sup = defined(superclip)
inputS = sup ? superclip : input

drk = defined(darkclip)
inputD = drk ? darkclip : input

brt = defined(brightclip)
inputB = brt ? brightclip : input

super = MSuper(inputS, pel=pel, hpad = 0, vpad = 0, chroma=chroma, mt=false, levels=1, sharp=1)
superB = MSuper(inputS.merge(input), pel=pel, hpad = 0, vpad = 0, chroma=chroma, mt=false, levels=1, sharp=1)
superfilt = MSuper(inputP, pel=pel, hpad = 0, vpad = 0, mt=false,sharp=1)
Multi_Vector = Superfilt.MAnalyse(Multi=True, Delta=tr, BLKSize=BLKSize, Overlap=Overlap, Chroma=Chroma, truemotion=tm ,global=true)
vmulti2 = Mrecalculate(superfilt,multi_vector,thsad=Dthsad,truemotion=false,tr=tr,blksize=rb,overlap=rb/2,mt=false,chroma=true)

dark=darkclip.MDegrainN(Super, vmulti2, tr, thSAD=DthSAD, thSAD2=Int(DthSAD*Falloff), thSADC=DthSADC, thSADC2=Int(DthSADC*Falloff)).neo_vd(VDth,1,6,90)

mv_bw1=Multi_Vector.SelectEvery(tr*2, 1) // or 0?
mv_fw1=Multi_Vector.SelectEvery(tr*2, 2)
mv_bw2=Multi_Vector.SelectEvery(tr*2, 3)
mv_fw2=Multi_Vector.SelectEvery(tr*2, 4)

bright = Fast ? dark.merge(input, 0.7) : brightclip.MDegrain2(SuperB, mvbw=mv_bw1, mvfw=mv_fw1,  mvbw2=mv_bw2, mvfw2=mv_fw2, mvbw3=mv_bw3, mvfw3=mv_fw3, thSAD=BthSAD, thSAD2=Int(BthSAD*Falloff), thSADC=BthSADC, thSADC2=Int(BthSADC*Falloff))

mask=dark.extractY().levels(lo*bt, mid, hi*bt, 0, mix*bt)
mt_merge(dark, bright, mask, luma=true, u=uv, v=uv)

return last
}​
And also would it maybe be better to use something like:

Code:
bright=mdegrain2(...)
dark=bright.deblock(planes="yuv", quant=50).mdegrain5(...)
mask=...
mt_merge(dark,bright,mask...)
Thinking mdg2+mdg5 would equal mdegrain with strength of tr=7? EDIT: No I did not think clearly, tr is still max 5 then.

Last edited by anton_foy; 20th June 2023 at 12:03.
anton_foy is offline   Reply With Quote
Old 20th June 2023, 12:08   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I have not tried your script, but this stuck out a bit for me.
Code:
dark=darkclip.MDegrainN(Super, vmulti2, tr, thSAD=DthSAD, thSAD2=Int(DthSAD*Falloff), thSADC=DthSADC, thSADC2=Int(DthSADC*Falloff)).neo_vd(VDth,1,6,90)
darkclip is an optional arg, and is not defaulted anywhere, so could be "UnDefined".

Suggest maybe try see if all works OK with ALL defaulted optional args.

I have not looked for additional problems.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 20th June 2023, 12:16   #9  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by StainlessS View Post
I have not tried your script, but this stuck out a bit for me.
Code:
dark=darkclip.MDegrainN(Super, vmulti2, tr, thSAD=DthSAD, thSAD2=Int(DthSAD*Falloff), thSADC=DthSADC, thSADC2=Int(DthSADC*Falloff)).neo_vd(VDth,1,6,90)
darkclip is an optional arg, and is not defaulted anywhere, so could be "UnDefined".

Suggest maybe try see if all works OK with ALL defaulted optional args.

I have not looked for additional problems.
Here it is defined:
Code:
function clay(clip Input, clip "preclip", clip "superclip", clip "darkclip", clip "brightclip", int "DthSAD", int "DthSADC", int "BthSAD", int "BthSADC", int "TR1", int "TR2", int "BLKSize", int "Rb", int "Overlap", int "Pel", bool "Chroma",
\ float "VDTh", int "Shrp", int "Rad", float "thr", bool "tm", float "Falloff", int "UV", int "lo", int "hi", float "mid", int "mix", bool "fast")
{
DthSAD = default(DthSAD,  150)
DthSADC= default(DthSADC, 150)
BthSAD = default(BthSAD,   70)
BthSADC= default(BthSADC,  70)
TR1 = default(TR1, 6)
TR2 = default(TR2, 2)
BLKSize = default(BLKSize, 32)
Overlap = default(Overlap, 16)
Rb = default(Rb, 8)
Pel = default(Pel, 1)
Chroma = default(Chroma, true)
Tm = default(Tm, false)
Falloff = default(Falloff, 0.9)
VDth = default(VDth, 1.5)
lo = default(lo,     60)
mid = default(mid, 0.57)
hi = default(hi,    127)
mix = default(mix,  230)
UV = default(UV, 3)
Fast = default(Fast, false)
Bt= BitLShift(1,input.BitsPerComponent - 8)

pre = defined(preclip)
inputP = pre ? preclip : input

sup = defined(superclip)
inputS = sup ? superclip : input

drk = defined(darkclip)
inputD = drk ? darkclip : input

brt = defined(brightclip)
inputB = brt ? brightclip : input

super = MSuper(inputS, pel=pel, hpad = 0, vpad = 0, chroma=chroma, mt=false, levels=1, sharp=1)
superB = MSuper(inputS.merge(input), pel=pel, hpad = 0, vpad = 0, chroma=chroma, mt=false, levels=1, sharp=1)
superfilt = MSuper(inputP, pel=pel, hpad = 0, vpad = 0, mt=false,sharp=1)
Multi_Vector = Superfilt.MAnalyse(Multi=True, Delta=max(tr1, tr2), BLKSize=BLKSize, Overlap=Overlap, Chroma=Chroma, truemotion=tm ,global=true)
vmulti2 = Mrecalculate(superfilt,multi_vector,thsad=Dthsad,truemotion=false,tr=max(tr1, tr2),blksize=rb,overlap=rb/2,mt=false,chroma=true)

dark=darkclip.MDegrainN(Super, vmulti2, TR1, thSAD=DthSAD, thSAD2=Int(DthSAD*Falloff), thSADC=DthSADC, thSADC2=Int(DthSADC*Falloff)).neo_vd(VDth,1,6,90)
bright = Fast ? dark.merge(input, 0.7) : brightclip.MDegrainN(SuperB, vmulti2, TR1, thSAD=BthSAD, thSAD2=Int(BthSAD*Falloff), thSADC=BthSADC, thSADC2=Int(BthSADC*Falloff))

mask=dark.extractY().levels(lo*bt, mid, hi*bt, 0, mix*bt)
mt_merge(dark, bright, mask, luma=true, u=uv, v=uv)

return last
}
Not correct?
anton_foy is offline   Reply With Quote
Old 20th June 2023, 12:22   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Nope, drk and inputD are defined [EDIT: assigned to] there, darkclip is unchanged, ie potentially Undefined.

Quote:
Suggest maybe try see if all works OK with ALL defaulted optional args.
Give it a try. [I expect Error Abort]

EDIT: Like (untested)
Code:
Colorbars(Pixel_type="YV12").KillAudio
clay() # expect "BANG !!!"
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 20th June 2023 at 12:28.
StainlessS is offline   Reply With Quote
Old 20th June 2023, 12:28   #11  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by StainlessS View Post
Nope, drk and inputD are defined [EDIT: assigned to] there, darkclip is unchanged, ie potentially Undefined.


Give it a try. [I expect Error Abort]

EDIT: Like (untested)
Code:
Colorbars(Pixel_type="YV12").KillAudio
clay()
Oh I see but read my usage example in the first post.
Quote:
Usage (my own settings):
Code:
convertbits(16)
converttoYUV444()

cd=convertbits(8,dither=-1).convertToYv12()
pre=cd.CCD(13).ex_median("IQMV",Y=3,UV=3).ex_sbr(2)

sup=ex_unsharp(1.77,th=1.1,fc=width(),safe=true,UV=1)

drk=deblock(planes="yuv",quant=50)

Clay(tr1=7,tr2=2,dthsad=160,dthsadc=160,bthsad=70,preclip=pre,superclip=sup,darkclip=drk,brightclip=last,chroma=true)

deblock(planes="UV")
neo_F3KDB(grainY=0,grainC=0,mt=false,output_depth=16,range=30).mergechroma(last)
Convertbits(10,dither=1)
prefetch(4)
anton_foy is offline   Reply With Quote
Old 20th June 2023, 12:33   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Your usage examples are a bit irrelevant, you should never, ever, ever, have function with optional args which do not default to something, when not supplied. [ie, are NOT actually optional at all]

EDIT: The error is HERE (darkclip may still be undefined, you try call MDegrainN() on undefined clip arg. [there will be tears before bedtime]
Code:
dark=darkclip.MDegrainN(Super, vmulti2, tr, thSAD=DthSAD, thSAD2=Int(DthSAD*Falloff), thSADC=DthSADC, thSADC2=Int(DthSADC*Falloff)).neo_vd(VDth,1,6,90)
EDIT: Try the ALL optionals defaulted test, and keep fixing the function until it does not produce error abort. [I dont know if there are problems additional to the darkclip one]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 20th June 2023 at 12:44.
StainlessS is offline   Reply With Quote
Old 20th June 2023, 12:42   #13  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
You should be using inputD instead of darkclip in the latter part of the script.
The same goes for inputB instead of brightclip.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 20th June 2023, 12:50   #14  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanx Gavin, looks like that was the intention, but I did not want to make any assumptions. [All defaulted optionals test still a good idea, perhaps Gavin already tried that].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 20th June 2023, 13:00   #15  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Gavino View Post
You should be using inputD instead of darkclip in the latter part of the script.
The same goes for inputB instead of brightclip.
Yes of course sorry both of you I was confused and interrupted. Just cannot figure out how my script is working since I copied it straight from my avsi-file into here. Will look and fix. Thanks!

Quote:
you should never, ever, ever, have function with optional args which do not default to something, when not supplied. [ie, are NOT actually optional at all]
Sure, my intention was to use inputD if defined otherwise Input. Just copied the same lines I always use for prefilter in my other scripts.

Last edited by anton_foy; 20th June 2023 at 13:16.
anton_foy is offline   Reply With Quote
Old 20th June 2023, 13:05   #16  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by StainlessS View Post
[All defaulted optionals test still a good idea, perhaps Gavin already tried that].
Your advice is 100% sound, but I hadn't tried the script myself.
It simply seemed the obvious intention, as otherwise inputD and inputB were not used for anything.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 20th June 2023, 13:55   #17  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,058
"mv_bw1=Multi_Vector.SelectEvery(tr*2, 1)"

Yes - in the first example I forgot to set initial MAnalyse mv_multi clip as source for SelectEvery().

This is working example (and I still not sure about numbering from 0 or 1 for SelectEvery)
Code:
tr = 6 # Temporal radius
super = MSuper ()
multi_vec = MAnalyse (super, multi=true, delta=tr)
big_tr=MDegrainN(super, multi_vec, tr, thSAD=400, thSAD2=350)

mv_bw1=SelectEvery(multi_vec, tr*2, 0)
mv_fw1=SelectEvery(multi_vec, tr*2, 1)
mv_bw2=SelectEvery(multi_vec, tr*2, 2)
mv_fw2=SelectEvery(multi_vec, tr*2, 3)
mv_bw3=SelectEvery(multi_vec, tr*2, 4)
mv_fw3=SelectEvery(multi_vec, tr*2, 5)

MDegrain3(super, mv_bw1, mv_fw1, mv_bw2, mv_fw2, mv_bw3, mv_fw3, thSAD=300)
Also it looks MDegrain3 not accept mvclips as named arguments.

Last edited by DTL; 20th June 2023 at 14:22.
DTL is offline   Reply With Quote
Old 20th June 2023, 16:41   #18  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
https://imgsli.com/MTg3MjMz/0/1

Code:
Spline64ResizeMT(1920, 1080)
EZdenoise(Chroma=true, out16=true).ConvertBits(10, dither=1)
Downscaled, because 4k with such low quality is extremely pointless.
And personally, I wouldn't denoise the castle clip at all (very little noise).

On the moving water near the castle you can see EZdenoise preserves slightly more detail then Clay.
I used frame 20 for all 3 clips.
takla is offline   Reply With Quote
Old 20th June 2023, 17:17   #19  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by takla View Post
https://imgsli.com/MTg3MjMz/0/1

Code:
Spline64ResizeMT(1920, 1080)
EZdenoise(Chroma=true, out16=true).ConvertBits(10, dither=1)
Downscaled, because 4k with such low quality is extremely pointless.
And personally, I wouldn't denoise the castle clip at all (very little noise).

On the moving water near the castle you can see EZdenoise preserves slightly more detail then Clay.
I used frame 20 for all 3 clips.
Sorry but how can you compare this downscaled (please compare in full screen, before/after and with your downscaled images) it is extremely low in detail and the denoising on your part is showing alot of noise even still. How can you not see this? Yes the castle clip was denoised a tad too hard just to make the point that with the same settings for all the clips it still works pretty well.

Comparison
anton_foy is offline   Reply With Quote
Old 20th June 2023, 19:52   #20  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by anton_foy View Post
Sorry but how can you compare this downscaled (please compare in full screen, before/after and with your downscaled images) it is extremely low in detail and the denoising on your part is showing alot of noise even still. How can you not see this? Yes the castle clip was denoised a tad too hard just to make the point that with the same settings for all the clips it still works pretty well.

Comparison
I'm using a 55" native 4k display, calibrated to 203nits, 100% srgb (with an average deviation of 0.8 on 50 color test patterns) with 2.2 gamma.

I really don't want to know what kind of miscalibrated garbage display you use that overexposes everything.

How can you not see that your footage is bottom of the barrel, bitrate starved garbage? The chromatic aberration on that cameras footage is so bad, I'd straight up throw it into the trash.

Also, if the denoiser is set too high you'll lose too much detail in lossy encodes.

Last edited by takla; 20th June 2023 at 19:55.
takla is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 23:25.


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