DGDenoise

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
Selur
Distinguished Member
Distinguished Member
Posts: 112
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Sun Aug 21, 2016 6:17 am

Some annoying things:
a. When opening a script with DGDenoise in it in Virtual Dub, then changeing the script and reopeing it with File->Reopen video file.
Virtual Dub crashes. Closing the video and reopening it works.
b. On can't use multiple instances of DGDenoise inside a script:

Code: Select all

LoadPlugin("G:\Hybrid\avisynthPlugins\DGDecodeNV.dll")
LoadPlugin("G:\Hybrid\avisynthPlugins\DGDenoise.dll")
# loading&deinterlace h:\Output\denoise test source 1.mkv  using DGDECNV
source = DGSource(dgi="H:\Temp\mkv_85a16ff1ce25028b388bb8c47890a490_11840.dgi",deinterlace=1)
# cropping the source
source = source.Crop(0,80,-2,-80)
# denoising using DGDenoise
dg = source.ConvertToRGB32(interlaced=false)
dg04 = dg.DGDenoise(strength=0.4).Subtitle("DGDenoise(strength=0.4)", align=9)
dg08 = dg.DGDenoise(strength=0.8).Subtitle("DGDenoise(strength=0.8)", align=9)
StackHorizontal(dg04,dg08)
return last
causes Virtual Dub to simply freeze :/

using:

Code: Select all

LoadPlugin("G:\Hybrid\avisynthPlugins\DGDecodeNV.dll")
LoadPlugin("G:\Hybrid\avisynthPlugins\DGDenoise.dll")
# loading&deinterlace h:\Output\denoise test source 1.mkv  using DGDECNV
source = DGSource(dgi="H:\Temp\mkv_85a16ff1ce25028b388bb8c47890a490_11840.dgi",deinterlace=1)
# cropping the source
source = source.Crop(0,80,-2,-80)
# denoising using DGDenoise
dg = source.ConvertToRGB32(interlaced=false)
dg04 = dg.DGDenoise(strength=0.4).Subtitle("DGDenoise(strength=0.4)", align=9)
#dg08 = dg.DGDenoise(strength=0.8).Subtitle("DGDenoise(strength=0.8)", align=9)
source = source.ConvertToRGB32(interlaced=false).Subtitle("Source", align=9)
StackHorizontal(source,dg04)
return last
I see some unwanted artifacts:
Image
uploaded the sample denoise test source 1.mkv to my GoogleDrive

Cu Selur

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

Re: About DGDenoise

Post by admin » Sun Aug 21, 2016 6:33 am

Good morning, Selur. Thanks for your extensive testing. Here are the things you found so far:

1. Short filenames not handled. [FIXED]
2. MT mode problem.
3. Re-open in VirtualDub fails.
4. Cannot have multiple instances per script.
5. Artifacting. [FIXED]
6. Default strength is too high for NLM. [FIXED]

Meanwhile, DGDenoise appears to be about twice as fast as KNLMeansCL, so it seems worthwhile to continue.

Selur
Distinguished Member
Distinguished Member
Posts: 112
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Sun Aug 21, 2016 7:06 am

Maybe mod16 or something similar is needed.
With the crop output resolution is 702x416, so width is only mod2.
BTW, you are converting to RGB32 twice.
I know, it's a remainder of a script where I wanted to compare multiple DGDenoise instances with using StackHorizontal/-Vertical calls. ;)
Last edited by Selur on Sun Aug 21, 2016 7:09 am, edited 1 time in total.

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

Re: About DGDenoise

Post by admin » Sun Aug 21, 2016 7:08 am

Interesting. The cropping is causing the artifacts. If you remove the cropping they go away. Should be fixable. Probably some size assumptions in the kernel code.

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

Re: About DGDenoise

Post by admin » Sun Aug 21, 2016 7:20 am

OK, width must be mod 8 because the kernel blocksize is 8. I may be able to remove this limitation. Investigating...

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

Re: About DGDenoise

Post by admin » Sun Aug 21, 2016 7:47 am

I fixed the crop issue by padding out and running the kernel at mod 8, even if the real size is not. No big deal.

I'll look into the other issues before uploading this fix.

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

Re: About DGDenoise

Post by admin » Sun Aug 21, 2016 8:49 am

Selur, I'm not able to reproduce your shortname issue. Here is my script:

loadplugin("d:\don\Programming\C++\dgdecnv\DGDecodeNV\x64\Release\dgdecodenv.dll")
loadplugin("D:\Don\Programming\C++\Avisyn~1\DGDenoise\x64\Release\dgdenoise.dll")
dgsource("D:\Don\Programming\C++\Avisyn~1\DGDenoise\Test\denoise test source 1.dgi",deinterlace=1)
ConvertToRGB32(interlaced=false)
DGDenoise(kernel=1)

There's actually no reason why it shouldn't work, so I think you must have had something else going on. Can you check it again please?

Selur
Distinguished Member
Distinguished Member
Posts: 112
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Sun Aug 21, 2016 9:02 am

Tried different files to make sure it's not just related to the source.
using:

Code: Select all

LoadCPlugin("G:\Hybrid\AVISYN~1\ffms2.dll")
LoadPlugin("G:\Hybrid\AVISYN~1\DGDENO~1.DLL")
# loading source: F:\TestClips&Co\test.avi
FFVideoSource("F:\TESTCL~1\test.avi",cachefile="H:\Temp\avi_0197468a3716844ade54f3f30f60eeda_4827_1_0.ffindex",fpsnum=25)
# denoising using DGDenoise
ConvertToRGB32(interlaced=false)
DGDenoise()
return last
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
DGDenoise: could not start the denoise server C:\Program Files (x86)\VirtualDub\DenoiseServer.exe, error 2!
(C:\Users\Selur\Desktop\test1.avs, line 7)
---------------------------
OK
---------------------------
changing the script to:

Code: Select all

LoadCPlugin("G:\Hybrid\avisynthPlugins\ffms2.dll")
LoadPlugin("G:\Hybrid\avisynthPlugins\DGDenoise.dll")
# loading source: F:\TestClips&Co\test.avi
FFVideoSource("F:\TestClips&Co\test.avi",cachefile="H:\Temp\avi_0197468a3716844ade54f3f30f60eeda_4827_1_0.ffindex",fpsnum=25)
# denoising using DGDenoise
ConvertToRGB32(interlaced=false)
DGDenoise()
return last
script get's opened without a problem.

Not sure it this is related, but I don't have any globally installed Avisynth on my system.
(got an avisynth.dll next to each player which I want to open avisynth scripts)

Cu Selur

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

Re: About DGDenoise

Post by admin » Sun Aug 21, 2016 10:08 am

OK, duplicated. I did not have a short name for the filename, just the path. Investigating...

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

Re: About DGDenoise

Post by admin » Sun Aug 21, 2016 10:18 am

I've fixed the short name problem by trying long first and if it fails trying short. I'll upload a new version and then look at the other issues.

Post Reply