DGDenoise

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
User avatar
admin
Site Admin
Posts: 4415
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGDenoise

Post by admin » Thu Apr 20, 2017 12:21 pm

It's also half height. Yes, it is that way because there is one U sample (and one V sample) for each block of 4 luma samples.

Y Y
Y Y
U
V

Sharc
Moose Approved
Posts: 231
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc » Thu Apr 20, 2017 2:27 pm

Ah, the penny dropped why I got the horizontal reduction only. My source was actually 4:2:2 rather than 4:2:0.
Thanks.

Sharc
Moose Approved
Posts: 231
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc » Fri Feb 23, 2018 7:40 am

A cosmetic issue with DGDenoise:

When I set strength=0.0 I am getting an almost black picture for chroma=false, and a green picture for chroma=true.
Well, one should not set strength to zero, right? :roll:

User avatar
admin
Site Admin
Posts: 4415
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGDenoise

Post by admin » Fri Feb 23, 2018 8:41 am

Right. I'll add a check for that. Thanks for pointing it out.

mparade
Posts: 29
Joined: Mon Oct 13, 2014 7:45 am

Re: DGDenoise

Post by mparade » Sun Aug 19, 2018 5:52 pm

Hello,

Sorry for asking that, but how can one access CUDA Filters packaged into DGDecodeNV?

I have been using DGDecNV for a few years and now opted for giving a try to DGDenoise to speed up my scripts feeded into x265.

Thank you in advance for the support.

User avatar
admin
Site Admin
Posts: 4415
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGDenoise

Post by admin » Sun Aug 19, 2018 6:20 pm

Just load plugin DGDecodeNV.dll and then use DGDenoise(). If you use DGSource() then you have already loaded the dll. Refer to the DGDecodeNV user manual for parameters.

Boulder
Moose Approved
Posts: 46
Joined: Fri Jul 29, 2011 7:22 am

Re: DGDenoise

Post by Boulder » Tue Nov 06, 2018 1:15 pm

Isn't DGDenoise Vapoursynth-compatible? I tried using it the normal way as dgdecodenv.dll is in the VS plugins autoload folder, but the function is not recognized. DGSource itself works just fine. I'd like to switch to DGDenoise as my prefiltering tool, it's much faster than KNLMeansCL even with chroma processing enabled.

User avatar
admin
Site Admin
Posts: 4415
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGDenoise

Post by admin » Tue Nov 06, 2018 1:36 pm

DGDenoise is not native-Vapoursynth-enabled. You can run it in avscompat mode, however. Here is an example:

import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin("DGDecodeNV.dll")
core.avs.LoadPlugin("DGHDRtoSDR.dll")
clip = core.avs.DGSource("Coco.dgi",fulldepth=True)
clip = core.avs.DGHDRtoSDR(clip,fulldepth=False)
clip = core.avs.DGDenoise(clip)
clip.set_output()

I'm trying to stay away from native support, as it is a major hassle to implement and maintain two versions. If you run into any serious downsides from avscompat mode, please let me know.

BTW, you can run DGSource() in native mode with DGDenoise() in avscompat mode, but you have to load the DLL into both namespaces:

import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin("DGDecodeNV.dll")
core.avs.LoadPlugin("DGDecodeNV.dll")
core.std.LoadPlugin("DGHDRtoSDR.dll")
clip = core.dgdecodenv.DGSource("Coco.dgi",fulldepth=True)
clip = core.dghdrtosdr.DGHDRtoSDR(clip,fulldepth=False)
clip = core.avs.DGDenoise(clip)
clip.set_output()

Boulder
Moose Approved
Posts: 46
Joined: Fri Jul 29, 2011 7:22 am

Re: DGDenoise

Post by Boulder » Tue Nov 06, 2018 1:50 pm

Thanks, I think I'll start using the avscompat mode for now. I suppose there are no big differences what comes to performance or stability of DGSource?

User avatar
admin
Site Admin
Posts: 4415
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGDenoise

Post by admin » Tue Nov 06, 2018 2:04 pm

That's right, there is no significant difference performance-wise. There is a difference in autoloading but to me it is a minor matter.

User avatar
hydra3333
Moose Approved
Posts: 206
Joined: Wed Oct 06, 2010 3:34 am
Contact:

Re: DGDenoise

Post by hydra3333 » Thu Nov 08, 2018 12:30 am

I seem to recall something about a custom avscompat.dll for vapoursynth ... is one needed ?

gonca
Moose Approved/Curly Approved
Posts: 907
Joined: Sun Apr 08, 2012 6:12 pm

Re: DGDenoise

Post by gonca » Thu Nov 08, 2018 5:49 am

hydra3333 wrote:
Thu Nov 08, 2018 12:30 am
I seem to recall something about a custom avscompat.dll for vapoursynth ... is one needed ?
For the normal DGIndexNV and DGDecodeNV no
For the CudaSynth versions one will be needed

zybex
Posts: 2
Joined: Sun Jun 14, 2020 5:46 am

Re: DGDenoise

Post by zybex » Tue Jun 23, 2020 7:56 am

