DGDenoise

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

Re: About DGDenoise

Post by Selur » Sun Aug 21, 2016 10:23 am

Nice! Thanks for looking into it. :)

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

Re: About DGDenoise

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

OK, new version uploaded. Fixes:

* Shortnames
* Cropping artifacts
* Default strength for NLM lowered.

The remaining issues are all a result of the current server design. I am looking into moving everything into the filter DLL. Remember when I first started DGDecNV with a server? The old CUVID server! ;)

The nVidia bilateral filter looks nice. I'll probably add it as a kernel.

Selur
Moose Approved
Posts: 114
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Sun Aug 21, 2016 10:38 am

I can confirm that short file names work fine now and that the artifacts are gone :) :bravo:
I am looking into moving everything into the filter DLL.
Looking forward to it. :D

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

Re: About DGDenoise

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

There's a regression with the cropping stuff. I am going to remove the upload until it is fixed. I may have to enforce mod8 and require you to crop after DGDenoise. No big deal.

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

Re: About DGDenoise

Post by admin » Mon Aug 22, 2016 10:36 am

I re-uploaded it with the regression fixed.

I am going to focus on integrating things into the filter and ditching the server. Still, I'll be happy to receive feedback on the denoising implementation.

Selur
Moose Approved
Posts: 114
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Mon Aug 22, 2016 11:04 am

Totally groggy from work today, but will do some testing the next few days. :)

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

Re: About DGDenoise

Post by admin » Mon Aug 22, 2016 11:57 am

Take a break, my friend, you've already done a lot for me.

Selur
Moose Approved
Posts: 114
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Tue Aug 23, 2016 2:51 pm

btw. did some encodes using DGDenoise on different sources with different strength levels, haven't looked at the results yet, but uploaded the files to my GoogleDrive in the 'denoising' folder if you or someone else wants to look at them.
(will probably encode a few other sources too in the next few days)

Cu Selur

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

Re: About DGDenoise

Post by admin » Tue Aug 23, 2016 5:23 pm

Sweet, thank you, I will have a look.

I made good progress today on ditching the server and integrating everything into the Avisynth filter. I eliminated the use of freeglut/glew (that is, all vestiges of OpenGL), and did everything with a raw CUDA texture. Right now it is still an executable using the CUDA runtime API, but I can move the code right into the filter DLL. That wasn't possible before due to the OpenGL dependency. I haven't decided whether to stick with the CUDA runtime API or switch to the CUDA driver API. It would be simpler to keep the runtime API, but I never tried making a filter using the runtime API. There shouldn't be a problem but we'll see. The only downside is I have to ship cuda*_60.dll, but no big deal.

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

Re: About DGDenoise

Post by gonca » Tue Aug 23, 2016 5:43 pm

Re first two sources
Strength 01
Looks good

Strength 04-05
A little too soft, some loss of detail

Bear in mind my eyes aren't what they used to be and I'm not a whiz at this like you two are
Good work D G, as always

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

Re: About DGDenoise

Post by admin » Tue Aug 23, 2016 8:09 pm

Hi gonca, great to hear from you! And thank you for your testing.

I made the defaults based on the AddGrain(100) call I was using to simulate noise. That's strong grain. I think we can tweak the defaults later based on more real-world stuff. That's why I asked for samples. ;) For now just set the parameters as you need and let me know what you like.

I got the integrated filter working. I just have to make a 32-bit build and then I will release it. We'll say adios to the server and OpenGL. Buh-bye! :lol:

The tradeoff for CUDA runtime versus driver API is that I avoid having to ship a .cubin but have to ship a cudart*.dll. So that's a wash and the easier coding for the runtime API rules.

This infrastructure I have developed opens up a lot of possibilities for GPU filters. If you have any great ideas for GPU-accelerated filters beyond denoising, please speak up. What filters run so slow you want to pull your hair out? You get -10 points if you say QTGMC(); that's a script. Maybe some of the filters it invokes can be accelerated, however.

The whole integrated filter is only ~500 lines of code total (including the Avisynth code and KNN and NLM kernel codes). It's ridiculous how powerful CUDA is. Here's what I have to say to nVidia...
:bravo:

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

Re: About DGDenoise

Post by gonca » Tue Aug 23, 2016 9:16 pm

In terms of filters I would say that you should look first at what filters you use.
They don't have to be "slow" to be improved, and you do have a knack for improving things by making them run on video cards, as your other software.
As far as defaults, I leave that to your judgement, with help from Selur, I am sure the final will be good, and the end user can always tweak a little, if so desired
QTMC is slow, but like you stated, it is a script and not a plugin

If you are willing to help I can set up some avisynth scripts and test the old Clint spaghetti westerns and the Godfather trilogy, all very noisy movies,

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

