DGDenoise

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

Re: About DGDenoise

Post by admin »

Here you go:

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

I may uprev to 2053 when I include this in the formal distribution.
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: About DGDenoise

Post by Sharc »

Don't I need a DGDenoise.dll for the standalone filter (avisynth plugin)?
Where to put the dgdenoise.ptx file?

I want to denoise an .avi using the sourcefilter AviSource() followed by DGDenoise(). I can't index an .avi with DGIndexNV .....
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Put the PTX file with DGDecodeNV.dll.

Just load the DGDecodeNV.dll and then put DGDenoise() in your script. You don't need to invoke DGSource().

Is the documentation not clear?
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: About DGDenoise

Post by Sharc »

Now it works, thanks. I had still an old DGDenoise.dll in my avisynth plugins folder.
Speed is very good. Congrats! With which settings of KNLMeansCL did you compare (d parameter)?
DAE avatar
Guest

Re: About DGDenoise

Post by Guest »

Give me an hour or so and I will try to run some tests on it
Hope I don't have the same brain fart as last time :facepalm:
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Sharc wrote:With which settings of KNLMeansCL did you compare (d parameter)?
Default, i.e., 0.
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: About DGDenoise

Post by Sharc »

Here some first results, tested on the fields of a noisy 720x576i video:

KNLMeansCL(0,3,4,4.0) 15.8fps
KNLMeansCL(1,3,4,4.0) 4.9fps
DGDenoise(strength=0.13) 13.2fps (strength>0.2 loosing details)

GPU: GT730
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Can you please give me the video and your script so I can look into the detail loss you mentioned, and also compare performance? I have a 1050 Ti.
DAE avatar
Guest

Re: About DGDenoise

Post by Guest »

What did I mess up this time on the script :?: :oops:

LoadPlugin("C:\Program Files (Portable)\dgdecnv\DGDecodeNV.dll")
DGSource("W:\HD\WORKFILES\VID_00000.DGI", fieldop=0)
DGDenoise(strength=0.5)
ConvertToYV12().AssumeFPS(24000,1001)
Attachments
VID_00000.AVS
(184 Bytes) Downloaded 585 times
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

You don't need the ConverttoYV12() and probably also the AssumeFPS(). Also, you can invoke the denoising in DGSource() and omit the DGDenoise() if you like.

Are you having a problem? Make sure you don't have an old DGDenoise.dll lying around to be autoloaded.
DAE avatar
Guest

Re: About DGDenoise

Post by Guest »

Cannot render file in MPC-BE and AVSMeter will not process it
New avs
VID_00000 - Copy.AVS
(147 Bytes) Downloaded 742 times
DGDenoise.ptx
Untitled.png
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Please post the script directly. Don't attach it.

Open the script in VirtualDub. What is the error or exception?

What is the point of your graphic with the PTX file circled?

"will not process it" is not helpful. What is the error?
DAE avatar
Guest

Re: About DGDenoise

Post by Guest »

Error in VDub is There is no function called DGDenoise
The image shows where I located DGDenoise.ptx
There are no old DGDenoise.dll on my system
AVSMeter opens and closes without doing anything, guess it can't load the script
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Looks like you have a wrong DGDecodeNV.dll. Looking at your graphic it shows a date of 12/26 for DGDecodeNV.dll! You have to use the one I gave in the rar file. The code for DGDenoise() is in the new DGDecodeNV.dll.
DAE avatar
Guest

Re: About DGDenoise

Post by Guest »

You are good
You just fixed dumb
Guess I was too antsy to try your denoiser
Thanks, all seems to be good again
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Good to hear. Don't ding yourself, gonca; I can see how one might think if you invoke DGDenoise(), rather than using DGSource() parameters, you might need only the PTX. I'll clarify that in the doc. Thank you for your testing.
DAE avatar
Guest

Re: About DGDenoise

Post by Guest »

Nah, I just jumped the gun and shot myself in the butt
I saw DGDecodeNV.dll and just left it, knowing full well that this dll has to be different from the old one to in-cooperate the new features.
I guess I was a kid in a candy store
Once again thanks for your patience
I will do some testing tomorrow after work
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Your attitude and self-reflection is refreshing. :bravo:

Looking forward to your test results.
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: About DGDenoise

Post by Sharc »

admin wrote:Can you please give me the video and your script so I can look into the detail loss you mentioned, and also compare performance? I have a 1050 Ti.
Here the script which I used for the tests and speed comparison:

Code: Select all

clip=AviSource("k:\Video Tape Captures\capture (2010-07-23 at 17-34-40).avi")
clip=converttoyv12(clip,interlaced=true)
clip=separatefields(clip)

#Filter=KNLMeansCL(clip,1,3,4,4.0) 
Filter=DGDenoise(clip,strength=0.15)

out=weave(Filter)
return out
I will upload a snippet of the .avi later today. I have to prepare it because it is a lossless 4:2:2 capture and the filesize is huge.

I will also run test with DGDenoise(deinterlace=2,strength=0.15)

Edit 1:
The latter doesn't make sense, I can't deinterlace/bob with DGDenoise, right? :facepalm:
GPU deinterlacing/bobbing works only via DGSource, correct?

Edit 2:
For visual inspection (blur, details) on PC monitor I am using:

Code: Select all

clip=AviSource("k:\Video Tape Captures\capture (2010-07-23 at 17-34-40).avi")
clip=converttoyv12(clip,interlaced=true)
clipbobbed=tdeint(clip,mode=1,order=1)

#Filter=KNLMeansCL(clipbobbed,1,3,4,4.0)  #.separatefields().selectevery(4,0,3).weave() #for re-interlaceing
Filter=DGDenoise(clipbobbed,strength=0.15) #.separatefields().selectevery(4,0,3).weave() #for re-interlacing