Hello dear Donald.
Thank you for your wonderful plugins and filters, they are really useful and are used by me and many users around the world.

I ask you to refine the filter "DGDenoise", having made separate adjustment of parameters for Luma and Chroma in it, this will allow it to be used much better. In particular, I have the original video files, which for high-quality noise reduction without loss of detail, the current version of the same parameter values ​​for Luma and Chroma in the "DGDenoise" filter is not enough.

The current option for the "DGDenoise" filter looks like this:
DGDenoise (clip c, float strength, float blend, bool chroma, int searchw, int device)

I suggest you create new additional parameters:
L_strength # Luma strength
L_blend # Luma blend
L_searchw # Luma searchw
C_strength # Chroma strength
C_blend # Chroma blend
C_searchw # Chroma searchw

At the same time, it would be nice to make compatibility with the old parameter format so that if the values of the new parameters are not specified (separately for Luma and Chroma), then the old parameters would act if their values are indicated (strength, blend, chroma, searchw).

Now I have to resort to such a trick for separately adjusting the noise reduction parameters for Luma and Chroma:

lumadenoise = DGDenoise(strength=0.10, blend=0.5, chroma=false, searchw=9, device=255)
chromadenoise = DGDenoise(strength=0.12, blend=0, chroma=true, searchw=9, device=255)
lumadenoise.MergeChroma(chromadenoise)

But I would like to achieve the same result by setting the parameters in the "DGDenoise" filter in one line, for 1 time, this would be more correct, convenient and possibly faster.

User avatar
Rocky
Moose Approved
Posts: 1052
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky » Tue Jun 23, 2020 8:05 am

Yes I can do that. There are some other pending enhancement requests. I hope to get to it soon after getting DGDemux with MVC etc. out the door. Thank you for your suggestion and welcome to the forum, zybex!

User avatar
hydra3333
Moose Approved
Posts: 206
Joined: Wed Oct 06, 2010 3:34 am
Contact:

Re: DGDenoise

Post by hydra3333 » Wed Jun 24, 2020 4:46 am

:thumbsup:

zybex
Posts: 2
Joined: Sun Jun 14, 2020 5:46 am

Re: DGDenoise

Post by zybex » Wed Jun 24, 2020 10:32 am

Rocky wrote:
Tue Jun 23, 2020 8:05 am
Yes I can do that.
OK, thanks.

User avatar
Rocky
Moose Approved
Posts: 1052
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky » Wed Oct 21, 2020 9:20 am

Gonna implement this today, zybex.

User avatar
Rocky
Moose Approved
Posts: 1052
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky » Wed Oct 21, 2020 1:03 pm

I slipped it into 2053 build 218, so re-download 2053 from the binaries area to get it.

You now have cstrength and cblend for chroma. For technical reasons, searchw applies to both luma and chroma.

Sharc
Moose Approved
Posts: 231
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc » Sun Oct 25, 2020 5:46 am

Nice new feature :salute:
Just nitpicking: strength=0 or cstrength=0 throw an error. In case one wants to denoise luma or chroma only, zero should perhaps be allowed to disable the unwanted function.
Any plans to add temporal denoising? Now I have to do this in an extra step using a 'legacy' filter. No major problem though.

User avatar
Rocky
Moose Approved
Posts: 1052
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky » Sun Oct 25, 2020 6:51 am

Good point about the zero value. Will do. I'll do it for both luma and chroma strength and then we can ditch the chroma option.

What temporal filter are you using?

Sharc
Moose Approved
Posts: 231
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc » Sun Oct 25, 2020 8:21 am

Rocky wrote:
Sun Oct 25, 2020 6:51 am
Good point about the zero value. Will do. I'll do it for both luma and chroma strength and then we can ditch the chroma option.
Thank you.
What temporal filter are you using?
temporalsoften(),fluxsmoothST(),CnR2(), mainly for VHS sources, filtering the even/odd grouped fields.

Sharc
Moose Approved
Posts: 231
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc » Mon Oct 26, 2020 4:16 am

DGDenoise introduces a slight color shift towards lower values in the histogram, for color=true.
Also, some color artefacts appear at the very bottom and right side of the filtered picture, like a bar of few pixels.
Is this to be expected, or is it on my system only?

Script for testing, for example

Code: Select all

source=BlankClip(color=color_magenta, width=720, height=576, pixel_type="YV12")  #or any other color
a=source
b=source.DGDenoise(strength=0.001,cstrength=0.9,searchw=5,chroma=true)
interleave(a.Histogram("levels"),b.Histogram("levels"))

User avatar
Rocky
Moose Approved
Posts: 1052
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky » Mon Oct 26, 2020 7:55 pm

Thank you, Sharc. That behavior is not good. I'm calling on Sherman to look into this. Multitasking -- it's a good thing!

Sharc
Moose Approved
Posts: 231
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc » Wed Nov 11, 2020 5:00 am

Thank you for the new version of DGDenoise.
The slight color shift and border effect seem still to be there, at least on my system .... :scratch:

User avatar
Rocky
Moose Approved
Posts: 1052
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky » Wed Nov 11, 2020 6:39 am

I'll look into that today.

Post Reply