Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th November 2014, 15:39   #1  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
KNLMeansCL: OpenCL NLMeans de-noising algorithm [2017-05-04]

https://github.com/Khanattila/KNLMea...ses/tag/v1.1.0
Code:
KNLMeansCL v1.1.0
* Added AviSynth MT support (MT_MULTI_INSTANCE).
* Added AviSynth+'s high bit depth support.
* Replaced 'lsb_inout' with 'stacked'.
* Info now display 'Bits per sample'.
KNLMeansCL is an optimized OpenCL implementation of the Non-local means de-noising algorithm. The NLMeans filter, originally proposed by Buades et al., is a very popular filter for the removal of white Gaussian noise, due to its simplicity and excellent performance. The strength of this algorithm is to exploit the repetitive character of the image in order to de-noise the image unlike conventional de-noising algorithms, which typically operate in a local neighbourhood.

For end user KNLMeansCL is a plugin for AviSynth, AviSynth+ and for VapourSynth. Windows, OS X and Linux are supported. Read more on the Wiki.

KNLMeansCL is available under the GNU GPL v3 license. All development is done in my free time, but if you find it useful as a home user or in your business, then please consider contributing, will promote further development of this project. Companies, who are looking for a commercial license which is less restrictive than the GPL v3, please contact me by writing to my site.

FAQ
Q) I can't make DGNV and KNLmeansCL work together in avs script.
A) Post #664.
__________________
https://github.com/Khanattila

Last edited by Khanattila; 4th May 2017 at 17:49.
Khanattila is offline   Reply With Quote
Old 13th November 2014, 16:19   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Posts: 3,540
Works right out of the box (well, apart from the obligatory MS*120.dlls) unlike the original NLMeansCL which I never got to work properly. Seems very fast as well, even on my lowly GT240 card.

Awesome!
Groucho2004 is offline   Reply With Quote
Old 13th November 2014, 16:31   #3  |  Link
Groucho2004
 
Join Date: Mar 2006
Posts: 3,540
Quote:
Originally Posted by Khanattila View Post
Code:
NLMeansCL(clip src, int A, int Ay, int S, int Sy, int B, int By, float aa, float h, bool sse, string device_type, int y, int u, int v, bool info)
That should read "NLMeansCL2".
Groucho2004 is offline   Reply With Quote
Old 13th November 2014, 16:34   #4  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
Quote:
Originally Posted by Groucho2004 View Post
That should read "NLMeansCL2".
thanks
Khanattila is offline   Reply With Quote
Old 15th November 2014, 22:52   #5  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
Edit.

Last edited by Khanattila; 6th May 2016 at 15:42.
Khanattila is offline   Reply With Quote
Old 15th November 2014, 23:12   #6  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,079
Thanks Khanattila, very nice indeed. Briefly tested it on my GTX780 and it's pretty fast. What source filter did you use for the benchmark? Also, any interest in showing some love to Y8?
Reel.Deel is offline   Reply With Quote
Old 16th November 2014, 00:20   #7  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
Quote:
Originally Posted by Reel.Deel View Post
Thanks Khanattila, very nice indeed. Briefly tested it on my GTX780 and it's pretty fast. What source filter did you use for the benchmark? Also, any interest in showing some love to Y8?
Y8 support? It's easy, I will add in the next release.
For benchmark... I use AVSMeter.
To get a clean result, you should subtract the time of ffms2 & co.

Example:
ffms2 + Dither_convert_8_to_16() -> 326.4 FPS -> 3.0637 ms for frame.
ffms2 + Dither + NLMeansCL2() -> 60.46 FPS -> 16.5399 ms for frame

So NLMeansCL2() take 13.4762 ms for frame -> 74.2 FPS
Khanattila is offline   Reply With Quote
Old 16th November 2014, 17:09   #8  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,079
Quote:
Originally Posted by Khanattila View Post
Y8 support? It's easy, I will add in the next release.
Y8 support would be great

Quote:
Originally Posted by Khanattila View Post
YUY2 is packed.
NLMeansCL2() with YUY2 support have the same performance of ConvertToYUY2().NLMeansCL2()
Shouldn't it be ConvertToYV16().NLMeansCL2()?

Edit:
Might be worth mentioning that NLMeansCL2 already supports YV16/YV24.
Reel.Deel is offline   Reply With Quote
Old 16th November 2014, 18:36   #9  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
Quote:
Originally Posted by Reel.Deel View Post
Y8 support would be great



Shouldn't it be ConvertToYV16().NLMeansCL2()?

Edit:
Might be worth mentioning that NLMeansCL2 already supports YV16/YV24.
yes in both cases
Khanattila is offline   Reply With Quote
Old 15th November 2014, 23:14   #10  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 695
Still no support of YUY2 ? What about temporal denoising ??
Mounir is offline   Reply With Quote
Old 15th November 2014, 23:17   #11  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,079
Quote:
Originally Posted by Mounir View Post
Still no support of YUY2?
Use the planar equivalent YV16 instead.
Reel.Deel is offline   Reply With Quote
Old 15th November 2014, 23:56   #12  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 974
why would you ever want yuy2 support
TheFluff is offline   Reply With Quote
Old 16th November 2014, 03:10   #13  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,060
gorgeous
add temporal mode maybe?
feisty2 is offline   Reply With Quote
Old 16th November 2014, 06:03   #14  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 319
Testing on an ancient 9800 GT I didn't expect much, but it turns out that it still works!
Unless you set U=3,V=3 or the input isn't YV24. (although it works fine with YV12 if the UV channels aren't set to be processed) :v
or if you set the A value too high (a >= 10)

Last edited by Bloax; 16th November 2014 at 06:09.
Bloax is offline   Reply With Quote
Old 16th November 2014, 12:42   #15  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
Edit.

Last edited by Khanattila; 6th May 2016 at 15:42.
Khanattila is offline   Reply With Quote
Old 16th November 2014, 15:19   #16  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 319
I can confirm that A >= 10 (output isn't buggy garbage even at a=21) works now, as does chroma processing.
Bloax is offline   Reply With Quote
Old 16th November 2014, 16:27   #17  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,567
Wow, one of my favorite filters reborn without these annoying dependencies! Haven't tried it but still nice!

As for temporal, I remember Malcolm gave up on it cause it didn't produced decent results and his recommendation was something like "Just use MVTools". That's why temporal thingy in his plugin is buggy, was never completed and v0.4 branch abandoned.
Keiyakusha is offline   Reply With Quote
Old 16th November 2014, 16:51   #18  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,060
az works nicely on tritical's original version, is it very hard to port it from cpp to opencl? sorry, i got little programming knowledge, dunno much about it
feisty2 is offline   Reply With Quote
Old 16th November 2014, 17:01   #19  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
Quote:
Originally Posted by Mounir View Post
Still no support of YUY2 ?
YUY2 is packed.
NLMeansCL2() with YUY2 support have the same performance of YUY2Clip.ConvertToYV16().NLMeansCL2()

Last edited by Khanattila; 16th November 2014 at 17:09.
Khanattila is offline   Reply With Quote
Old 16th November 2014, 21:20   #20  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 420
Edit.

Last edited by Khanattila; 6th May 2016 at 15:43.
Khanattila is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.