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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th September 2021, 22:40   #1  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
EZdenoise

Temporal denoiser. Requires MvTools2

I recommend you only tweak the following parameters:
  • thSAD = Controls how much noise is picked up, with higher values picking more noise. The default should be good for modern content. Very noisy videos will require a higher value. Or use ShowMe() (more info below). Default: 150
  • TR = Temporal Radius: how many frames to analyze (previous and next), higher values removes more noise but is slower. Default: 3
  • BLKSize = Blocksize: lower values increases quality but is slower. Good values are 4, 8 or 16. Default: 8
  • Chroma: Accepts true or false. Only enable this if your video has a lot of noise. It is much slower if set to true. Default: false
  • out16: Accepts true or false. out16=true outputs 16bits which is good if you want to use more filters after EZdenoise. The only reason it defaults to false is because 10bit or higher inputs are not supported if enabled. Default: false

Testings
EZdenoise_v2 vs BM3D_CPU
Settings used:
Code:
LWLibavVideoSource("C:\Users\Admin\Documents\FFMPEG\01.mkv")
Trim(0, 600)
ConvertBits(16)
EZdenoise()
ConvertBits(10, dither=1)
Prefetch(12, 48)
Code:
AMD Ryzen 3900X encoded 600 frames in 15.412s (FFV1)
Code:
LWLibavVideoSource("C:\Users\Admin\Documents\FFMPEG\01.mkv")
Trim(0, 600)
ConvertBits(32)
BM3D_CPU(radius=2)
BM3D_VAggregate(radius=2)
ConvertBits(16)
ConvertBits(10, dither=1)
Prefetch(12, 48)
Code:
AMD Ryzen 3900X encoded 600 frames in 29.895s (FFV1)
Image comparison (All images were scaled with spline36):
Original (Blu-ray)
https://i.ibb.co/VYpP0nB/RAW-01.png

EZdenoise (Lossless FFV1)
https://i.ibb.co/bPxY6Rw/EZdenoise.png

BM3D (Lossless FFV1)
https://i.ibb.co/n8hzbNC/BM3D.png

Check the explosion, starting at the top right:
You can see that EZdenoise retains more sharpness.
And looking at the bottom part of the explosion, you can see EZdenoise also performs deblocking.

In this example, EZdenoise is the clear winner. It is twice as fast and keeps more details.

Changelog:

Code:
EZdenoise v2
Changed chroma=true to chroma=false which is also what BM3D defaults to.
This change increases speed by ~50%.
Also added a variable for pel.
Using anything but the default value of 1 is placebo, but hey, it is there if you want it.

EZdenoise v3
Added "Falloff" parameter.
Previously, thSAD2's would be (thSAD/2), which was probably too low.
This version uses (thSAD*0.9).
There should be no reason for you to change the new default.

EZdenoise v4
Hardcoded "Falloff" parameter.
Added "out16" parameter (which only supports 8bit sources).
Using out16=true is 15% faster than using ConvertBits(16), because MAnalyse now respects the bit depth of the input.
Previous versions had MAnalyse run at 16bit (if ConvertBits(16) was used) which didn't improve image quality and only wasted performance.

Added ShowMe()
Can be used to more easily find a good thSAD value.
(Look at the top left corner during preview with AvsPmod)
(And make sure to ignore any value that is shown on frames right after a scene change)
Should be placed right after your Source filter.
(Except for when your video has black bars, in which case you need to crop them first)

Example:

LWLibavVideoSource("C:\Users\Admin\Documents\INPUT.mkv")
Crop(0, 140, -0, -140)
ShowMe()

I recommend you view 5 different scenes, write down the displayed value, calculate an average, and round it up.
-
EZdenoise_v4
-
Attached Files
File Type: zip EZdenoise.zip (643 Bytes, 175 views)
File Type: zip EZdenoise_v2.zip (748 Bytes, 132 views)
File Type: zip EZdenoise_v3.zip (805 Bytes, 170 views)
File Type: zip ShowMe.zip (296 Bytes, 88 views)
File Type: zip EZdenoise_v4.zip (819 Bytes, 18 views)

Last edited by takla; 23rd March 2023 at 19:23.
takla is offline   Reply With Quote
Old 6th September 2021, 00:06   #2  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Can you upload to another sever??
kedautinh12 is offline   Reply With Quote
Old 6th September 2021, 03:18   #3  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
The images? Sure.

https://drive.google.com/drive/folde...p8?usp=sharing
takla is offline   Reply With Quote
Old 6th September 2021, 03:41   #4  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
I mean EZdenoise.zip but it been approved by admin
kedautinh12 is offline   Reply With Quote
Old 6th September 2021, 07:17   #5  |  Link
Pauly Dunne
Grumpy Old Man.
 
Pauly Dunne's Avatar
 
Join Date: Jul 2019
Location: Out There....
Posts: 692
Quote:
Originally Posted by kedautinh12 View Post
I mean EZdenoise.zip but it been approved by admin
OK, your suggestion worked, but I still don't know what this means:-

EZdenoise().

I guess that's where you add the parameters to how you want it to filter.

So my next question is...how & what do I need to add to "denoise" a little stronger ??
__________________
Not poorly done, just doin' it my way !!!
Live every day like it's your last, because one day, it will be !! (M$B)
Pauly Dunne is offline   Reply With Quote
Old 6th September 2021, 07:23   #6  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
That script based MVTools2.dll so that script use MVTools2's parameter. I think you need read MVTool2 parameter's description
kedautinh12 is offline   Reply With Quote
Old 6th September 2021, 07:31   #7  |  Link
Pauly Dunne
Grumpy Old Man.
 
