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 16th June 2022, 17:39   #261  |  Link
PatchWorKs
Registered User
 
PatchWorKs's Avatar
 
Join Date: Aug 2002
Location: Italy
Posts: 303
@ErazorTT Out of curiosity: do you think is possible to speedup your great software by using QuickSync instructions ?
__________________
HYbrid Multimedia Production Suite project @ GitHub
PatchWorKs is offline   Reply With Quote
Old 17th June 2022, 13:33   #262  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
in Temporal Degrain v2.6.3 line 202:
Code:
outputStage= default( outputStage, 2 )    # [0, 2]    you can decide to skip the processing of later stages and directly output the clip as process of the stage given: 0= output after first degraining, 1= output after second degraining, 2= output after FFT post processing, 3= output after contra sharpening (that's the last stage and the default)
-> text says 3 is default, but code says range is 0-2 and default is 2.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 24th June 2022, 21:46   #263  |  Link
cork_OS
Registered User
 
cork_OS's Avatar
 
Join Date: Mar 2016
Posts: 160
UPD: wrong info
__________________
I'm infected with poor sources.

Last edited by cork_OS; 25th June 2022 at 06:35. Reason: wrong information
cork_OS is offline   Reply With Quote
Old 24th June 2022, 22:20   #264  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
works fine here with google drive,.. (might be blocked due to you location)
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 26th June 2022, 11:25   #265  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I quite often have small probs downloading from Google Drive, but usually starts eventually if you give it a minute or so,
works better if you're signed in to your Google account. (I usually stay signed out unless required)

Maybe some kind of punishment for not being signed in,
Hotmail, on signing in using non MS Edge browser, just hangs for about 30 seconds (or is it 60), punishment for not using Edge [EDIT: Zero network activity until punishment ends].
(I usually start it up before I want to use it, and switch back to what I was doing for a couple of minutes so that it will have dished out sufficient punishment.)

EDIT: Above Hotmail Edge punishement thing, is where (my) MS telemetry is disabled/crippled, perhaps Edge also passes telemetry and where not using edge, then
attempts standard MS telemetry spyware stuff until it figures out that it is also blocked.
__________________
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; 26th June 2022 at 11:43.
StainlessS is offline   Reply With Quote
Old 17th July 2022, 12:07   #266  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Trying to understand the TemporalDegrain2-script as it works really well with my footage but I would like to add an option to dynamically adjust postSigma with my noise detection and ScriptClip. Is it possible to mod it using ScriptClip only for postFFT? Have tried a while to get it to work but it seems to ignore the FFT3dFilter I use for ScriptClip. Putting the whole TemporalDegrain2 inside of ScriptClip is impossibly slow.

Code:
function FD(clip c)
{
# Noise extraction - normalizing the image to even out motion leaving "only" moving noise.

in = c.levels(6*256,1,122*256,0,255*256).tdif.ApplyGradationCurves(lumaPoints="0,128, 40,0, 128,255, 213,0, 255,128")
    nc = SI_physicalcores()
    ScriptClip(function[in,nc] () {

        # Noise detection
        nTH  = in.YDifferenceToNext()
        s = nmod(nTH*0.00009, dec=1)
fft3dfilter(sigma=s, bt=3, ncpu=nc, plane=4)
    } )
}
# TemporalDifference - noise enhancing
function tdif(clip C)
{
    mt_lutxy(C, C.Trim(1, 0), mt_polish("16*abs(x-y)"), U=-128, V=-128)
    return Last
}

