Log in

View Full Version : TemporalDegrainV2


Pages : 1 2 3 4 5 6 [7]

rgr
1st March 2024, 14:47
InputType=x expects progressive input, it is not for deinterlacing.

Sorry, progressive input -- my mistake. Corrected.

Kurosu
22nd September 2024, 08:32
There are cases where I cascaded this filter, or use 10 bits to reduce a palettization-like effect in bright/dark parts.
I'm wondering if it would be possible to
1) Obtain (MSuper/MAnalyse?) the motion field on the 8bits sequence, but only apply the 10bits just before the temporally-compensated denoising itself (MDegrainN?)
2) Reuse any info (vmulti?) when cascading in some scenarios

DTL
22nd September 2024, 20:23
1. Yes
2. Yes. But when processing denoised data with MAnalyse you will got somehow different MVs. So reused MVs from first MAnalyse may or may not be better (even in different areas of frame).

Kurosu
2nd October 2024, 07:50
For 1., I tend to use "barebone" (just changing grainlevel<=2, degrainTR<=2, meSubpel) settings without too much pre or postprocessing. I imagine a global solution would be cumbersome. But for my limited use case, do you think changing bitdepth just before MSuper and/or MDegrainN would be useful.

For 2., yes, I can imagine ME on a denoised clip will not yield the same result. It would make only somewhat more sense if there were more than 2 temporaldegrain2 chained, so a very very limited use case.

tormento
29th October 2024, 20:39
I really can't sort out how to use grainLevelSetup.

Tried to search in AVSI and here but no useful informations found.

Any help is welcome.

tormento
29th October 2024, 22:46
TemporalDegrain2(degrainTR=1,grainLevel=1,degrainChromaTwoStep=false,meAlg=5,limitFFT=2,postFFT=4,postSigma=1.0)

works ok but

TemporalDegrain2(degrainTR=1,grainLevel=1,degrainChromaTwoStep=false,meAlg=5,limitFFT=2,postFFT=4,postSigma=0)

gives me error

KNLMeansCL: 'h' must be greater than 0!
(D:/Programmi/Media/AviSynth+/plugins64/TemporalDegrain-2.6.7~ErazorTT.avsi, line 519)
(D:/Programmi/Media/AviSynth+/plugins64/TemporalDegrain-2.6.7~ErazorTT.avsi, line 456)
(D:/Programmi/Media/AviSynth+/plugins64/TemporalDegrain-2.6.7~ErazorTT.avsi, line 424)

Why?

kedautinh12
30th October 2024, 13:12
TemporalDegrain2(degrainTR=1,grainLevel=1,degrainChromaTwoStep=false,meAlg=5,limitFFT=2,postFFT=4,postSigma=1.0)

works ok but

TemporalDegrain2(degrainTR=1,grainLevel=1,degrainChromaTwoStep=false,meAlg=5,limitFFT=2,postFFT=4,postSigma=0)

gives me error

KNLMeansCL: 'h' must be greater than 0!
(D:/Programmi/Media/AviSynth+/plugins64/TemporalDegrain-2.6.7~ErazorTT.avsi, line 519)
(D:/Programmi/Media/AviSynth+/plugins64/TemporalDegrain-2.6.7~ErazorTT.avsi, line 456)
(D:/Programmi/Media/AviSynth+/plugins64/TemporalDegrain-2.6.7~ErazorTT.avsi, line 424)

Why?

Lol, just look that script you will know why the postSigma must greater than 0
(postFFT == 4) ? DT_KNLMeansCL( postDither > 0 ? in.ConvertBits(16) : in, a=2, d=postTR, h=postSigma, Luma = LumaP, Chroma = ChromaP, device_type="GPU", device_id=devId) : \

float h = 1.2
Controls the strength of the filtering. Larger values will remove more noise.

Peter Sagan
9th January 2025, 07:38
I found a version of this script bundled somewhere and it contained one additional line inside function DT_postFFT:

postTD = (postFFT == 11 || postFFT == 1) ? postTR : (postFFT == 2 && postTR > 4) ? 4 : (postFFT == 2) ? postTR : postTR * 2 + 1


Anyone know why that might be? The rest of the script is exactly identical to the version 2.6.7 posted here.

