DGDenoise

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
User avatar
hydra3333
Posts: 393
Joined: Wed Oct 06, 2010 3:34 am
Contact:

Re: DGDenoise

Post by hydra3333 »

I seem to recall something about a custom avscompat.dll for vapoursynth ... is one needed ?
I really do like it here.
DAE avatar
Guest

Re: DGDenoise

Post by Guest »

hydra3333 wrote:
Wed Nov 07, 2018 11:30 pm
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
DAE avatar
zybex
Posts: 2
Joined: Sun Jun 14, 2020 5:46 am

Re: DGDenoise

Post by zybex »

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
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

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
Posts: 393
Joined: Wed Oct 06, 2010 3:34 am
Contact:

Re: DGDenoise

Post by hydra3333 »

:thumbsup:
I really do like it here.
DAE avatar
zybex
Posts: 2
Joined: Sun Jun 14, 2020 5:46 am

Re: DGDenoise

Post by zybex »

Rocky wrote:
Tue Jun 23, 2020 8:05 am
Yes I can do that.
OK, thanks.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Gonna implement this today, zybex.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

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.
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc »

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
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

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?
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc »

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.
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc »

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
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Thank you, Sharc. That behavior is not good. I'm calling on Sherman to look into this. Multitasking -- it's a good thing!
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc »

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
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

I'll look into that today.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Yes, I duplicated it. It's not horribly bad as the value is changed only by 1 or 2 but it should be fixed.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Hehe. I got lucky and found the color shift problem 10 seconds after opening DGDenoise.cu for inspection. Gotta regression test and make sure it's theoretically correct (seems to be but wanna be thorough about it). Thanks for pointing it out. It may point to similar issues in my other CUDA filters, too, so I am really grateful for this report, Sharc. :salute:

The edge effect is another matter. It is insignificant for reasonable strength values. e.g., it is absent at cstrength 0.5 and really prominent at cstrength 5.0. Strength 0.9 is quite strong. Still, I'll look at that tomorrow.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Can you please test this? Both problems should be fixed. Thank you, Sharc. You are my knight in shining armor!

http://rationalqm.us/misc/DGDecodeNV_Sharc.dll

Rename it properly of course. This is the 64-bit DLL. Let me know if you need 32-bit. When you bless things, I'll make a slipstream.

BTW, DGBob() is the only other affected filter. That will be fixed too when I slipstream.
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc »

It's perfect now, thank you :hat:
And yes it would be great if you would include the 32 bit .dll in the official slipstream. I am still using much of 32 bit avisynth, so far.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Jolly good, I will make a slipstream later this evening after swimming. Thank you!
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Darn, I went to test things in 32-bit and found that the Release mode crashes but the Debug mode succeeds. That's gonna make debugging hard.

Can you please test the released DGDecodeNV.dll DGDenoise in 32-bit. Is it OK for you (other than the chroma shift)? I tried it but it crashed so I'm thinking I may have a 32-bit Avisynth+ issue, because if it was that broken someone would have told me. If it works for you please tell me your Avisynth+ version.

Thank you.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Looks like a problem in BlankClip (or maybe 32-bit VirtualDub), because BlankClip() crashes but DGSource() does not.

#source=BlankClip(color=color_magenta, width=720, height=576, pixel_type="YV12") # crashes in 32-bit release mode
source=DGSource("Alba.dgi") # OK in 32-bit release mode
b=source.DGDenoise(strength=1.0,cstrength=1.0,searchw=5)
interleave(source.Histogram("levels"),b.Histogram("levels"))

Please advise your test results.
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

Getting interesting now! This fails:

loadplugin("D:\Don\Programming\C++\DGDecNV\DGDecodeNV\x32\Release\dgdecodenv.dll")
source=BlankClip(color=color_magenta, width=720, height=576, pixel_type="YV12") #or any other color
b=source.DGDenoise(strength=1.0,cstrength=1.0,searchw=5)
interleave(source.Histogram("levels"),b.Histogram("levels"))

But this succeeds:

loadplugin("D:\Don\Programming\C++\DGDecNV\DGDecodeNV\x32\Release\dgdecodenv.dll")
tmp=DGSource("Alba.dgi") # not used
source=BlankClip(color=color_magenta, width=720, height=576, pixel_type="YV12") #or any other color
b=source.DGDenoise(strength=1.0,cstrength=1.0,searchw=5)
interleave(source.Histogram("levels"),b.Histogram("levels"))

So it looks like DGSource() initialization is doing something that DGDenoise requires. Investigating...
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: DGDenoise

Post by Sharc »

I noticed another oddity:
It crashes when I load the script an run it the first time -> Access violation.
Then I have to change any of the DGDenoise parameters and from then onwards it works.
I had this before, but got so much used to this oddity that I just used it that way ... assuming it's on my system only :belly-laugh:
User avatar
Rocky
Posts: 3525
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDenoise

Post by Rocky »

You're a funny guy, Sharc! Love ya. You have the system from hell. Not!

Please immediately report access violations experienced with DG tools. Hey, I know it's a once-in-a-blue-moon thing, but do what ya gotta do. :twisted:

Sherman says we should just drop 32-bit. Oh, the impetuousness of youth.
Post Reply