Page 13 of 17

Re: DGDenoise

Posted: Wed Nov 07, 2018 11:30 pm
by hydra3333
I seem to recall something about a custom avscompat.dll for vapoursynth ... is one needed ?

Re: DGDenoise

Posted: Thu Nov 08, 2018 4:49 am
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

Re: DGDenoise

Posted: Tue Jun 23, 2020 7:56 am
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.

Re: DGDenoise

Posted: Tue Jun 23, 2020 8:05 am
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!

Re: DGDenoise

Posted: Wed Jun 24, 2020 4:46 am
by hydra3333
:thumbsup:

Re: DGDenoise

Posted: Wed Jun 24, 2020 10:32 am
by zybex
Rocky wrote:
Tue Jun 23, 2020 8:05 am
Yes I can do that.
OK, thanks.

Re: DGDenoise

Posted: Wed Oct 21, 2020 9:20 am
by Rocky
Gonna implement this today, zybex.

Re: DGDenoise

Posted: Wed Oct 21, 2020 1:03 pm
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.

Re: DGDenoise

Posted: Sun Oct 25, 2020 5:46 am
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.

Re: DGDenoise

Posted: Sun Oct 25, 2020 6:51 am
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?

Re: DGDenoise

Posted: Sun Oct 25, 2020 8:21 am
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.

Re: DGDenoise

Posted: Mon Oct 26, 2020 4:16 am
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"))

Re: DGDenoise

Posted: Mon Oct 26, 2020 7:55 pm
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!

Re: DGDenoise

Posted: Wed Nov 11, 2020 4:00 am
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:

Re: DGDenoise

Posted: Wed Nov 11, 2020 5:39 am
by Rocky
I'll look into that today.

Re: DGDenoise

Posted: Wed Nov 11, 2020 4:36 pm
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.

Re: DGDenoise

Posted: Wed Nov 11, 2020 8:05 pm
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.

Re: DGDenoise

Posted: Thu Nov 12, 2020 5:27 am
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.

Re: DGDenoise

Posted: Thu Nov 12, 2020 1:07 pm
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.

Re: DGDenoise

Posted: Thu Nov 12, 2020 2:50 pm
by Rocky
Jolly good, I will make a slipstream later this evening after swimming. Thank you!

Re: DGDenoise

Posted: Fri Nov 13, 2020 1:48 pm
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.

Re: DGDenoise

Posted: Fri Nov 13, 2020 2:36 pm
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.

Re: DGDenoise

Posted: Fri Nov 13, 2020 2:44 pm
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...

Re: DGDenoise

Posted: Fri Nov 13, 2020 5:06 pm
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:

Re: DGDenoise

Posted: Fri Nov 13, 2020 8:42 pm
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.