tormento
9th January 2025, 16:31
Lol, just look that script you will know why the postSigma must greater than 0
Look at the wiki (http://avisynth.nl/index.php/TemporalDegrain2).

It tells that postSigma can be between 0 and 4 and it doesn't tell that it has to be strictly bigger than 0.

Either is wrong the script or the wiki page.

isidroco
10th January 2025, 15:45
Hi, I have 4c/8threads cpu and can't get temporaldegrain2 use more than 13% of the cpu. Using AviSynth+ v3.7.3 and also added to the script with no perceivable difference:
SetFilterMTMode( "DEFAULT_MT_MODE", MT_MULTI_INSTANCE )
prefetch(4)

Edit, managed to get 18% with:
TemporalDegrain2( degrainTR=2, grainLevel=2, postFFT=3, postSigma=1.0, fftThreads=4)
prefetch( 2)


Is there any other setting to improve CPU usage and speed up process?

kedautinh12
18th January 2025, 21:53
Look at the wiki (http://avisynth.nl/index.php/TemporalDegrain2).

It tells that postSigma can be between 0 and 4 and it doesn't tell that it has to be strictly bigger than 0.

Either is wrong the script or the wiki page.

Between 0 and 4 with other plugins but KnlmeansCL, did you know "float" mean?

hello_hello
30th March 2025, 12:32
I was doing my usual TemporalDegrain2 vs QTGMC comparison before encoding a video today (as depending on the type of noise one of them usually works better than the other), and I found TemporalDegrain2 was doing something odd to a particular frame at the end of a scene. Anyone know why? Enabling post processing seems to help a lot, but it also slows encoding down a fair bit. I guess I'm just hoping to understand what it is about this one frame. The script I used for the screenshots below only contained either TemporalDegrain2 or QTGMC.

Source
https://i.ibb.co/8DMHVhBg/Original.png

TemporalDeGrain2(degrainTR=1, grainLevel=2)
https://i.ibb.co/cKHbS1cQ/Temporal-De-Grain2.png

TemporalDeGrain2(degrainTR=1, grainLevel=1, postFFT=3, postSigma=1, postDither=1)
https://i.ibb.co/Zp1yJL3b/Temporal-De-Grain3.png

QTGMCp(InputType=1, EzDenoise=2.0, Preset="very slow", gpuid=-1) - Dogway's version
https://i.ibb.co/tTgDhDck/QTGMC.png

It's frame #81 in this sample (5.7 MiB).
Test Sample.mkv (https://files.videohelp.com/u/210984/Test%20Sample.mkv)

rgr
31st March 2025, 19:52
I don't think you'll get an answer. Probably a random combination of factors that led to this. I, on the other hand, observed something like this at the beginning of the scenes (first frame or frames). Only the author could analyze it, I guess.

rgr
17th July 2025, 13:42
The original file, after dfttest and after TD2 (degrainTR=3, grainLevel=1).
Hair doesn't look the best after this filter. Even changing it to grainLevel=0 doesn't help much. On the plus side -- it sharpens nicely.

https://imgsli.com/Mzk5MDA0/1/2

Kurosu
11th August 2025, 18:32
I was doing my usual TemporalDegrain2 vs QTGMC comparison before encoding a video today (as depending on the type of noise one of them usually works better than the other), and I found TemporalDegrain2 was doing something odd to a particular frame at the end of a scene. Anyone know why?

[...]

It's frame #81 in this sample (5.7 MiB).
Test Sample.mkv (https://files.videohelp.com/u/210984/Test%20Sample.mkv)


What you are seeing is unfortunately something hard to set automatically. When there is a scene change, TDv2 may still try to use frames from the other side of the scene change. Your frame 81 is just before one, and I suspect if you look at your processed frame 82, it'll also have similar artifacts.

The internal MCompensate (including MDegrain which calls it) calls rely on thSCD2 primarily (and thSCD1, which TDv2 multiplies by 64 before passing to MCompensate and friends) in relation to scene change detection. Go look at MVTools documentation to understand these and maybe try to tweak it. Try maybe thSCD2=100 (40% of blocks) or 77 (30%), but it will depend on your noise level.