Pauly Dunne's Avatar
 
Join Date: Jul 2019
Location: Out There....
Posts: 692
Quote:
Originally Posted by kedautinh12 View Post
That script based MVTools2.dll so that script use MVTools2's parameter. I think you need read MVTool2 parameter's description
OK.

But I added a few things between the (), and it definitely changes
__________________
Not poorly done, just doin' it my way !!!
Live every day like it's your last, because one day, it will be !! (M$B)
Pauly Dunne is offline   Reply With Quote
Old 6th September 2021, 10:36   #8  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by Pauly Dunne View Post
So my next question is...how & what do I need to add to "denoise" a little stronger ??
Code:
function EZdenoise(clip Input, int "thSAD", int "thSADC", int "TR", int "BLKSize", int "Overlap")
{
thSAD = default(thSAD, 150)
thSADC = default(thSADC, thSAD)
TR = default(TR, 3)
BLKSize = default(BLKSize, 16)
Overlap = default(Overlap, BLKSize/2)

Super = Input.MSuper(pel=1)
Multi_Vector = Super.MAnalyse(Multi=True, Delta=TR, BLKSize=BLKSize, Overlap=Overlap)

Input.MDegrainN(Super, Multi_Vector, TR, thSAD=thSAD, thSAD2=thSAD/2, thSADC=thSADC, thSADC2=thSADC/2)
}
http://avisynth.nl/index.php/MVTools
VoodooFX is offline   Reply With Quote
Old 6th September 2021, 18:29   #9  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by Pauly Dunne View Post
OK, your suggestion worked, but I still don't know what this means:-

EZdenoise().

I guess that's where you add the parameters to how you want it to filter.

So my next question is...how & what do I need to add to "denoise" a little stronger ??
Uhm, did you not read anything I wrote in the op, like, at all?? All your questions are already answered there...

Last edited by takla; 6th September 2021 at 18:31.
takla is offline   Reply With Quote
Old 6th September 2021, 20:14   #10  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
This is just smdegrain
lansing is offline   Reply With Quote
Old 6th September 2021, 20:33   #11  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by lansing View Post
This is just smdegrain
No it's not. SMDegrain is just mvtools with some extras. And SMDegrain has garbage default values. This here is just mvtools with good default values.
takla is offline   Reply With Quote
Old 6th September 2021, 23:01   #12  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by takla View Post
No it's not. SMDegrain is just mvtools with some extras. And SMDegrain has garbage default values. This here is just mvtools with good default values.
So the same thing with better default settings but without extras. The extras then cost extra.
Peace, a little fun must be.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 7th September 2021, 02:12   #13  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by gispos View Post
So the same thing with better default settings but without extras. The extras then cost extra.
Peace, a little fun must be.
Exactly SMDegrain is also just a version of mdegrain from mvtools. Just like EZdenoise.

But what SMDegrain does not achieve with ~640 lines, EZdenoise achieves with just 13 lines.

I made this script because I got fed up with the garbage default settings SMDegrain comes with, because these settings cause artefacts on my testclips. And in the process I've learned which settings are the most important and which are basically just placebo (pel=2 for example).

Such processing power is much better spend on blksize and tr.
takla is offline   Reply With Quote
Old 7th September 2021, 08:30   #14  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Has anyone tried to use svpflow1/svpflow2 as alternative to mvtools for gpu accelleration?
(https://www.svp-team.com/wiki/Manual:SVPflow)
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 17th January 2022, 05:11   #15  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Added EZdenoise v2
  • Changed chroma=true to chroma=false which is also what BM3D defaults to. This change increases speed by ~50%.
  • Also added a variable for pel. Using anything but the default value of 1 is placebo, but hey, it is there if you want it.

Last edited by takla; 17th January 2022 at 06:38.
takla is offline   Reply With Quote
Old 17th January 2022, 06:08   #16  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Can you share another link?? I think link will be approved very long time to wait by admin
kedautinh12 is offline   Reply With Quote
Old 17th January 2022, 06:09   #17  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
I think github is expect
kedautinh12 is offline   Reply With Quote
Old 17th January 2022, 06:37   #18  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by kedautinh12 View Post
I think github is expect
https://www.mediafire.com/file/89y8y...se_v2.zip/file
takla is offline   Reply With Quote
Old 17th January 2022, 06:40   #19  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Ok. Don't say thank cause someone will report me to admin and they will ban me

Last edited by kedautinh12; 17th January 2022 at 06:43.
kedautinh12 is offline   Reply With Quote
Old 22nd January 2022, 15:12   #20  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
takla, here's a function I've been using. It's basically EZDenoise with more options. It might give you some ideas for v3.

MDegrainNL.zip

Trumotion is disabled by default as it tends to cause blurring.
YUV is expanded from limited range to full range for MAnalyse, but there's an argument to change that.
There's also an argument for specifying a bitdepth for the MAnalyse clip. If you're working with a high bitdepth source and you're in a hurry you can reduce the bitdepth of the search clip.
Multithreading with avstp.dll is disabled by default as it's not compatible with Avisynth+'s multithreading, but there's a line in the function for specifying the path to avstp.dll, so if it's set correctly, avstp.dll is automatically loaded when MT=true.

I mainly use it for light denoising so the defaults aren't the same, but obviously you can change them.
hello_hello 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 06:18.


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