function DT_postFFT(clip in, int postFFT, int postPlane, float postSigma, int postDither, int postTR, int postTD, int fftThreads, int postBlkSz, int devId, bool cuda, string dftsfile)
{
    LumaNoiseP = (postPlane == 0) || (postPlane == 4)
    ChromaNoiseP = (postPlane > 0) ? true : false
    dftDither = (postDither < 0) ? postDither*(-1) : 0
    
    out    = (postFFT == 0) ? FD( postDither > 0 ? in.ConvertBits(16) : in) : \
             (postFFT == 1) ? neo_fft3d ( postDither > 0 ? in.ConvertBits(16) : in, y=LumaNoiseP?3:2, u=ChromaNoiseP?3:2, v=ChromaNoiseP?3:2, sigma=postSigma, bt=postTD, ncpu=fftThreads, bw=postBlkSz, bh=postBlkSz ) : \
             (postFFT == 11)? FFT3DFilter( postDither > 0 ? in.ConvertBits(16) : in, plane=postPlane, sigma=postSigma, bt=postTD, ncpu=fftThreads, bw=postBlkSz, bh=postBlkSz ) : \
             (postFFT == 2) ? FFT3DGPU( postDither > 0 ? in.ConvertBits(16) : in, plane=postPlane, sigma=postSigma*2/3, bt=postTD, precision=2, mode=1, bw=postBlkSz, bh=postBlkSz ) : \
             (postFFT == 3) ? neo_dfttest( postDither > 0 ? in.ConvertBits(16) : in, y=LumaNoiseP?3:2, u=ChromaNoiseP?3:2, v=ChromaNoiseP?3:2, sigma=postSigma*4, tbsize=postTD, dither=dftDither, threads=fftThreads, sbsize=postBlkSz, sosize=postBlkSz*9/12, slocation=dftsfile) : \
             (postFFT == 13)? dfttest( postDither > 0 ? in.ConvertBits(16) : in, Y=LumaNoiseP, U=ChromaNoiseP, V=ChromaNoiseP, sigma=postSigma*4, tbsize=postTD, threads=fftThreads, dither=dftDither, sbsize=postBlkSz, sosize=postBlkSz*9/12, sfile=dftsfile ) : \
             (postFFT == 4) ? DT_KNLMeansCL( postDither > 0 ? in.ConvertBits(16) : in, a=2, d=postTR, h=postSigma, Luma = LumaNoiseP, Chroma = ChromaNoiseP, device_type="GPU", device_id=devId) : \
             (postFFT == 5) ? DT_BM3D( postDither > 0 ? in.ConvertBits(16) : in, radius=postTR, sigma=postSigma, chroma=ChromaNoiseP, CUDA=cuda, device_id=devId ) : \
             (postFFT == -1)? HQDn3D( postDither > 0 ? in.ConvertBits(16) : in, 0,0,4,1, u=ChromaNoiseP?3:2, v=ChromaNoiseP?3:2) : NOP()
    
    return out
}
Replaced postFFT=0 just to test. I guess FFT3DFilter needs to work together with the degraining bit for it to work as intended?

EDIT: the above is just the code-snippet of the parts I changed in TemporalDegrain-v2.6.3.avsi

Last edited by anton_foy; 17th July 2022 at 13:17.
anton_foy is offline   Reply With Quote
Old 17th July 2022, 12:24   #267  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by anton_foy View Post
Trying to understand the TemporalDegrain2-script as it works really well with my footage but I would like to add an option to dynamically adjust postSigma with my noise detection and ScriptClip. Is it possible to mod it using ScriptClip only for postFFT? Have tried a while to get it to work but it seems to ignore the FFT3dFilter I use for ScriptClip. Putting the whole TemporalDegrain2 inside of ScriptClip is impossibly slow.

Code:
function FD(clip c)
{
# Noise extraction - normalizing the image to even out motion leaving "only" moving noise.

in = c.levels(6*256,1,122*256,0,255*256).tdif.ApplyGradationCurves(lumaPoints="0,128, 40,0, 128,255, 213,0, 255,128")
    nc = SI_physicalcores()
    ScriptClip(function[in,nc] () {

        # Noise detection
        nTH  = in.YDifferenceToNext()
        s = nmod(nTH*0.00009, dec=1)
fft3dfilter(sigma=s, bt=3, ncpu=nc, plane=4)
    } )
}
# TemporalDifference - noise enhancing
function tdif(clip C)
{
    mt_lutxy(C, C.Trim(1, 0), mt_polish("16*abs(x-y)"), U=-128, V=-128)
    return Last
}