out1=clipbobbed
out2=Filter

return stackhorizontal(out1,out2)
Edit 3:
Here is the sample:
http://www.mediafire.com/file/71i6u0pmc ... ample1.avi
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

First, if you want to compare the quality and performance you have to use comparable parameters. But even with the ones you
chose (that favor KNLMeansCL) I see no detail loss or any significant differences with this script:

loadplugin("dgdecodenv.dll")
loadplugin("knlmeanscl.dll")
src=avisource("noisysample1.avi").separatefields().converttoyv12()
d=src.DGDenoise(strength=0.15).weave.subtitle("DG")
k=src.knlmeanscl(h=4.0).weave.subtitle("K")
stackhorizontal(k,d)

If you disagree, please show it with screenshots.

Coming to performance, now we have to use comparable parameters, i.e., we don't want to unfairly disadvantage KNLMeansCL by using settings that slow it down. For example, DGDenoise implements only d=0. Here is the script I use:

loadplugin("dgdecodenv.dll")
loadplugin("dgdenoise.dll")
loadplugin("knlmeanscl.dll")
dgsource("rat.dgi").assumefps(10000)
DGDenoise(strength=0.5)
#knlmeanscl(h=4.0)

Note that I use 64-bit everything. Ignore the 10000 frame rate. I do that for playing in VirtualDub. I use a 1050 Ti with i7-4770. Following are the respective results.

-------------------------------------------------------------------------------------
KNLmeansCL

Number of frames: 839
Length (hh:mm:ss.ms): 00:00:00.084
Frame width: 1920
Frame height: 1080
Framerate: 10000.000 (10000/1)
Colorspace: YV12

Frames processed: 839 (0 - 838)
FPS (min | max | average): 6.272 | 15.78 | 15.46
Memory usage (phys | virt): 190 | 303 MiB
Thread count: 21
CPU usage (average): 12%

Time (elapsed): 00:00:54.275

-------------------------------------------------------------------------------------
DGDenoise

Number of frames: 839
Length (hh:mm:ss.ms): 00:00:00.084
Frame width: 1920
Frame height: 1080
Framerate: 10000.000 (10000/1)
Colorspace: YV12

Frames processed: 839 (0 - 838)
FPS (min | max | average): 19.35 | 24.10 | 23.74
Memory usage (phys | virt): 225 | 314 MiB
Thread count: 17
CPU usage (average): 12%

Time (elapsed): 00:00:35.339

And here my results for noisysample1 (without the KNLM comparison). BTW, it's better to use longer clips for performance testing.

-------------------------------------------------------------------------------------
DGDenoise

Number of frames: 93
Length (hh:mm:ss.ms): 00:00:03.720
Frame width: 720
Frame height: 576
Framerate: 25.000 (25/1)
Colorspace: YV12

Frames processed: 93 (0 - 92)
FPS (min | max | average): 39.11 | 42.78 | 41.53
Memory usage (phys | virt): 133 | 126 MiB
Thread count: 14
CPU usage (average): 12%

Time (elapsed): 00:00:02.240

Bottom line: I cannot reproduce your reported results, either for quality or for speed. So if speed was more important than possible gains from using slower KNLMeansCL parameters, then DGDenoise is to be preferred. If you must have the slower settings, then KNLMeansCL is to be preferred. I would be very interested to see cases where those settings really help very much.
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: About DGDenoise

Post by Sharc »

admin wrote:First, if you want to compare the quality and performance you have to use comparable parameters. But even with the ones you
chose (that favor KNLMeansCL) I see no detail loss or any significant differences with this script:

loadplugin("dgdenoise.dll")
loadplugin("knlmeanscl.dll")
src=avisource("noisysample1.avi").separatefields().converttoyv12()
d=src.DGDenoise(strength=0.15).weave.subtitle("DG")
k=src.knlmeanscl(h=4.0).weave.subtitle("K")
stackhorizontal(k,d)

If you disagree, please show it with screenshots.
I don't disagree at all. That's exactly why I choose strength=0.15 (and h=4.0 for KNLMeanCL) in my test, to obtain similar denoising results for both filters.
What I was saying is that when I set strength > 0.2 it begins to blur/loose details for my clip. I wrote this just because in your example (portrait) and documentation you set strength=0.5 (default?) which would be too high for my test clip, I felt. Don't you agree?

Edit:
Now I am confused by the first line of your script loadplugin("dgdenoise.dll"). Do I still need a dgdenoise.dll, or should this be dgdecodeNV.dll ? :?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Ah, I see now. Strength 0.5 is too much for typical clips. That's a good point. The default is actually 0.0, so that denoising is off by default. I was using 0.5 for the portrait_noise clip, which needs very strong denoising. I will change the example in the doc to 0.15. Thank you.

Of course, high values of h will do the same for KNLMeansCL. BTW, strength and h are not defined the same way and do not scale the same way. You just have to choose your strength and h empirically.

Do you have any ideas about our discrepant performance results?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Sharc wrote:Now I am confused by the first line of your script loadplugin("dgdenoise.dll"). Do I still need a dgdenoise.dll, or should this be dgdecodeNV.dll?
That was my mistake. DGDenoise() is available in DGDecodeNV.dll. I will edit it. Well spotted and thanks for pointing it out.

(I had it as a stand-alone filter before I put it into DGDecodeNV.dll.)
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: About DGDenoise

Post by Sharc »

admin wrote: Do you have any ideas about our discrepant performance results?
No, not yet. I will repeat the test after the current job has finished. I'll report back.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: About DGDenoise

Post by admin »

Sweet, thank you.
Post Reply