Re: About DGDenoise

Post by admin » Tue Aug 23, 2016 9:46 pm

@gonca

Thank you for your thoughts and I will help you. Just ask!

@all

I have uploaded the integrated filter version, so re-download DGDenoise.rar and read the instructions carefully. The kernel and sobel parameters are different. Kernel is now 1 or 2 for KNN or NLM. Sobel is now in the range 0 to 1000.

Get rid of the old DenoiseServer.exe, freeglut.dll, glew*.dll, and cudart*_60.dll. You have to put cudart*_75.dll in your DLL search path. I hope you know what that means. :geek:

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

Re: About DGDenoise

Post by admin » Tue Aug 23, 2016 10:41 pm

Don't be shy to play with the sobel parameter. If you reduce it below default you retain more detail, as you can verify with the map option. Try sobel=100 together with a moderate strength (0.5). It works well on a noisy Stones BD. We would like to retain detail on faces but not on backgrounds, but things like that require artificial intelligence beyond the available APIs.

User avatar
tormento
Moose Approved
Posts: 339
Joined: Mon Sep 20, 2010 2:18 pm

Re: About DGDenoise

Post by tormento » Wed Aug 24, 2016 9:30 am

Please notice I had to manually download msvcr120d.dll to make it work.

Windows 10 x64 build 14905

I'd like to use DGDenoise as a pre filter to SMDegrain but I get a wrong space color error from it.

How can I convert it back to a format SMDegrain reads?

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

Re: About DGDenoise

Post by admin » Wed Aug 24, 2016 10:29 am

Add ConvertToYUY2() or ConvertToYV12() after DGDenoise().

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

Re: About DGDenoise

Post by admin » Wed Aug 24, 2016 10:30 am

Multiple instance and VirtualDub re-open do not work yet. I have to implement floating cuda contexts as in DGDecodeNV. It will require me to convert from cuda runtime to cuda driver API. Waiting for another burst of energy...

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

Re: About DGDenoise

Post by admin » Wed Aug 24, 2016 8:13 pm

I completed the CUDA driver API version. Multiple instantiation and VirtualDub re-open now work fine, which means the filter will work correctly in MeGUI, etc. I'll do some regression testing and then upload it, probably tomorrow morning, as a candidate release.

User avatar
tormento
Moose Approved
Posts: 339
Joined: Mon Sep 20, 2010 2:18 pm

Re: About DGDenoise

Post by tormento » Thu Aug 25, 2016 5:04 am

admin wrote:I completed the CUDA driver API version. Multiple instantiation and VirtualDub re-open now work fine, which means the filter will work correctly in MeGUI, etc. I'll do some regression testing and then upload it, probably tomorrow morning, as a candidate release.
Do you plan to create a new DGDecodeNV with DGFilter as option in same dll?

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

Re: About DGDenoise

Post by admin » Thu Aug 25, 2016 8:24 am

tormento wrote:Do you plan to create a new DGDecodeNV with DGFilter as option in same dll?
I'm considering it, but wonder about the point if there is already a stand-alone filter.

@all

I just uploaded the driver API version. It also adds a parameter to specify the desired GPU when you have more than one. The kernel is shipped as PTX code, so this theoretically is future proof for new nVidia architectures.

http://rationalqm.us/misc/DGDenoise.rar

This is my first release candidate. Your testing will be appreciated.

Selur
Moose Approved
Posts: 114
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Thu Aug 25, 2016 10:17 am

Current DGDenoise.txt states:
DGDenoise currently requires RGB32 input and mod 8 dimensions. Crop after DGDenoise()
if you need to. A later version may remove these limitations.
Is this still true, thought the limitation was removed. :)

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

Re: About DGDenoise

Post by admin » Thu Aug 25, 2016 10:21 am

It is still true. The previous "fix" caused a regression. I am working on resolving this for a following release.

Selur
Moose Approved
Posts: 114
Joined: Mon Nov 05, 2012 4:49 pm

Re: About DGDenoise

Post by Selur » Thu Aug 25, 2016 10:28 am

Would it be better to add borders or resize using Pointresize to archive mod8?

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

Re: About DGDenoise

Post by admin » Thu Aug 25, 2016 10:45 am

AddBorders is best. This limitation will be removed in the next version.

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

Re: About DGDenoise

Post by gonca » Thu Aug 25, 2016 4:18 pm

Homer Simpson time

Can anyone tell me the error in this basic script, please
LoadPlugin("C:\Program Files (x86)\dgdecnv\DGDecodeNV.dll")
DGSource("I\input.dgi")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\DGDenoise\x32\DGDenoise.dll")
ConvertToRGB32()
DGDenoise().AssumeFPS(24000,1001)
Error in line 2

Post Reply