function DT_postFFT(clip in, int postFFT, int postPlane, float postSigma, int postDither, int postTR, int postTD, int fftThreads, int postBlkSz, int devId, bool cuda, string dftsfile)
{
    LumaNoiseP = (postPlane == 0) || (postPlane == 4)
    ChromaNoiseP = (postPlane > 0) ? true : false
    dftDither = (postDither < 0) ? postDither*(-1) : 0
    
    out    = (postFFT == 0) ? FD( postDither > 0 ? in.ConvertBits(16) : in) : \
             (postFFT == 1) ? neo_fft3d ( postDither > 0 ? in.ConvertBits(16) : in, y=LumaNoiseP?3:2, u=ChromaNoiseP?3:2, v=ChromaNoiseP?3:2, sigma=postSigma, bt=postTD, ncpu=fftThreads, bw=postBlkSz, bh=postBlkSz ) : \
             (postFFT == 11)? FFT3DFilter( postDither > 0 ? in.ConvertBits(16) : in, plane=postPlane, sigma=postSigma, bt=postTD, ncpu=fftThreads, bw=postBlkSz, bh=postBlkSz ) : \
             (postFFT == 2) ? FFT3DGPU( postDither > 0 ? in.ConvertBits(16) : in, plane=postPlane, sigma=postSigma*2/3, bt=postTD, precision=2, mode=1, bw=postBlkSz, bh=postBlkSz ) : \
             (postFFT == 3) ? neo_dfttest( postDither > 0 ? in.ConvertBits(16) : in, y=LumaNoiseP?3:2, u=ChromaNoiseP?3:2, v=ChromaNoiseP?3:2, sigma=postSigma*4, tbsize=postTD, dither=dftDither, threads=fftThreads, sbsize=postBlkSz, sosize=postBlkSz*9/12, slocation=dftsfile) : \
             (postFFT == 13)? dfttest( postDither > 0 ? in.ConvertBits(16) : in, Y=LumaNoiseP, U=ChromaNoiseP, V=ChromaNoiseP, sigma=postSigma*4, tbsize=postTD, threads=fftThreads, dither=dftDither, sbsize=postBlkSz, sosize=postBlkSz*9/12, sfile=dftsfile ) : \
             (postFFT == 4) ? DT_KNLMeansCL( postDither > 0 ? in.ConvertBits(16) : in, a=2, d=postTR, h=postSigma, Luma = LumaNoiseP, Chroma = ChromaNoiseP, device_type="GPU", device_id=devId) : \
             (postFFT == 5) ? DT_BM3D( postDither > 0 ? in.ConvertBits(16) : in, radius=postTR, sigma=postSigma, chroma=ChromaNoiseP, CUDA=cuda, device_id=devId ) : \
             (postFFT == -1)? HQDn3D( postDither > 0 ? in.ConvertBits(16) : in, 0,0,4,1, u=ChromaNoiseP?3:2, v=ChromaNoiseP?3:2) : NOP()
    
    return out
}
Replaced postFFT=0 just to test. I guess FFT3DFilter needs to work together with the degraining bit for it to work as intended?
I remember you run very slow with neo-fft3t. Try limitFFT=11, TemporalDegrain2 will use fft3d filter
kedautinh12 is online now   Reply With Quote
Old 17th July 2022, 13:14   #268  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Quote:
I remember you run very slow with neo-fft3t. Try limitFFT=11, TemporalDegrain2 will use fft3d filter
Thanks, now I have upgraded my computer a bit and neo-fft works fine.
Although I talking about modding the TemporalDegrain-script to make neo/fft3dfilter work in scriptclip in the way I suggested above.

EDIT: Now I think I found out a bit more about what is doing what. As I understand it there are two instances where FFT3D is used.
First as a kind of prefilter(?) in DGlimit and second instance as postFFT. Will try to experiment with DGlimit-FFT3D + ScriptClip.

