View Full Version : KNLMeansCL: OpenCL NLMeans de-noising algorithm [2018-01-29]
Khanattila
3rd August 2015, 23:01
I couldn't highlight the text from OpenCL/More OpenCL Information, so I couldn't copy it. Instead I went to Tools/Export data and copied the OpenCL Capabilities (http://pastebin.com/Nf5Ayv1N) section. I hope that's OK.
You might try to update the nvidia driver.
LouieChuckyMerry
4th August 2015, 06:51
Having updated to nVidia version 353.62, the newest as far as I can figure, I still receive the "KNLMeansCL: AviSynthCreate error (3)!" with either call. I'm basically clueless anyway, but I really don't understand why only one of two laptops with the same graphics combo and the same drivers can successfully run KNLMeansCL? Anyway, thanks again for your help Khanattila, I appreciate it :) .
MysteryX
5th August 2015, 18:41
I took a look at my GPU utilization with MSI Afterburner and this doesn't seem normal.
http://s3.postimg.org/xyntph6fj/Gpu_Usage.jpg (http://postimg.org/image/xyntph6fj/)
Running KNLMeans does have a considerable performance impact, but it shows almost no GPU usage. Why?
I'm using a dual-graphics. GPU1 is Radeon HD 7670M, GPU2 is Intel HD 4000
(btw, about which does better between KNLMeans and FF3DFilter, in most cases KNLMeans does much better, but I did find some cases where it leaves ugly noise and where FF3DFilter does a better job)
Khanattila
5th August 2015, 21:57
I took a look at my GPU utilization with MSI Afterburner and this doesn't seem normal.
http://s3.postimg.org/xyntph6fj/Gpu_Usage.jpg (http://postimg.org/image/xyntph6fj/)
Running KNLMeans does have a considerable performance impact, but it shows almost no GPU usage. Why?
I'm using a dual-graphics. GPU1 is Radeon HD 7670M, GPU2 is Intel HD 4000
(btw, about which does better between KNLMeans and FF3DFilter, in most cases KNLMeans does much better, but I did find some cases where it leaves ugly noise and where FF3DFilter does a better job)
Are you sure you are using 7670M? Check it with info = true.
However, if you look at the use of the GPU with x264 and other filters may be normal.
Because it might you are CPU-limited.
MysteryX
6th August 2015, 03:16
Are you sure you are using 7670M? Check it with info = true.
However, if you look at the use of the GPU with x264 and other filters may be normal.
Because it might you are CPU-limited.
I'm not sure whether it is using the Intel or Radeon. Either way, both are displayed in that graph.
Does KNLMeans use considerable CPU on top of the GPU? What kind of GPU usage should I be expecting?
Groucho2004
6th August 2015, 08:33
I'm not sure whether it is using the Intel or Radeon.
Which part of "check it with "info = true" don't you understand?
Does KNLMeans use considerable CPU on top of the GPU?
No.
What kind of GPU usage should I be expecting?
Since you don't understand what Khanattila wrote, let's have another go:
Filters that are very heavy on the CPU (eedi3 for example) and/or x264 with a slow(ish) preset largely determine the processing speed of your encoding chain. At such slow speeds, a fast filter is basically "bored" and if you single out its CPU (or GPU in case of KNLMeansCL) usage, it will be very low.
Imagine Donald Trump and Usain Bolt going for a run together. Who do you think will sweat less?
RazorBurn
6th August 2015, 09:15
Sorry for being too noob on Python and VS but whats the Vapoursynth version on this?
Y=KNLMeansCL(device_type="GPU")
U=UToY8().KNLMeansCL(device_type="GPU")
V=VToY8().KNLMeansCL(device_type="GPU")
YToUV (U, V, Y)
Thanks..
Are_
6th August 2015, 22:09
Something like:
y = core.std.ShufflePlanes(clip, planes=[0], colorfamily=vs.GRAY).knlm.KNLMeansCL(device_type="GPU")
u = core.std.ShufflePlanes(clip, planes=[1], colorfamily=vs.GRAY).knlm.KNLMeansCL(device_type="GPU")
v = core.std.ShufflePlanes(clip, planes=[2], colorfamily=vs.GRAY).knlm.KNLMeansCL(device_type="GPU")
clip = core.std.ShufflePlanes([y, u, v], planes=[0, 0, 0], colorfamily=vs.YUV)
MysteryX
7th August 2015, 01:35
Huh... it was using the CPU device by default! That explains.
http://s21.postimg.org/s2f9yyudv/Info.jpg (http://postimg.org/image/s2f9yyudv/)
By adding device_type="GPU", it performs MUCH faster. But even with a script that doesn't do any heavy operation besides KNLMeansCL with D=3, A=3, I still barely see any GPU usage in Afterburner while the video plays slowly.
Groucho2004
7th August 2015, 08:38
But even with a script that doesn't do any heavy operation besides KNLMeansCL with D=3, A=3, I still barely see any GPU usage in Afterburner while the video plays slowly.
By "playing slowly", I can only assume that you mean playing the script in a media player or some preview window.
That's how it should be, the player software requests frames according to the specified frame rate (and possibly some buffering in the background), not as fast as Avisynth could serve them.
If you want to test how fast Avisynth can serve the frames you'll have to use AVSMeter. It will also show you CPU/GPU usage under these conditions.
MysteryX
7th August 2015, 17:18
OK. Testing with AVSMeter.
With device_type="GPU" I get 32fps with a simple script @ 50% CPU usage, and without it, I get 11fps @ 100% CPU usage.
Yet, MSI Afterburner still doesn't show any GPU usage. Perhaps it doesn't detect and report it properly, is there a better software to use to measure GPU usage?
detmek
7th August 2015, 17:27
Try with GPU-Z (http://www.softpedia.com/get/System/System-Info/GPU-Z.shtml).
MysteryX
7th August 2015, 17:45
GPU-Z reports a 2% load on the Intel HD 4000... AVSMeter is rendering at 36fps
Increasing MT mode from 8 threads to 16 threads increases CPU usage and lowers performance to 22fps, with same 2% GPU usage.
Disabling MT results in 32fps with only 7% CPU usage, still 2% GPU usage.
It seems MT mode doesn't work well with KNLMeans, and that it's not making efficient use of the GPU.
Since MT provides no performance improvement whatsoever with KNLMeans, is there a way to disable MT only for that command? I'm using both AviSynth 2.6 and AviSynth+ so I'd need both syntaxes.
Khanattila
7th August 2015, 18:37
GPU-Z reports a 2% load on the Intel HD 4000... AVSMeter is rendering at 36fps
Increasing MT mode from 8 threads to 16 threads increases CPU usage and lowers performance to 22fps, with same 2% GPU usage.
Disabling MT results in 32fps with only 7% CPU usage, still 2% GPU usage.
It seems MT mode doesn't work well with KNLMeans, and that it's not making efficient use of the GPU.
Since MT provides no performance improvement whatsoever with KNLMeans, is there a way to disable MT only for that command? I'm using both AviSynth 2.6 and AviSynth+ so I'd need both syntaxes.
1) MT is not good program in general. Best avoided.
2) Are you sure you are using the AMD discrete and not the integrated GPU?
EDIT. If you want a technical explain, OpenCL provides parallel computing using task-based and data-based parallelism.
MT only creates unnecessary queues.
Khanattila
7th August 2015, 18:40
Huh... it was using the CPU device by default! That explains.
http://s21.postimg.org/s2f9yyudv/Info.jpg (http://postimg.org/image/s2f9yyudv/)
By adding device_type="GPU", it performs MUCH faster. But even with a script that doesn't do any heavy operation besides KNLMeansCL with D=3, A=3, I still barely see any GPU usage in Afterburner while the video plays slowly.
By default uses your default device OpenCL. More default so.
MysteryX
7th August 2015, 18:55
It is currently using the Intel integrated chipset (HD 4000), and perhaps there's no point in using the Radeon if it's under-utilizing it in such a way? I'll try with the Radeon and see if results are different.
Khanattila
7th August 2015, 19:04
It is currently using the Intel integrated chipset (HD 4000), and perhaps there's no point in using the Radeon if it's under-utilizing it in such a way? I'll try with the Radeon and see if results are different.
The fastest solution is to uninstall the Intel OpenCL driver.
EDIT. Or edit HKEY_LOCAL_MACHINE \ SOFTWARE \ Khronos \ OpenCL \ Vendors. More or less.
Groucho2004
7th August 2015, 21:25
OK. Testing with AVSMeter.
With device_type="GPU" I get 32fps with a simple script @ 50% CPU usage, and without it, I get 11fps @ 100% CPU usage.
What source? Post the full script. Apart from that, the result with device_type="GPU" looks pretty good compared to the other one. It's not only 3 times faster, it also reduces the CPU load significantly.
Yet, you somehow seem dissatisfied.
MysteryX
7th August 2015, 22:14
I tried running it on the Radeon, and can't get it to run on the Radeon. On a dual-graphics system, I set the application as "High Performance" for the Radeon or "Power Saving" for the Intel HD.
This time I'm getting 7-10% usage on the Intel HD 4000.
If I set AVSMeter.exe to run on High Performance, or on Power Saving, it's still running on the Intel HD 4000 either way with exactly the same performance. I tried changing it for cmd.exe, and that still doesn't switch it to the Radeon. With that low usage, it's not really an issue.
What makes more of a difference is the very high CPU usage when running in MT mode. I don't have any issues with MT so far; only this performance issue here. The output looks good, but is this plugin compatible with MT, or is there side-effects in terms of quality?
Here's the script, when running in MT mode. It gives 30-32fps no matter if it's High Performance or Power Saving, and with or without MT. The only difference is that without MT CPU usage is 7%, with MT it goes up to 50%. The rest of the script is very CPU intensive and requires MT.
Cores=8
SetMTMode(3,Cores)
AviSource("Preview.avi", audio=false, pixel_type="YV12")
SetMTMode(2)
ColorMatrix(mode="Rec.601->Rec.709")
Crop(0, 0, -10, -0)
KNLMeansCL(D=2, A=1, h=3, device_type="GPU")
Distributor()
Khanattila
7th August 2015, 23:29
I tried running it on the Radeon, and can't get it to run on the Radeon. On a dual-graphics system, I set the application as "High Performance" for the Radeon or "Power Saving" for the Intel HD.
This time I'm getting 7-10% usage on the Intel HD 4000.
If I set AVSMeter.exe to run on High Performance, or on Power Saving, it's still running on the Intel HD 4000 either way with exactly the same performance. I tried changing it for cmd.exe, and that still doesn't switch it to the Radeon. With that low usage, it's not really an issue.
What makes more of a difference is the very high CPU usage when running in MT mode. I don't have any issues with MT so far; only this performance issue here. The output looks good, but is this plugin compatible with MT, or is there side-effects in terms of quality?
Here's the script, when running in MT mode. It gives 30-32fps no matter if it's High Performance or Power Saving, and with or without MT. The only difference is that without MT CPU usage is 7%, with MT it goes up to 50%. The rest of the script is very CPU intensive and requires MT.
Cores=8
SetMTMode(3,Cores)
AviSource("Preview.avi", audio=false, pixel_type="YV12")
SetMTMode(2)
ColorMatrix(mode="Rec.601->Rec.709")
Crop(0, 0, -10, -0)
KNLMeansCL(D=2, A=1, h=3, device_type="GPU")
Distributor()
KNLMeansCL is not compatible with MT.
Why? Because it's written in OpenCL, as if it were already multithreaded.
In addition, the GPU works in a different way, it is not that simple.
Try uninstalling "OpenCL™ Driver for Intel® Iris™ and Intel® HD".
So it is forced to use only the AMD.
amayra
8th August 2015, 00:59
is this work with madVR ? :scared:
Reel.Deel
8th August 2015, 01:10
KNLMeansCL is not compatible with MT.
Why? Because it's written in OpenCL, as if it were already multithreaded.
In addition, the GPU works in a different way, it is not that simple.
SEt said this about nnedi3ocl:
...
MTMode to use: 2.
....
Major speed note 2.
The OpenCL code is quite optimized, but memory transfers are not. So, much time is lost there. Using high number of threads with MTMode 2 (even more than physical threads your CPU has) is the best workaround for now.
I guess the same does not apply to KNLMeans? Then again using a high number of threads would probably only be beneficial if you're just using strictly OpenCL (or GPU) plugins, I doubt it would work efficiently when you start mixing CPU and GPU filters in complex scripts.
---
Groucho2004: Imagine Donald Trump and Usain Bolt going for a run together. Who do you think will sweat less?
LOL, good one :D
MysteryX
8th August 2015, 03:30
SEt said this about nnedi3ocl:
I guess the same does not apply to KNLMeans? Then again using a high number of threads would probably only be beneficial if you're just using strictly OpenCL (or GPU) plugins, I doubt it would work efficiently when you start mixing CPU and GPU filters in complex scripts.
It's not the case here. Increasing the threads greatly increase CPU usage while providing no performance benefit whatsoever.
Yet I can't throw away MT for what I'm doing.
I'm developing this for a redistributable application; starting to play with drivers and registry is a bad idea. Not something I'd do on other machines.
foxyshadis
8th August 2015, 07:07
Just use SetMTMode(5) or 6 before KNLMeans. That's a necessary step for any filter that doesn't support external multithreading.
Or use VapourSynth, KNLMeans works correctly with its automatic multithreading.
Khanattila
8th August 2015, 10:17
SEt said this about nnedi3ocl:
I guess the same does not apply to KNLMeans? Then again using a high number of threads would probably only be beneficial if you're just using strictly OpenCL (or GPU) plugins, I doubt it would work efficiently when you start mixing CPU and GPU filters in complex scripts.
---
Groucho2004: Imagine Donald Trump and Usain Bolt going for a run together. Who do you think will sweat less?
LOL, good one :D
Copy the data host-to-device and device-to-host does not take long. Of course you can do it in multiple threads, but the difference is minimal. :rolleyes:
Xebika
25th August 2015, 22:18
I got a problem when i open a script with KNLMeans.
The loading is taking long time and when i click on VirtualDub and MeGUI it just crashes with message "Not Responsing"
I have tried with different version of KNLMeans and Geforce drivers.
And i also tried a clean installation of Windows 10 x64
Khanattila
26th August 2015, 11:57
v0.6.0 release: https://github.com/Khanattila/KNLMeansCL/releases.
Khanattila
26th August 2015, 11:59
I got a problem when i open a script with KNLMeans.
The loading is taking long time and when i click on VirtualDub and MeGUI it just crashes with message "Not Responsing"
I have tried with different version of KNLMeans and Geforce drivers.
And i also tried a clean installation of Windows 10 x64
Post the script.
Xebika
26th August 2015, 12:47
LoadPlugin("C:\Video\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
DGSource("C:\Video\Video.dgi",fieldop=0, deinterlace=1)
crop(24, 0, -8, -6)
Spline36Resize(768,576)
Levels(5, 1, 255, 0, 255)
SmoothContrast(contrast=0.2, sat=0.1)
LSFmod(defaults="slow")
KNLMeansCL(D=1, A=1, h=4.5)
Khanattila
26th August 2015, 13:33
LoadPlugin("C:\Video\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
DGSource("C:\Video\Video.dgi",fieldop=0, deinterlace=1)
crop(24, 0, -8, -6)
Spline36Resize(768,576)
Levels(5, 1, 255, 0, 255)
SmoothContrast(contrast=0.2, sat=0.1)
LSFmod(defaults="slow")
KNLMeansCL(D=1, A=1, h=4.5)
It seems correct. Version of AviSynth?
It is possible that MeGUI uses its version included.
Xebika
26th August 2015, 13:49
I use Groucho2004's ICL 10 build.
Khanattila
26th August 2015, 17:42
I use Groucho2004's ICL 10 build.
Have you tried different opencl device?
Xebika
26th August 2015, 17:53
Graphic Card or Plugin??
Groucho2004
26th August 2015, 18:19
v0.6.0 release: https://github.com/Khanattila/KNLMeansCL/releases.
This one is quite a bit slower than 0.5.9. Also, no documentation included. I assume that means that there are no changes to the previous version?
Here's the comparison.
Script used:
colorbars(width = 1280, height = 720, pixel_type = "yv12").killaudio().assumefps(24000, 1001).trim(0, 499)
KNLMeansCL(D = 2, A = 1, h = 1.0)
Result 0.5.9:
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 21.23 | 26.16 | 25.91
Memory usage (phys | virt): 31 | 30 MB
Thread count: 8
CPU usage (average): 25%
GPU usage (average): 94%
Video engine load (average): 0%
GPU memory usage: 78 MB
Time (elapsed): 00:00:19.295
Result 0.6.0:
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 19.66 | 23.58 | 23.40
Memory usage (phys | virt): 31 | 30 MB
Thread count: 8
CPU usage (average): 25%
GPU usage (average): 95%
Video engine load (average): 0%
GPU memory usage: 78 MB
Time (elapsed): 00:00:21.369
Groucho2004
26th August 2015, 18:37
Graphic Card or Plugin??
KNLMeansCL has a parameter "device_type":
string device_type (device_type)
CPU := An OpenCL device that is the host processor.
GPU := An OpenCL device that is a GPU.
ACCELERATOR := Dedicated OpenCL accelerators (for example the IBM CELL Blade).
DEFAULT := The default OpenCL device in the system.
Default: DEFAULT.
Try "GPU".
Xebika
26th August 2015, 18:44
Still same problem.
Groucho2004
26th August 2015, 18:47
Still same problem.
Have you tried a script with just the source filter and KNLMeansCL?
Xebika
26th August 2015, 18:52
I just tried and it did Unfortunately no difference
Groucho2004
26th August 2015, 19:05
I just tried and it did Unfortunately no difference
Try running a simple script like this:
colorbars(width = 1280, height = 720, pixel_type = "yv12").killaudio()
KNLMeansCL()
with AVSMeter (http://forum.doom9.org/showthread.php?t=165528). Report what happens.
Xebika
26th August 2015, 19:53
It works fine with your script and here is the log:
[General info]
Log file created with: AVSMeter 2.1.0 (x86)
Script file: C:\Video\KNLMeansCL Test.avs
Avisynth version: AviSynth 2.60 (ICL10) (2.6.0.6)
Avisynth Interface Version: 6
Avisynth.dll linker/compiler version: 6.0 (ICL 10.1)
Avisynth DLL location: C:\Windows\SysWOW64\avisynth.dll
PluginDir2_5 (HKLM, x86): C:\Program Files (x86)\AviSynth\plugins
[Clip info]
Number of frames: 107892
Length (hh:mm:ss.ms): 00:59:59.996
Frame width: 1280
Frame height: 720
Framerate: 29.970 (30000/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: 107892 (0 - 107891)
FPS (min | max | average): 31.84 | 126.2 | 122.7
TPF (max | min | avg): 31.41 | 7.925 | 8.147 ms
Memory usage (phys | virt): 93 | 90 MB
Thread count: 8
CPU usage (average): 25%
Time (elapsed): 00:14:39.022
[Script]
colorbars(width = 1280, height = 720, pixel_type = "yv12").killaudio()
KNLMeansCL()
And i got my script working with L-SMASH-Works but not with DGIndexNV.
But had no problems with both KNLMeansCL and DGIndexNV in same script, when i had Windows 8.1 x64
Khanattila
26th August 2015, 20:26
It works fine with your script and here is the log:
And i got my script working with L-SMASH-Works but not with DGIndexNV.
But had no problems with both KNLMeansCL and DGIndexNV in same script, when i had Windows 8.1 x64
I have not DGIndexNV, but from what you say could be a problem of the nvidia driver.
Khanattila
26th August 2015, 20:27
This one is quite a bit slower than 0.5.9. Also, no documentation included. I assume that means that there are no changes to the previous version?
Here's the comparison.
Script used:
colorbars(width = 1280, height = 720, pixel_type = "yv12").killaudio().assumefps(24000, 1001).trim(0, 499)
KNLMeansCL(D = 2, A = 1, h = 1.0)
Result 0.5.9:
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 21.23 | 26.16 | 25.91
Memory usage (phys | virt): 31 | 30 MB
Thread count: 8
CPU usage (average): 25%
GPU usage (average): 94%
Video engine load (average): 0%
GPU memory usage: 78 MB
Time (elapsed): 00:00:19.295
Result 0.6.0:
[Runtime info]
Frames processed: 500 (0 - 499)
FPS (min | max | average): 19.66 | 23.58 | 23.40
Memory usage (phys | virt): 31 | 30 MB
Thread count: 8
CPU usage (average): 25%
GPU usage (average): 95%
Video engine load (average): 0%
GPU memory usage: 78 MB
Time (elapsed): 00:00:21.369
I really have to attach the changelog.
* Added color distance (cmode).
* VapourSynth: added support for missing color format.
* Changed weighted RGB distance.
* No more SSE2 / SSE3 required.
* Minor changes and bug fixes.
Sparktank
26th August 2015, 21:15
LoadPlugin("C:\Video\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
DGSource("C:\Video\Video.dgi",fieldop=0, deinterlace=1)
crop(24, 0, -8, -6)
Spline36Resize(768,576)
Levels(5, 1, 255, 0, 255)
SmoothContrast(contrast=0.2, sat=0.1)
LSFmod(defaults="slow")
KNLMeansCL(D=1, A=1, h=4.5)
Using bluray remux, I copied your script.
only changed crop and resize.
also, source was progressive so I didn't need to use other arguments in DGSource.
Windows 7 (x64) SP1 (although I use x86 AVS)
ForceWare 355.60
GeForce GTX 750 ti
Intel Core i5-2320@3.00GHz (old)
SEt's last known MT build (though I don't really use it, mostly for SVP)
I use AvsPmod instead of VirtualDub.
[General info]
Log file created with: AVSMeter 2.0.9 (x86)
Script file: H:\BD Demux\Godzilla\Godzilla-test.avs
Avisynth version: AviSynth 2.60, build:Feb 20 2015 [03:16:45] (2.6.0.5)
Avisynth Interface Version: 6
Avisynth.dll linker/compiler version: 12.0 (VC 2013)
Avisynth DLL location: C:\Windows\SysWOW64\avisynth.dll
PluginDir2_5 (HKLM, x86): C:\Program Files (x86)\AviSynth\plugins
Active MT Mode: 0
[Script]
SetMemoryMax(512)
LoadPlugin("C:\AVS\dgdecnv2049\DGDecodeNV.dll")
DGSource("H:\BD Demux\Godzilla\Godzilla.dgi", crop_b=148, crop_t=140)
Spline64Resize(1280, 528)
Levels(5, 1, 255, 0, 255)
SmoothContrast(contrast=0.2, sat=0.1)
LSFmod(defaults="slow")
KNLMeansCL(D=1, A=1, h=4.5, info=true, device_type="GPU")
Intel:
KNLMeansCL(D=1, A=1, h=4.5, info=true)
Automatically used Intel as device_type
http://i.imgur.com/ANk2EsW.png (http://imgur.com/ANk2EsW)
NVidia:
KNLMeansCL(D=1, A=1, h=4.5, info=true, device_type="GPU")
Invoked NVidia manually
http://i.imgur.com/oxnYA4L.png (http://imgur.com/oxnYA4L)
It also works when I use just KNLMeansCL.
Khanattila
26th August 2015, 21:26
For unknown reason intel use a lot of spaces.
Groucho2004
26th August 2015, 22:09
I really have to attach the changelog.
* Added color distance (cmode).
* VapourSynth: added support for missing color format.
* Changed weighted RGB distance.
* No more SSE2 / SSE3 required.
* Minor changes and bug fixes.
I looked at the source code and "cmode" is indeed a new parameter. Maybe I'm just dumb but "Added color distance" seems like a really brief documentation for it.
Since you didn't comment, I suppose the slower operation compared to earlier versions is by design?
Khanattila
26th August 2015, 22:33
I looked at the source code and "cmode" is indeed a new parameter. Maybe I'm just dumb but "Added color distance" seems like a really brief documentation for it.
Since you didn't comment, I suppose the slower operation compared to earlier versions is by design?
Because it's really simple.
Normally distance between two pixels use only Luma:
distance = (p0.Y - p1.Y)^2
With cmode, KNLMeansCL use Luma and Chorma:
distance = (p0.Y - p1.Y)^2 + (p0.U - p1.U)^2 + (p0.V - p1.V)^2
With RGB color space cmode is always true:
distance = weightR * (p0.R - p1.R)^2 + weightG * (p0.G - p1.G)^2 + weightB * (p0.B - p1.B)^2
Anyway v0.6.1 will be released before OpenCL 1.2 conversion. I used some instructions that are slower than I thought.
Groucho2004
27th August 2015, 09:14
Anyway v0.6.1 will be released before OpenCL 1.2 conversion. I used some instructions that are slower than I thought.
The test above was with the 340.xx driver which does not support OpenCL 1.2. Using the latest driver (355.xx) with OpenCL 1.2 support, the difference in speed is neglible.
DarkSpace
27th August 2015, 10:28
Because it's really simple.
Normally distance between two pixels use only Luma:
distance = (p0.Y - p1.Y)^2
With cmode, KNLMeansCL use Luma and Chorma:
distance = (p0.Y - p1.Y)^2 + (p0.U - p1.U)^2 + (p0.V - p1.V)^2
With RGB color space cmode is always true:
distance = weightR * (p0.R - p1.R)^2 + weightG * (p0.G - p1.G)^2 + weightB * (p0.B - p1.B)^2
That looks weird. Isn't usually a Euclidean Distance used (i.e. you forgot to take the square root of your results)?
I'll concede that it isn't necessary as long as you just compare distances, but if you know that, you can simplify e.g. Y-only distance to abs(p0.Y - p1.Y). Also, it helps keep my confusion level low :p
Xebika
27th August 2015, 14:26
I have not DGIndexNV, but from what you say could be a problem of the nvidia driver.
I got it working now, because a new driver is released today but just a beta driver.
Khanattila
27th August 2015, 15:46
That looks weird. Isn't usually a Euclidean Distance used (i.e. you forgot to take the square root of your results)?
I'll concede that it isn't necessary as long as you just compare distances, but if you know that, you can simplify e.g. Y-only distance to abs(p0.Y - p1.Y). Also, it helps keep my confusion level low :p
Every pixel is restored by the weighted average of all pixels in its search window.
And the weight is inversely proportional to the square of distance. It gives better result, usually. ;)
In any case the distance between two vectors is: sqrt((p0.x-p1.x)^2 + (p0.y-p1.y)^2 + ....).
You can simplify to abs(p0-p1) only if p is a number.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.