View Full Version : KNLMeansCL: OpenCL NLMeans de-noising algorithm [2018-01-29]
Khanattila
30th April 2015, 22:13
I'm getting an error with this version:
[build_programm (CL_BUILD_PROGRAM_FAILURE)]
Also, a text file ("KNLMeansCL.txt") is created with this content:
"error: macro 'V_BLOCK_Y' contains embedded newline, text after the newline is ignored."
thanks
Khanattila
1st May 2015, 17:19
Microsoft... sprintf_s... pfff.
Groucho2004
1st May 2015, 18:27
Microsoft... sprintf_s... pfff.
KNLMeansCL_v.0.5_Beta4.dll (http://www.mediafire.com/download/6ex3mkibc97xnai/KNLMeansCL_v.0.5_Beta4.dll)
Thanks, this one works.
Khanattila
1st May 2015, 21:08
Thanks, this one works.
Some performance increment?
Groucho2004
1st May 2015, 21:33
Some performance increment?
Yes, it's about 20-25% faster.
jones1913
2nd May 2015, 12:54
An AMD Result:
[Graphics card info]
Card name: AMD Radeon R9 200 Series
GPU name: Pitcairn
Memory size: 2048
OpenCL version: OpenCL 1.2 AMD-APP (1642.5)
Driver version: atiumdag 14.501.1003.1001 (Catalyst 14.12 AMD Catalyst Omega Software) / Win7 64
colorbars(width = 720, height = 480, pixel_type = "yv12").killaudio().assumefps(24000, 1001)
trim(0,99)
fadeio(48)
trim(0,99)
KNLMeansCL(0, x, 1) #x = 2, 3, 5
R9 270X: 52.45 / 44.02 / 35.65
Log with x=5:
Frames processed: 100 (0 - 99)
FPS (min | max | average): 29.55 | 39.07 | 35.65
Memory usage (phys | virt): 51 | 60 MB
Thread count: 16
CPU usage (average): 10%
GPU usage (average): 28%
GPU memory usage: 2008087026 MB
Time (elapsed): 00:00:02.805
the other script:
colorbars(width = 1280, height = 720, pixel_type = "yv12").killaudio().assumefps(24000, 1001)
trim(0,99)
fadeio(48)
trim(0,99)
KNLMeansCL(D = 1)
Frames processed: 100 (0 - 99)
FPS (min | max | average): 5.578 | 7.770 | 6.694
Memory usage (phys | virt): 56 | 64 MB
Thread count: 16
CPU usage (average): 4%
GPU usage (average): 61%
GPU memory usage: 2008087026 MB
Time (elapsed): 00:00:14.939
Khanattila
2nd May 2015, 15:03
Frames processed: 100 (0 - 99)
FPS (min | max | average): 29.55 | 39.07 | 35.65
Memory usage (phys | virt): 51 | 60 MB
Thread count: 16
CPU usage (average): 10%
GPU usage (average): 28%
GPU memory usage: 2008087026 MB
Time (elapsed): 00:00:02.805
2008087026 MB! Possible gpu-z bug?
Groucho2004
2nd May 2015, 16:53
2008087026 MB! Possible gpu-z bug?
I'm pretty sure it's an AVSMeter bug. I only have NVIDIA cards for testing. AMD cards apparently provide 2 different memory readings (Dedicated/Dynamic) which are not captured by AVSMeter.
I'll make a debug build that logs all readings from GPU-Z so I can fix that.
@jones1913
I sent you a PM.
Khanattila
4th May 2015, 15:43
May the 4th Be With You
>>>> KNLMeansCL_v0.5.0.zip <<<< (http://www.mediafire.com/download/frid3w9xpsvxg2q/KNLMeansCL_v0.5.0.zip)
ChangeLog
v0.5.0 (2015-05-04)
- New: Temporal windows search.
- New: Cauchy weighting function.
- New: Bisquare weighting function.
- Changed: now process always luminace (y).
- Changed: Euclidean distance.
- Changed: sse argument, replaced by wmode.
- Removed: u and v arguments.
- Removed: Ay and Sy.
- Removed: patchwise implementation.
- Removed: aa argument.
- Removed: legacy kernel.
- Updated: NVIDIA CUDA Toolkit v7.0.
- Updated: AVS 2.6.0 RC 3 [150419].
Khanattila :thanks: for update!
My source is VHS capture and I need filtering also chroma planes.
Please check code:
SetMemoryMax(3072)
SetmtMode(3,4)
AVISource("samplevhs.avi")
SetmtMode(2,4)
AssumeTFF()
ConvertToYV16(interlaced=true)
SeparateFields()
#NLMeansCL2(y=3, u=3, v=3,device_type="GPU")
u=UToY8()
v=VToY8()
Yf=KNLMeansCL(device_type="GPU")
uf=u.KNLMeansCL(device_type="GPU")
vf=v.KNLMeansCL(device_type="GPU")
YToUV (uf, vf, Yf)
Weave()
If code O'k I see 100% speed up for Intel HD built Graphics.
yup.
Groucho2004
5th May 2015, 10:20
2008087026 MB! Possible gpu-z bug?
@jones1913
Could you please run your tests again with the latest (2.0.1) version of AVSMeter?
Khanattila
5th May 2015, 10:46
Khanattila :thanks: for update!
My source is VHS capture and I need filtering also chroma planes.
Please check code:
SetMemoryMax(3072)
SetmtMode(3,4)
AVISource("samplevhs.avi")
SetmtMode(2,4)
AssumeTFF()
ConvertToYV16(interlaced=true)
SeparateFields()
#NLMeansCL2(y=3, u=3, v=3,device_type="GPU")
u=UToY8()
v=VToY8()
Yf=KNLMeansCL(device_type="GPU")
uf=u.KNLMeansCL(device_type="GPU")
vf=v.KNLMeansCL(device_type="GPU")
YToUV (uf, vf, Yf)
Weave()
If code O'k I see 100% speed up for Intel HD built Graphics.
yup.
OpenCL provides parallel computing using task-based and data-based parallelism (cit.). So, not real benefit of use MT...
Anyway, the code is correct. Set A and h according to the noise.
More compact...
Y=KNLMeansCL(device_type="GPU")
U=UToY8().KNLMeansCL(device_type="GPU")
V=VToY8().KNLMeansCL(device_type="GPU")
YToUV (U, V, Y)
Mounir
5th May 2015, 11:05
I got syntax error using this: KNLMeansCL (D(0),A(2),S(4),wmode(1), h(1.2,))
These are default values,strange
using this i get "plugin was designed for a later v. of avisynth" (i got the 2.6MT)
Y=KNLMeansCL(device_type="GPU")
U=UToY8().KNLMeansCL(device_type="GPU")
V=VToY8().KNLMeansCL(device_type="GPU")
YToUV (U, V, Y)
Groucho2004
5th May 2015, 11:11
ChangeLog
v0.5.0 (2015-05-04)
- New: Temporal windows search.
- New: Cauchy weighting function.
- New: Bisquare weighting function.
- Changed: now process always luminace (y).
- Changed: Euclidean distance.
- Changed: sse argument, replaced by wmode.
- Removed: u and v arguments.
- Removed: Ay and Sy.
- Removed: patchwise implementation.
- Removed: aa argument.
- Removed: legacy kernel.
- Updated: NVIDIA CUDA Toolkit v7.0.
- Updated: AVS 2.6.0 RC 3 [150419].
Thanks for the new version. I made a short script for testing that actually has some noise (you'll need AddGrainC (http://ldesoras.free.fr/src/avs/AddGrainC-1.7.0.7z)):
colorbars(width = 1920, height = 1080, pixel_type = "yv12").killaudio().assumefps(24000, 1001).trim(0,499)
AddGrainC(var = 100.0)
KNLMeansCL(D = 2, A = 1, h = 5.0)
My results:
[Graphics card info]
Card name: NVIDIA GeForce GT 240
GPU name: GT215
Memory size: 512
OpenCL version: OpenCL 1.0 CUDA
Driver version: 6.14.13.4052 (ForceWare 340.52) / XP
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 4.068 | 4.243 | 4.223
Memory usage (phys | virt): 141 | 139 MB
Thread count: 8
CPU usage (average): 25%
GPU usage (average): 97%
Video engine load (average): 0%
GPU memory usage: 92 MB
Time (elapsed): 00:01:58.399
Could you run this with your GTX760?
Khanattila
5th May 2015, 14:13
[Graphics card info]
Card name: NVIDIA GeForce GTX 760
GPU name: GK104
Memory size: 2048
OpenCL version: OpenCL 1.2 CUDA
Driver version: 9.18.13.5012 WHQL (ForceWare 350.12) / Win8.1 64
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 13.99 | 19.48 | 19.22
Memory usage (phys | virt): 165 | 180 MB
Thread count: 8
CPU usage (average): 25%
GPU usage (average): 90%
Video engine load (average): 0%
GPU memory usage: 307 MB
Time (elapsed): 00:00:26.013
Quite normal...
Iterations:= ((2*A+1)^2*(2*D+1)-1 / (D ? 1 : 2) = 44.
Khanattila
5th May 2015, 14:14
I got syntax error using this: KNLMeansCL (D(0),A(2),S(4),wmode(1), h(1.2,))
These are default values,strange
using this i get "plugin was designed for a later v. of avisynth" (i got the 2.6MT)
Y=KNLMeansCL(device_type="GPU")
U=UToY8().KNLMeansCL(device_type="GPU")
V=VToY8().KNLMeansCL(device_type="GPU")
YToUV (U, V, Y)
Probably the MT interface is out of date...
Correct syntax: KNLMeansCL(D=0,A=2,S=4,wmode=1, h=1.2).
Rumbah
5th May 2015, 14:58
Here the result with my GTX 970:
[General info]
Log file created with: AVSMeter 2.0.1 (x86)
Avisynth version: AviSynth 2.60, build:Mar 31 2015 [16:38:54] (2.6.0.6)
Avisynth DLL location: C:\Windows\SysWOW64\avisynth.dll
Plugin directory: C:\Program Files (x86)\AviSynth 2.5\plugins
[Clip info]
Number of frames: 500
Length (hh:mm:ss.ms): 00:00:20.854
Frame width: 1920
Frame height: 1080
Framerate: 23.976 (24000/1001)
Colorspace: YV12
Audio channels: n/a
Audio bits/sample: n/a
Audio sample rate: n/a
Audio samples: n/a
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 22.71 | 26.87 | 26.34
Memory usage (phys | virt): 191 | 196 MB
Thread count: 8
CPU usage (average): 12%
GPU usage (average): 89%
Video engine load (average): 0%
GPU memory usage: 568 MB
Time (elapsed): 00:00:18.984
[Script]
colorbars(width = 1920, height = 1080, pixel_type = "yv12").killaudio().assumefps(24000, 1001).trim(0,499)
AddGrainC(var = 100.0)
KNLMeansCL(D = 2, A = 1, h = 5.0)
[Graphics card info]
Card name: NVIDIA GeForce GTX 970
GPU name: GM204
Memory size: 4096
OpenCL version: OpenCL 1.2 CUDA
Driver version: 9.18.13.5012 WHQL (ForceWare 350.12) / Win8.1 64
Sparktank
6th May 2015, 01:33
Thanks for the update!
So I decided to give this a test.
I did not think to check the "info" argument to ensure it's using NVidia over Intel.
Alas after some sleep, I remembered to enable info argument.
Intel was being used and slowed the process significantly.
I should uninstall the Intel OpenCL as I don't believe anything really uses it or could benefit from using it when I have Nvidia.
The odd thing, however, is that I haven't installed any Intel OpenCL for a long time.
The very last/recent OpenCL driver I installed was the Nvidia driver update.
And I ensured it was a "clean install" for everything.
Just because I actually did a whole test run with the Intel OpenCL... (please print, laminate and enjoy this deprecated data)
[General info]
Log file created with: AVSMeter 2.0.1 (x86)
Avisynth version: AviSynth 2.60, build:Mar 31 2015 [16:38:54] (2.6.0.6)
Avisynth DLL location: C:\Windows\SysWOW64\avisynth.dll
Plugin directory: C:\Program Files (x86)\AviSynth\plugins
[Graphics card info]
# kind of useless as it doesn't stipulate the Intel info.
## Avsmeter only reported Nvidia while the script was actually using Intel.
### Taken from CPU-Z
Processor 1 ID = 0
Number of cores 4 (max 8)
Number of threads 4 (max 16)
Name Intel Core i5 2320
Codename Sandy Bridge
Specification Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz
Package (platform ID) Socket 1155 LGA (0x1)
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 1.002 | 1.053 | 1.049
Memory usage (phys | virt): 231 | 214 MB
Thread count: 4
CPU usage (average): 99%
GPU usage (average): 0%
Video engine load (average): 0%
GPU memory usage: 58 MB
Time (elapsed): 00:07:56.864
in Internet Time, that's like a whole day gone...
Now with device_type="GPU":
[General info]
Log file created with: AVSMeter 2.0.1 (x86)
Avisynth version: AviSynth 2.60, build:Mar 31 2015 [16:38:54] (2.6.0.6)
Avisynth DLL location: C:\Windows\SysWOW64\avisynth.dll
Plugin directory: C:\Program Files (x86)\AviSynth\plugins
[Graphics card info]
Card name: NVIDIA GeForce GTX 750 Ti
GPU name: GM107
Memory size: 2048
OpenCL version: OpenCL 1.2 CUDA
Driver version: 9.18.13.5012 (ForceWare 350.12) / Win7 64
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 11.79 | 13.00 | 12.75
Memory usage (phys | virt): 188 | 194 MB
Thread count: 8
CPU usage (average): 25%
GPU usage (average): 92%
Video engine load (average): 0%
GPU memory usage: 131 MB
Time (elapsed): 00:00:39.203
FTR, when I didn't know I was using Intel, I tried 2605_MT, 2606_ICL, and then 2606_(vanilla).
All Intel runs would have been similar in runtime (~8min). I aborted after 100 frames as I knew something was wrong.
The printed results above for Intel was the 4th run and I decided to let it finish for posterity.
Next time I'll be quicker on the coffee. :cool:
Khanattila
6th May 2015, 11:59
Each platform is independent each-other. Intel does not affect Nvidia etc.
I worked thinking about how the GPU memory work.
Cpu side will be as fast as TNLMeans, maybe.
Anacletus
9th May 2015, 15:21
Hi Khanatilla,
maybe i'm doing something wrong but i cannot load the plugin in avisynth+.
Do i need to use classic avisynth?
tks
anac
Groucho2004
9th May 2015, 16:06
i cannot load the plugin in avisynth+
You'll have to elaborate on that a bit in order to get help.
- Post the full script.
- What do you use to load the script?
- Any error message?
BTW, the plugin works fine with AVS+.
Reel.Deel
9th May 2015, 17:51
i cannot load the plugin in avisynth+.
Are you using AviSynth r1576? if so update to r1825 (manual install (http://forum.doom9.org/showpost.php?p=1719768&postcount=1082) /// installer (http://forum.doom9.org/showpost.php?p=1719796&postcount=86)).
Khanattila
11th May 2015, 15:12
VapourSynth version...
http://www.mediafire.com/download/elci6dh5n8yyj2h/VS_KNLMeansCL.7z
feisty2
11th May 2015, 15:44
how about bringing "aa" parameter back to KNLMeansCL, I need it for artifacts removing
Khanattila
11th May 2015, 20:28
how about bringing "aa" parameter back to KNLMeansCL, I need it for artifacts removing
Removed. You may think that it is a big number.
Why removed? Useless.
Anacletus
11th May 2015, 20:57
You'll have to elaborate on that a bit in order to get help.
- Post the full script.
- What do you use to load the script?
- Any error message?
BTW, the plugin works fine with AVS+.
Sorry for the late reply, anyway this is my avisynth env:
[General Info - Avisynth.dll]
Version String: AviSynth+ 0.1 (r1576, x86)
File Version: 2.6.0.5
Directory: C:\Windows\system32
Timestamp: January 02, 2014, 19:14:26
MT Support: No
The script was really basic, just the source filter and this one. I simply receive this error:
Script error: There is no function named 'KNLMeansCL'.
I tried autoloading the plugin (as i usually do) and esplicitely invoking it by LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\KNLMeansCL.dll"). With the latter i get this exit code:
Cannot load file'C:/Program Files (x86)/AviSynth+/plugins/KNLMeansCL.dll'
Anyway:
Are you using AviSynth r1576? if so update to r1825 (manual install (http://forum.doom9.org/showpost.php?p=1719768&postcount=1082) /// installer (http://forum.doom9.org/showpost.php?p=1719796&postcount=86)).
That fixed everything, thanks both :)
Groucho2004
11th May 2015, 22:08
Sorry for the late reply, anyway this is my avisynth env:
[General Info - Avisynth.dll]
Version String: AviSynth+ 0.1 (r1576, x86)
File Version: 2.6.0.5
Directory: C:\Windows\system32
Timestamp: January 02, 2014, 19:14:26
MT Support: No
The script was really basic, just the source filter and this one. I simply receive this error:
Script error: There is no function named 'KNLMeansCL'.
This is odd. "CheckVersion(6)" is in the constructor and the plugin should therefore throw an error "Plugin was designed for a later version of Avisynth (6)" which it does in my test with r1576 and KNLMeansCL 0.5.
Wilbert
11th May 2015, 22:24
This is odd. "CheckVersion(6)" is in the constructor and the plugin should therefore throw an error "Plugin was designed for a later version of Avisynth (6)" which it does in my test with r1576 and KNLMeansCL 0.5.
He gets the message "There is no function named 'KNLMeansCL'.", so i think the process didn't get that far ...
Groucho2004
11th May 2015, 23:17
He gets the message "There is no function named 'KNLMeansCL'.", so i think the process didn't get that far ...
But why does it throw the expected error in my test?
feisty2
12th May 2015, 04:59
Removed. You may think that it is a big number.
Why removed? Useless.
Okay, then, if I'm understanding this correctly, with the same "h" you got the same overall denoise strength, and "aa" is some parameter about weighting, under the same "h", greater "aa" would give larger weights to dissimilar blocks and that's exactly what I need, cuz artifacts are obviously "dissimilar blocks", I need to keep "h" reasonable so it won't over denoise that much and a large "aa" to kick artifacts out from the image
Hi Khanattila!
See my info
https://www.dropbox.com/s/6rve2jah62d4ye4/report.png?dl=0
Why my device do not support OpenCL 1.2?
Platform support 1.2.
At first post link for Nvidia driver do not work.
yup.
Khanattila
12th May 2015, 18:14
Okay, then, if I'm understanding this correctly, with the same "h" you got the same overall denoise strength, and "aa" is some parameter about weighting, under the same "h", greater "aa" would give larger weights to dissimilar blocks and that's exactly what I need, cuz artifacts are obviously "dissimilar blocks", I need to keep "h" reasonable so it won't over denoise that much and a large "aa" to kick artifacts out from the image
The similarity between two pixels i and j depends on the similarity between the neighbourhoods "S" centered at positions i and j.
This similarity is measured as a decreasing function of the weighted Euclidean distance: |v(Ni) - v(Nj)|^2, 2aa,
where "aa" > 0 is the standard deviation of the Gaussian kernel.
In the latest version I replaced it with a simple Euclidean distance because it not give real benefits... so "aa" is not more needed.
EDIT.
"h" controls the decay of the exponential function and therefore the decay of the weights as a function of the Euclidean distances.
Khanattila
12th May 2015, 18:18
Hi Khanattila!
See my info
https://www.dropbox.com/s/6rve2jah62d4ye4/report.png?dl=0
Why my device do not support OpenCL 1.2?
Platform support 1.2.
At first post link for Nvidia driver do not work.
yup.
It is correct. OpenCL has specific hardware requirements.
GPU code is compiled each time you start the plugin so the platform can be made compatible with older devices.
Wilbert
12th May 2015, 20:38
He gets the message "There is no function named 'KNLMeansCL'.", so i think the process didn't get that far ...
But why does it throw the expected error in my test?
In your case the plugin is loaded and in his case apparently not.
@Anacletus, in which autoloading plugin folder did you put this plugin (when you got the error above)? When happing if you call a different plugin from the same folder?
Groucho2004
12th May 2015, 21:19
In your case the plugin is loaded and in his case apparently not.
One scenario I can think of is that the newly installed version of AVS+ also installed the up to date version of the MS runtime DLLs which are also needed by KNLMeansCL.
Anacletus
21st May 2015, 09:36
@Anacletus, in which autoloading plugin folder did you put this plugin (when you got the error above)? When happing if you call a different plugin from the same folder?
The plugin is stored in this folder: C:\Program Files (x86)\AviSynth+\plugins, as evry other standard (non avs+) plugin. Of course all the other plugins autoload correctly.
As i said in my previous post, seems like the stable version of avisynth+ was the problem, intslling the version suggested by Reel.Deel solved this weird issue. :cool:
Khanattila
24th May 2015, 16:53
>>>> KNLMeansCL_v0.5.1.zip <<<< (http://www.mediafire.com/download/ndsl4x6zphb119f/KNLMeansCL_v0.5.1.zip)
ChangeLog
v0.5.1 (2015-05-24)
- Changed: merged VapourSynth branch.
- Updated: Boost 1.58.0
Finished.
Reel.Deel
25th May 2015, 12:55
Thank you for the 64-bit version! Just tried it with AviSynth+ :cool:
I noticed that the u/v parameters are no more and only the luma channel gets processed :(. Why is that? I sometimes process the chroma channels with different settings depending on the noise on that particular channel and the u/v parameters came in handy for that. No worries though, I'll write my own little function to accomplish just that.
Khanattila
25th May 2015, 15:05
Thank you for the 64-bit version! Just tried it with AviSynth+ :cool:
I noticed that the u/v parameters are no more and only the luma channel gets processed :(. Why is that? I sometimes process the chroma channels with different settings depending on the noise on that particular channel and the u/v parameters came in handy for that. No worries though, I'll write my own little function to accomplish just that.
YUV do not exist for OpenCL. Only LUMINACE/INTENSITY or RGBA.
So YUV was treated as three different LUMINANCE/INTENSITY.
Call three times KNLMeansCL give you the same performance.
However, you have problems with AVS + 64bit?
Reel.Deel
25th May 2015, 15:16
YUV do not exist for OpenCL. Only LUMINACE/INTENSITY or RGBA.
So YUV was treated as three different LUMINANCE/INTENSITY.
Call three times KNLMeansCL give you the same performance.
However, you have problems with AVS + 64bit?
Thanks for the info, I'll probably make a little function and post it here since it might be useful for other people also.
Regarding 64-bit avs+, it's working fine but I haven't test it thoroughly yet but if I encounter any problems I'll report back.
Khanattila
25th May 2015, 15:26
Thanks for the info, I'll probably make a little function and post it here since it might be useful for other people also.
Regarding 64-bit avs+, it's working fine but I haven't test it thoroughly yet but if I encounter any problems I'll report back.
function KNLMeansCLYUV(clip c, int "Dy", int "Ay", int "Sy", int "wmodey", float "hy", int "Dc", int "Ac", int "Sc", int "wmodec", float "hc", string "device_type", bool "lsb_inout", bool "info") {
Dc = Default(Dc, 0)
Ac = Default(Ac, 2)
Sc = Default(Sc, 4)
wmodec = Default(wmodec, 1)
hc = Default(hc, 1.2)
y = KNLMeansCL(c, Dy, Ay, Sy, wmodey, hy, device_type, lsb_inout, info)
u = UtoY8(c).KNLMeansCL(Dc, Ac, Sc, wmodec, hc, device_type, lsb_inout)
v = VToY8(c).KNLMeansCL(Dc, Ac, Sc, wmodec, hc, device_type, lsb_inout)
YToUV(u, v, y)
}
Horrible.
Reel.Deel
25th May 2015, 15:32
Yeah, with all those parameters is not very elegant but it's usable and serves a purpose, thanks Khanattila.
Khanattila
26th May 2015, 15:33
>>>> KNLMeansCL_v0.5.2.zip <<<< (http://www.mediafire.com/download/ce8c5zcime9plzo/KNLMeansCL_v0.5.2.zip)
ChangeLog
v0.5.2 (2015-05-24)
- Changed: AVS+ header
- Changed: Removed Boost Library
- Fixed: VapourSynth memory leak.
feisty2
30th May 2015, 12:40
vaporsynth branch looks very wrong...
xxsource("whatever")
converttoy8 ()
KNLMeansCL (a=2,s=0,h=24)
http://i.imgur.com/ua5c8yg.png
import vapoursynth as vs
core = vs.get_core()
clp = whatever
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp = core.fmtc.bitdepth(clp, fulls=False, fulld=True, bits=32, flt=True)
nlm = core.knlm.KNLMeansCL (clp,a=2,s=0,h=24)
nlm.set_output ()
http://i.imgur.com/0cpqLCI.png
feisty2
31st May 2015, 14:01
did some tests, guess "d" "a" and "s" don't work in vaporsynth branch, you set them to any value, you always get the same result, only "h" and "wmode" work
Khanattila
31st May 2015, 14:47
did some tests, guess "d" "a" and "s" don't work in vaporsynth branch, you set them to any value, you always get the same result, only "h" and "wmode" work
Hi feisty2, thanks for your report. This is only a regression, settled quickly.
Try this for better accuracy with 32-bits, despite some hardware limitations...
>>>> KNLMeansCL_v0.5.3.zip <<<< (http://www.mediafire.com/download/7qj250uva3i99da/KNLMeansCL_v0.5.3.zip)
ChangeLog
v0.5.3 (2015-05-31)
- Changed: Better accuracy with 32-bits
- Fixed: VapourSynth regression (v0.5.2)
feisty2
31st May 2015, 15:19
vaporsynth branch works now, thx 4 ur work :)
noisyfart
4th June 2015, 10:58
Hi there, noob here.
How can I combine this nice filter with DitherTools? I want to resize and denoise 1080p (from BD) like this:
Dither_convert_8_to_16()
Dither_resize16nr(1280, 720)
KNLMeansCL(D = 2, A = 1, n = 1.5, lsb_inout = true)
DitherPost()
Or, alternatively, denoise before resizing:
Dither_convert_8_to_16()
KNLMeansCL(D = 2, A = 1, n = 1.5, lsb_inout = true)
Dither_resize16nr(1280, 720)
DitherPost()
I'm getting weird artifacts with these scripts. I'm sure i'm doing something fundamentally wrong. :o
noisyfart
5th June 2015, 11:26
The artefacts only appear when KNLMeansCL works in temporal mode (D > 0).
This script:
Dither_convert_8_to_16()
KNLMeansCL(D = 0, A = 3, h = 2.4, lsb_inout = true)
f3kdb(sample_mode = 2, keep_tv_range = true, input_mode = 1, output_mode = 1)
DitherPost(mode = 6)
looks fine:
http://s15.postimg.org/nq917w3ln/spatial.png
With these KNLMeansCL parameters:
D = 2, A = 1, h = 3.4
it looks like this:
http://s28.postimg.org/jy2nrcxa5/temporal.png
Khanattila
6th June 2015, 14:30
Hi there, noob here.
How can I combine this nice filter with DitherTools? I want to resize and denoise 1080p (from BD) like this:
Dither_convert_8_to_16()
Dither_resize16nr(1280, 720)
KNLMeansCL(D = 2, A = 1, n = 1.5, lsb_inout = true)
DitherPost()
Or, alternatively, denoise before resizing:
Dither_convert_8_to_16()
KNLMeansCL(D = 2, A = 1, n = 1.5, lsb_inout = true)
Dither_resize16nr(1280, 720)
DitherPost()
I'm getting weird artifacts with these scripts. I'm sure i'm doing something fundamentally wrong. :o
Both solutions work. It really depends on the content.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.