Last edited by anton_foy; 17th July 2022 at 17:26.
anton_foy is offline   Reply With Quote
Old 22nd September 2022, 16:34   #269  |  Link
simple_simon
Registered User
 
Join Date: Feb 2003
Posts: 99
What would be the best settings in TemporalDegrainV2 to best replicate the FastDegrain.avsi from the original TemporalDegrain package but utilizing the added QTGMC analysis benefits?
simple_simon is offline   Reply With Quote
Old 30th September 2022, 21:36   #270  |  Link
ErazorTT
Registered User
 
Join Date: Mar 2003
Location: Germany
Posts: 215
I at least have no idea. I never tried to replicate any other plugin. Just read the step-by-step readme at the top of the TD2.avsi script and it will guide you through the setup of TD2 for the clip at hand.
ErazorTT is offline   Reply With Quote
Old 21st October 2022, 14:42   #271  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 35
I'm running into a weird issue, I don't think I'm missing any of the dependent plugins.

Code:
Avisynth open failure: 
unexpected character "[" 
(TemporalDegrain-v2.6.2.avsi, line 478, column 41)
The line it appears to be referring to is

Code:
output = cd ? output.BM3D_CUDA(sigma=[s,cs,cs], radius=r, chroma=chr, fast=true, extractor_exp=6, device_id=devId)
I'm not sure why it can't read the "[" character.
some dude is offline   Reply With Quote
Old 21st October 2022, 14:56   #272  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
I'm not sure why it can't read the "[" character.
You running latest avs+ ?

(Looks like some kind of Array stuff)

EDIT:
Quote:
output = cd ? output.BM3D_CUDA(sigma=[s,cs,cs], radius=r, chroma=chr, fast=true, extractor_exp=6, device_id=devId)
Does that require the Cuda version AVS+ ???
__________________
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; 21st October 2022 at 14:59.
StainlessS is offline   Reply With Quote
Old 21st October 2022, 16:18   #273  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by StainlessS View Post
Does that require the Cuda version AVS+ ???
No it does not require the CUDA version. The only filters known that require AviSynth+ built with the CUDA option are Nekopanda's CUDA filters. But there is no current compile of those filters that work with the latest AVS+: https://github.com/AviSynth/AviSynthPlus/issues/296
Reel.Deel is offline   Reply With Quote
Old 3rd December 2022, 02:34   #274  |  Link
subterrestrial
Registered User
 
Join Date: Sep 2018
Posts: 8
I came across this topic when I was searching for reference to help me mod a denoising script using Nekopanda's CUDA functions as I really like the efficiency of these cuda filters. TemporalDegrain2 seems to be a nice start point since it is partly based on QTGMC degrain algorithm of which the cuda version realization already exists.

It might be off this topic but I want to share some information about compiling the printerf version AviSynthCUDAFilters because I read the reply referred that there was problems in compling these filters with AVS+3.7.2.
When I compiled printerf's AviSynthCUDAFilters with AVS+3.7.0 by CUDA11 compiler and run the program using a pascal architecture card(GTX10xx series, just like the one which printerf got when he moded the soure file), it worked very well. But when I changed the card to a turing architecture card(GTX16xx and RTX20xx) and comiled the file again with AVS+3.7.2, the filter failed to work. It seemed the graphic gard memory and cpu memory failed to synchronise. The same problem was also reported in a Japanese forum where there is special column discussing Avisynth topics(https://toro.2ch.sc/test/read.cgi/avi/1653113801/l50).

Anyway, I finally figured out a way to make it work: using CUDA 8 compiler to compile printerf's AviSynthCUDAFilters, in this way I could make the program run on a turing architecture card but I can't guarantee it can run ampere architecture card(RTX30xx) because I don't have a card for testing. However, it seems that the program may run on ampere architecture cards sinse Nekopanda's programs was compiled by CUDA8 compiler and the programs were reported to work on those cards(https://mevius.5ch.net/test/read.cgi/avi/1666875696/).

Sorry but there are more off topic things I want to add. Actually the source code that Nekopanda compiled his last version cuda filters which is in his repository of Amtsukaze project was not updated to his repository of AviSynthCUDAFilters project. The date in which the program file was comiled was about half year later than the date of the final change in his AviSynthCUDAFilters project. Another decisive evidence is that a funtion in printerf's AviSynthCUDAFilters is lacking a parameter which resulted in KFMDeint.avsi in Amtsukaze failing directly applied in(bool "is120" in function KFMDeint). Additionally, although I know it's not a sufficient evidence, I compiled Nekopanda version using the not updated code by CUDA 8 compiler and compare the efficiency with Nekopanda's compiled files running same program but just replacing the dll file in the Amtsukaze folder, then I founed mine was not efficient as Nekopanda's . Since Nekopanda's AvsCUDA.dll and KFM.dll was both comiled half year later than the last updated code, I'm pretty sure there are code changes in the soure file. After all, in my guess Nekopanda's main and final purpose was not to create these filters, which were just tools he created to build his final program Amtsukaze of which I just find out the maintainance has been taken over by rigaya(https://github.com/rigaya/Amatsukaze) though he/she didn't touch the AviSynthCUDAFilters codes.

Last edited by subterrestrial; 3rd December 2022 at 03:37. Reason: spelling correction
subterrestrial is offline   Reply With Quote
Old 3rd December 2022, 02:50   #275  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by some dude View Post
I'm running into a weird issue, I don't think I'm missing any of the dependent plugins.

Code:
Avisynth open failure: 
unexpected character "[" 
(TemporalDegrain-v2.6.2.avsi, line 478, column 41)
The line it appears to be referring to is

Code:
output = cd ? output.BM3D_CUDA(sigma=[s,cs,cs], radius=r, chroma=chr, fast=true, extractor_exp=6, device_id=devId)
I'm not sure why it can't read the "[" character.
You need use latest avs+ ver
https://gitlab.com/uvz/AviSynthPlus-Builds

You need use update TemporalDegrain2 to latest ver (check first post)

You don't need Cuda if you use this script:
TemporalDegrain2 (postFFT=5, cuda=false)
kedautinh12 is online now   Reply With Quote
Old 8th February 2023, 12:53   #276  |  Link
Arx1meD
Registered User
 
Arx1meD's Avatar
 
Join Date: Feb 2021
Posts: 121
I like everything in Temporaldegrainv2 and the quality of the cleaning of the noise is brilliant! But the speed of work is slow, and on my old computer it works very slowly. I decided to change the script so that it works faster and cleaned well from noise.
This is my lightweight version - Temporaldegrain2_fast.
Code:
#                    Temporal Degrain 2 fast
# 
# Based on TemporalDegrainV2
# https://forum.doom9.org/showthread.php?t=175798
# 
# Needed plugins:
#   neo_FFT3D        https://github.com/HomeOfAviSynthPlusEvolution/neo_FFT3D
#   MaskTools2       https://github.com/pinterf/masktools
#   MVTools2         https://github.com/pinterf/mvtools or https://github.com/DTL2020/mvtools
#   RgTools          https://github.com/pinterf/RgTools
#   vsDeGrainMedian  https://github.com/Asd-g/AviSynth-vsDeGrainMedian
# 
# Usage Default:
#   TemporalDegrain2_fast(Strength=3, Y=3, U=3, V=3, RadT=1, BlkSz=16, Sharp=0.4, PostDeHalo=false, PostMix=0)
#
# Post in Doom9's forum: https://forum.doom9.org/showthread.php?p=1982594#post1982594


function TemporalDegrain2_fast (clip input, int "Strength", int "Y", int "U", int "V", int "RadT", int "BlkSz", int "Olap", \
                                float "Sharp", bool "PostDeHalo", float "PostMix")
{
Str     = Default(Strength, 3)        # Noise/grain suppression strength.
                                      # Strength for depth noise (< 2), low (3 ... 5), medium (6 ... 9), high (10 ... 14), veryhigh (> 15)
Y       = Default(Y, 3)               # Luma plane to process. Value: 2 - copy from input, 3 - process
U       = Default(U, Y)               # Chroma plane to process. Value: 2 - copy from input, 3 - process
V       = Default(V, U)               # Chroma plane to process. Value: 2 - copy from input, 3 - process
RadT    = Default(RadT, 1)            # Temporal Radius of frame analysis. Value 1 or 2
BlkSz   = Default(BlkSz, 16)          # Block size for motion analysis. Bigger BlkSz quicker. Recommended values: 8, 16, 32
OLap    = Default(OLap, BlkSz/2)      # The value of overlapping blocks on each other
Sharp   = Default(Sharp, 0.4)         # Sharpening strength. Range: 0 ... 1
DeHalo  = Default(PostDeHalo, false)  # Remove halo after sharpening. Value: true or false
PostMix = Default(PostMix, 0)         # How much noise/grain will be returned. Range: 0 ... 1

func_name = "TemporalDegrain2_fast: "
Assert(Y == 2 || Y == 3, func_name+"Luma Y plane must be 2 or 3")
Assert(U == 2 || U == 3, func_name+"Chroma U plane must be 2 or 3")
Assert(V == 2 || V == 3, func_name+"Chroma V plane must be 2 or 3")
Assert(Y == 3 || U == 3 || V == 3, func_name+"One of the planes Y, U, V must be 3")
Assert(RadT == 1 || RadT == 2, func_name+"Temporal Radius of frame analysis must be 1 or 2")
Assert(Sharp >= 0 && Sharp <= 1, func_name+"Sharpening strength must be between 0 and 1.0")
Assert(PostMix >= 0 && PostMix <= 1, func_name+"The noise return value must be between 0 and 1.0")

dPlane = Y==3 && (U==3 || V==3) ? 4
     \ : Y==3 && U==2 && V==2   ? 0
     \ : Y==2 && U==3 && V==2   ? 1
     \ : Y==2 && U==2 && V==3   ? 2
     \ : Y==2 && U==3 && V==3   ? 3 : 4
pad = Max(Blksz, 8)
pel = 1
chr = U==3 || V==3 ? true : false

# denoising 1st way
dgLimit = input.neo_fft3d(sigma=Str, sigma2=Floor(Str*0.625), sigma3=Floor(Str*0.375), sigma4=Floor(Str*0.250), \
                          bt=RadT==1?3:5, Y=Y, U=U, V=V, bw=BlkSz*2, bh=BlkSz*2, ow=OLap, oh=OLap) #, ncpu=4, mt=true)
dgSpatD = mt_makediff(input, dgLimit, Y=Y, U=U, V=V)

# denoising 2nd way
dgNR1  = dgLimit.vsDeGrainMedian(modeY=0, limitY=Str, limitU=U==3?Str+2:0, limitV=V==3?Str+2:0)
dgNR1D = mt_makediff(input, dgNR1, Y=Y, U=U, V=V)

# combine 1st and 2nd ways
dgDD   = mt_lutxy(dgSpatD, dgNR1D, "x range_half - abs y range_half - abs < x y ?", Y=Y, U=U, V=V, use_expr=2)
dgNR1x = mt_makediff(input, dgDD, Y=Y, U=U, V=V)

# sharpen the edges only
dgNR1x = Sharp > 0 ? mt_merge(dgNR1x, \
                              dgNR1x.RemoveGrain(17).Sharpen(Sharp), \
                              dgNR1x.RemoveGrain(12).mt_edge("prewitt", Y=3, U=2, V=2).mt_inpand(chroma="-128").Blur(1.58), \
                              Y=3, U=2, V=2)
                 \ : dgNR1x

# denoising 3rd way
sup      = dgNR1x.Blur(1.58).Blur(1.58).MSuper(hpad=pad, vpad=pad, pel=pel, chroma=chr)
MultiVec = MAnalyse(sup, multi=true, delta=RadT, blksize=BlkSz, overlap=OLap, search=5, dct=7, chroma=chr, truemotion=false, global=true)
dgNR1xS  = MSuper(dgNR1x, hpad=pad, vpad=pad, pel=pel, levels=1, chroma=chr)
dgNR2    = MDegrainN(dgNR1x, dgNR1xS, MultiVec, RadT, plane=dPlane)

# combine 1st, 2nd and 3rd ways
dgDD2 = mt_lutxy(dgNR1x, dgNR2, "x range_half - abs y range_half - abs < x y ?", Y=Y, U=U, V=V, use_expr=2)

# post denoising
# dgNR3 = dgDD2.RemoveGrain(17)
# dgDD2 = mt_lutxy(dgNR3, dgDD2, "x range_half - abs y range_half - abs < x y ?", Y=Y, U=U, V=V, use_expr=2)

# sharpening
allD = Sharp > 0 ? mt_makediff(input.Sharpen(1), dgDD2.Blur(1.58).Blur(1.58)) : NOP()
ssD  = Sharp > 0 ? mt_makediff(dgDD2, dgDD2.RemoveGrain(20)) : NOP()
ssDD = Sharp > 0 ? mt_lutxy(ssD.Repair(allD, 12), ssD, "x range_half - abs y range_half - abs < x y ?", Y=Y, U=U, V=V, use_expr=2) : NOP()
out  = Sharp > 0 ? mt_lutxy(dgDD2, ssDD, "x range_half y - "+String(Sharp)+" * -", Y=3, U=2, V=2, use_expr=2) : dgDD2

# dehaloing
m0  = Sharp > 0 && DeHalo ? dgNR1x.mt_edge("prewitt", Y=3, U=2, V=2).mt_inpand(chroma="-128") : NOP()
m1  = Sharp > 0 && DeHalo ? mt_lutxy(out, m0, "y range_half > x y ?", Y=3, chroma="-128", use_expr=2).mt_binarize(threshold=128).Blur(0.5) : NOP()
out = Sharp > 0 && DeHalo ? mt_merge(out, dgNR1x.Blur(0.1), m1, Y=3, U=2, V=2) : out

PostMix > 0 ? mt_lutxy(out, input, "x x y - "+String(PostMix)+" * -", Y=Y, U=U, V=V, use_expr=2) : out
}

Last edited by Arx1meD; 4th February 2024 at 19:48. Reason: Changed neo_fft3d and MAnalyse. Added BlkSz, OLap, PostDeHalo options
Arx1meD is offline   Reply With Quote
Old 8th February 2023, 14:42   #277  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Can you share your slow ver??
kedautinh12 is online now   Reply With Quote
Old 8th February 2023, 16:28   #278  |  Link
Arx1meD
Registered User
 
Arx1meD's Avatar
 
Join Date: Feb 2021
Posts: 121
Quote:
Originally Posted by kedautinh12 View Post
Can you share your slow ver??
This is the script from the first post of this thread.
Arx1meD is offline   Reply With Quote
Old 9th February 2023, 07:42   #279  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Quote:
Originally Posted by Arx1meD View Post
I like everything in Temporaldegrainv2 and the quality of the cleaning of the noise is brilliant! But the speed of work is slow, and on my old computer it works very slowly. I decided to change the script so that it works faster and cleaned well from noise.
This is my lightweight version - Temporaldegrain2_fast.
@Arx1meD Actually it looks great! Faster and degrains smoothly while keeping a good amount of detail.

I will try to add mocomped temporalsoften instead of mdegrain just to see if it eats a bit more noise.
anton_foy is offline   Reply With Quote
Old 12th February 2023, 22:25   #280  |  Link
avinewbie
Registered User
 
Join Date: Dec 2010
Posts: 28
TDG2 Light

@Arx1meD
Thank you.I tried it and its amazingly fast and easy to tune even on my old PC.
avinewbie 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 10:40.


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