Log in

View Full Version : KNLMeansCL: OpenCL NLMeans de-noising algorithm [2018-01-29]


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [25] 26 27 28 29 30 31 32

Ben_Nicholls
23rd September 2017, 21:18
KNLMeansCL(d=0), but the results are different...

Thanks :)

tuanden0
1st October 2017, 10:51
I tried to use KNLMeansCL to denoise all luma and chroma but I get this error and the screen preview is black
knlm.KNLMeansCL: fatal error!
My test script:
clip = core.lsmas.LWLibavSource(r"E:\Download\testsc.mkv", format="YUV420P8")
clip = core.std.AssumeFPS(clip, fpsnum=24000, fpsden=1001)
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="YUV")
clip.set_output()

Khanattila
1st October 2017, 11:31
I tried to use KNLMeansCL to denoise all luma and chroma but I get this error and the screen preview is black

My test script:

"YUV" requires 4:4:4, aka no chroma subsampling.


clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="Y")
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="UV")


or


#convert to rgb
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="RGB")
#convert to YUV again

tuanden0
1st October 2017, 14:05
"YUV" requires 4:4:4, aka no chroma subsampling.


clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="Y")
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="UV")


or


#convert to rgb
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="RGB")
#convert to YUV again


It's work, :thanks:

SaurusX
6th October 2017, 19:05
Can someone give me a primer as to what various settings of D and A result in? Such as what effect is to be expected, say, when D=1 and A=3, D=2 and A=1, etc? Maybe something like "X type of noise responds best with Y settings". It could be too broad of a question, but since this is such a time-expensive filter I'm looking for the best bang for the buck.

Currently I've settled on using knlmeanscl(D=1, A=3, h=??, S=1) for almost everything. I can push the D up to 2, but that increases encoding time on my GTX750 Ti by 40%. Also, on my system pushing up the D parameter can cause encoding errrors when combined with too many other temporal filters (I feel like I mention that a lot).

lansing
7th October 2017, 02:55
Can someone give me a primer as to what various settings of D and A result in? Such as what effect is to be expected, say, when D=1 and A=3, D=2 and A=1, etc? Maybe something like "X type of noise responds best with Y settings". It could be too broad of a question, but since this is such a time-expensive filter I'm looking for the best bang for the buck.

Currently I've settled on using knlmeanscl(D=1, A=3, h=??, S=1) for almost everything. I can push the D up to 2, but that increases encoding time on my GTX750 Ti by 40%. Also, on my system pushing up the D parameter can cause encoding errrors when combined with too many other temporal filters (I feel like I mention that a lot).

Filter description here
https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description

In short, D and A are for temporal size and spatial size. For temporal, unless you have some crazy dancing grain, D=2 (5 frames) should be enough for your needs, I just use D=1.

For A, S and H you'll have to tweak it according to your source. First bump H (strength) high enough to a point where it removes all noises or where it stopped removing more noise. Then work on A and S one at a time to remove noise that H haven't. At the same time gradually slide down H without introducing more noise.

A is the speed killer of the filter, on my GTX 650 ti boost, setting A from 1 to 5 had my speed dropped from 36fps to 2.97fps on a 1440x1080 clip...

clip = core.knlm.KNLMeansCL(clip, d=1, a=5, s=4, h=8)


I really want to know how the newer graphic cards do with a higher A value, because 3fps is just way too slow to me.

Khanattila
13th October 2017, 23:28
A is the speed killer of the filter, on my GTX 650 ti boost, setting A from 1 to 5 had my speed dropped from 36fps to 2.97fps on a 1440x1080 clip...

clip = core.knlm.KNLMeansCL(clip, d=1, a=5, s=4, h=8)


I really want to know how the newer graphic cards do with a higher A value, because 3fps is just way too slow to me.

RX 480 ~8.5 fps

edcrfv94
14th October 2017, 06:29
Filter description here
https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description

In short, D and A are for temporal size and spatial size. For temporal, unless you have some crazy dancing grain, D=2 (5 frames) should be enough for your needs, I just use D=1.

For A, S and H you'll have to tweak it according to your source. First bump H (strength) high enough to a point where it removes all noises or where it stopped removing more noise. Then work on A and S one at a time to remove noise that H haven't. At the same time gradually slide down H without introducing more noise.

A is the speed killer of the filter, on my GTX 650 ti boost, setting A from 1 to 5 had my speed dropped from 36fps to 2.97fps on a 1440x1080 clip...

clip = core.knlm.KNLMeansCL(clip, d=1, a=5, s=4, h=8)


I really want to know how the newer graphic cards do with a higher A value, because 3fps is just way too slow to me.


SetMemoryMax(3000)

colorbars(width=1440, height=1080, pixel_type="yv12").killaudio().assumefps(25, 1)
KNLMeansCL(d=1, a=5, s=4, h=8, device_type="GPU")


MSI GTX 1080 Ti GAMING X @1961MHz ~93% GPU load

15.37fps


SetMemoryMax(3000)

colorbars(width=1920, height=1080, pixel_type="yv12").killaudio().assumefps(25, 1)
KNLMeansCL(d=2, a=4, s=4, device_type="GPU")


MSI GTX 1080 Ti GAMING X @1961MHz ~95% GPU load

10.07fps

lansing
14th October 2017, 20:34
So the newest card is 5x my speed, scaled reasonable base on the years both card came out.

And why is your card at 2G? The inform at newegg said that it has 11G.

Groucho2004
14th October 2017, 21:56
And why is your card at 2G? The inform at newegg said that it has 11G.Methinks you're confusing video memory with clock speed.

lansing
15th October 2017, 00:27
Methinks you're confusing video memory with clock speed.

Ok I saw it now.

Khanattila
15th October 2017, 12:25
In theory you can use multiple graphics card. Actually it doesn't work because second GPU is waiting but it would be something like that:



function mGPU(clip source, int d, int a, int s) {

clipWdt = Width(source) / 2
clipHgh = Height(source)
halo = a + s

clipA = Crop(source, 0, 0, clipWdt + halo, clipHgh)
clipB = Crop(source, clipWdt - halo, 0, clipWdt + halo, clipHgh)

clipA = KNLMeansCL(clipA, d, a, s, device_id = 0)
clipB = KNLMeansCL(clipB, d, a, s, device_id = 1)

clipA = Crop(clipA, 0, 0, clipWdt, clipHgh)
clipB = Crop(clipB, halo, 0, clipWdt, clipHgh)

return StackHorizontal(clipA, clipB)

}

johnmeyer
5th November 2017, 00:19
I am getting AviSynthGetFrame errors any time I try to set d>0 or a>1 using AVISynth+ on WinXP Pro 32-bit.

Here is what avsmeter reports:

E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins>avsmeter "E:\Documents\
My Videos\AVISynth\Scripts\KNL_Means Interlaced Denoising.avs"

AVSMeter 2.4.7 (x86) - Copyright (c) 2012-2017, Groucho2004
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)

KNLMeansCL: AviSynthGetFrame error!
I tried going back to my earlier version of AVISynth, but Groucho's swtiching batch file, unfortunately, doesn't change enough things, and I get a whole new set of errors, so I don't want to compound the troubleshooting by trying to go back to 5.8 or 6.0.

AVISynth+ seems to be better in almost every way, so I'd like to stick with it, if I can.

I am using the non-GPU version of KNLMeans, although before I did that, I went to the Intel site and downloaded and installed the latest version of OpenCL and then used the most recent version of KNLMeansCL. Since I have an older GPU (GeForce 9800 GT), I don't think I can use the GPU, even with updated drivers.

The problem I am reporting here is with KNLMeansCL-v0.6.11 (9/23/2015).

I can get the plugin to work fine if I set d=0, but unfortunately, the denoising isn't very good without using adjacent fields.

Here is the script I'm using:

loadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\KNLMeansCL.dll")
#setmemorymax(1024)

d_input=0 #number of past/future frames default=1; 0=1 frame; 1=3 frames
a_input=1 #radius of search window; default=2; 0=1 pixel; 1=9 pixels
s_input=4 #radius of similarity; default=4
h_input=15.0 #filter strength
wmode_input=2 #weighting function (choose which one); default=0

source=AVISource("E:\fs.avi").KillAudio().requestlinear()
#source=AVISource("E:\fs.avi").KillAudio()

separatefields(source)
even=selecteven()
odd=selectodd()

den_even=KNLMeansCL(even,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
del_odd=KNLMeansCL(odd,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
interleave(den_even,del_odd)
output=weave()

#output = KNLMeansCL(source,d=d_input,a=a_input,s=s_input,h=h_input)
#return output
#return source
#stackhorizontal(source,output)

#/*
return Interleave(
\ source
\ , output
\ )
#*/

# Enable MT!
Prefetch(5)

I read a few posts earlier in this massively long thread that people had problems using this on interlaced video. Perhaps I should re-write this a little to see if I can use it on dumb bobbed video because that way I'd only have one call to the DLL. [edit]I just did that, and the bobbed version freezes in exactly the same way. Two calls is not the problem. [/end edit]

I've killed a lot of time on this, and am just going to have to use a lesser denoiser (MDegrain2) so I can finish the project. However, when I use the settings I want with KNLMeansCL, I can get a few dozen frames done before it crashes, and those are absolutely spectacular. Really good stuff.

It feels like a memory issue because it seems to fail at earlier or later frames, depending on what SetMemoryMax values I use. It is as though some data area is filling up.

Just as I was getting ready to post this, I ran it again, and my computer completely locked up and froze, like the old DOS days of the 1980s. I've had this computer for seven years, and I don't think it ever locked up like that. There is definitely something squirrely (technical term) going on under the covers.

Any hints or ideas would be greatly appreciated.

LigH
5th November 2017, 00:26
I remember that I can't use a current KNLMeansCL with a GeForce 9800, not even with a GTS 450. It requires a more recent OpenCL API version.

Groucho2004
5th November 2017, 09:48
@John
First of all, your card does support OpenCL 1.1 which works with KNLMeansCL 0.6.11. As for drivers, all you need is the latest Nvidia driver that works for your card (340.52 (http://www.nvidia.com/Download/index.aspx?lang=en-us)). No Intel driver required.

It's most likely a memory issue. Your 9800 probably doesn't have enough memory for 2 KNLMeansCL calls and running this in 5 threads. Reduce the number of threads or run KNLMeansCL single-threaded (add "SetFilterMTMode("knlmeanscl", MT_SERIALIZED)" at the beginning of your script).

You can monitor GPU memory usage by running AVSMeter with the "-gpu" switch. GPU-Z (https://www.techpowerup.com/download/gpu-z/) must be running in this case.

johnmeyer
5th November 2017, 17:02
Groucho,

Many thanks! I'll do everything you recommended and report back. I actually don't know what driver version I'm running. I'm running AVISynth+ at this point, so I don't know if SetFilterMTMode will do the same thing in that environment. With AVISynth "SetMTMode" isn't used.

LigH
5th November 2017, 17:08
Groucho2004 already mentioned SetFilterMTMode because it is an AviSynth+ feature. You can control the parallelizability per AviSynth filter function automatically for every occurence. Legacy AviSynth MT does not support that globally, you would have to switch the MT mode before and after such restricted functions.

johnmeyer
5th November 2017, 19:37
Thanks for the help but it looks like I'll have to try another avenue. I tried to install the 340.52 driver and it wouldn't install (I got an error message from the nVidia installer that it could not install). I did a little research and found that this is a common problem, so I manually installed the driver. Unfortunately I ended up with a 4-bit 640x480 display using the generic Windows driver. So I backed out of that, and as I was waiting for System Restore to complete I remembered that I'd been through this loop before a few years ago and that's why I'm stuck with the 258.96 drivers.

Also, I did try adding the

SetFilterMTMode("knlmeanscl", MT_SERIALIZED)

line to the beginning of the script, but it did not change the crash behavior at all.

So, since this a dual boot computer, I'll use this as an excuse to install AVISynth+ on my Windows 7 Pro 64-bit installation, and see if I get any better results there.

Thanks again for the help.

DJATOM
5th November 2017, 20:01
Try 'SetFilterMTMode("knlmeanscl", MT_SERIALIZED, true)'.

johnmeyer
5th November 2017, 20:05
I'm working on the Win7 64-bit boot drive, using the same computer. At the moment I'm using AVISynth 2.60 (2/20/2015) because that's what was already installed. I am using the script without any multi-threading (on this older version of AVISynth, all I have to do is omit the SetMTMode statements).

I've found a few interesting bugs, although since these are with the older legacy KNLMeansCL, it probably doesn't make sense to waste people's time describing them. The short version is that with wmode_input set to default ("0"), even if you set the denoiser strength to 0.01, and set "d" and "a" to zero, it still does all sorts of filtering.

It still crashes in the exact same manner as under Win XP 32-bit, and I still am not able to load any of the modern KNLMeansCL versions.

I'll keep working through this.

Groucho2004
5th November 2017, 22:11
Thanks for the help but it looks like I'll have to try another avenue. I tried to install the 340.52 driver and it wouldn't install (I got an error message from the nVidia installer that it could not install). I did a little research and found that this is a common problem, so I manually installed the driver. Unfortunately I ended up with a 4-bit 640x480 display using the generic Windows driver.
I bet you used the "Express Install". Bad idea since it installs a pile of crap (with .NET 4 dependencies) that you don't need.

1. Uninstall your old driver
2. Start the 340.52 installer and select "Custom".
3. De-select everything except the display driver
4. Install

johnmeyer
5th November 2017, 22:32
Groucho,

Yup, that's what I did. I did think of unchecking all that other stuff, because I never use it.

When I get back to the XP boot drive, I'll do as you suggest.

Back to my main problem. I've made real progress. I've switched over to the Win7 64-bit boot drive and after a lot of stupidity (forgot to copy the MT AVISynth+ version after installation of the old 2014 version), I have AVISynth+ running and KNLMeansCL is working without crashing. I've tuned the parameters and like the results.

However ...

My one remaining problem is that I can't get MT to work. I have all the SetMT calls in an AVSI file that is loading at startup, and I have the Prefetch(4) at the end of the script. I've used MT many times in the month since I first installed AVISynth+ on my XP partition, so I'm getting somewhat familiar with the syntax. I'm not sure what is going on. I only get 2 fps without it (I have to use d=3 to get decent noise reduction on this 1981 VHS dub of someone's wedding inside a dark church, which I've brightened to within an inch of its life). The result is remarkably good, far better than I've seen with the old fft3dfilter, MDegrain2, and other spatial, temporal, and fft denoisers I've used.

But because of the multiple frames that must be processed, it is pretty slow.

So, I am now really close and all I have to do is figure out how to speed it up. I've tried the script with and without the "requestlinear" statement. I don't think it is needed in my script.

Here's the script I'm using. For troubleshooting, I've temporarily removed the MtModes.avsi file and since there is only one plugin, I'm setting the MT mode explicitly within the script.

[edit]I just did a quick test, and MT is not working for any script. So, it is not this script and it is not KNLMeansCL. [/end edit]

loadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\KNLMeansCL.dll")
setmemorymax(1200)

SetFilterMTMode("knlmeanscl", MT_SERIALIZED, true)

d_input=3 #number of past/future frames default=1; 0=1 frame; 1=3 frames
a_input=1 #radius of search window; default=2; 0=1 pixel; 1=9 pixels
s_input=4 #radius of similarity; default=4
h_input=10.0 #filter strength
wmode_input=0 #weighting function; default=0

source=AVISource("E:\fs.avi").KillAudio().Requestlinear()

separatefields(source)
even=selecteven()
odd=selectodd()
den_even = KNLMeansCL(even,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
del_odd = KNLMeansCL(odd, d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
interleave(den_even,del_odd)
output=weave()

return output

#Enable MT
Prefetch(5)

Groucho2004
5th November 2017, 22:40
return output

#Enable MT
Prefetch(5)
Try placing the Prefetch call before "return output" (everything after a return statement is ignored).

johnmeyer
6th November 2017, 00:36
Try placing the Prefetch call before "return output" (everything after a return statement is ignored).Well, if anyone would know, it would be you. However, that sure isn't what the AVISynth+ doc says, which is why my script is written that way. Here's the quote from the AVISynth+ Wiki:

"You enable MT by placing a single call to Prefetch(X) at the *end* of your script, where X is the number of threads to use."

I didn't put the asterisks on either side of "end," so whoever wrote that really want to emphasize, I thought, that it should be the very last statement in the script, period.

I'll try it when I get back to the Win7 boot partition and let you know (I'm back into the XP partition to try your suggestion about how to update the GPU driver). Thanks!

johnmeyer
6th November 2017, 01:28
I followed the directions exactly for installing just the nVidia driver, but the installatio program gave me the same error message. I'm not going to waste anymore of either my time, or anyone elses' time on this. While I still use XP a lot, it obviously isn't supported any more, not just by MS, but by any other company. Add to that the general incompetence of video graphic software programmers (I can't believe that the bugs and installation nonsense that started back in the 1980s is still going on today), and its a quagmire not worth entering.

However, thanks once again for the help.

No to go back to the Win7 64-bit and see if I can get MT to work.

johnmeyer
6th November 2017, 01:57
Moving prefetch to the line before the return statement did not do anything.

I'm going to take a break and see if I can figure out the error in my ways ...

[edit]Actually, I'm going to give up trying to get it to use MT. I just read through a huge portion of this thread, especially the long discussion between Groucho and MysteryX about using MT with this filter, with the KNLMeansCL author also making posts. My take from that is that MT may not even be possible with this filter, and at best, it is only going to provide a few percent improvement, not a 2x or 3x speed-up.

Groucho2004
6th November 2017, 02:19
Moving prefetch to the line before the return statement did not do anything.How do you determine this? Did you compare the number of threads used?

The script you posted above uses very few CPU cycles so depending on how you measured you may not have noticed a difference.

johnmeyer
6th November 2017, 03:33
How do you determine this? Did you compare the number of threads used?

The script you posted above uses very few CPU cycles so depending on how you measured you may not have noticed a difference.I viewed the AVISynth script output in VirtualDub. I used VD's "Run Video Analysis Pass" and watched the fps readout. I then moved the Prefetch call to a place both before and after the return statement. There was 0.00% difference: I got 2.04 fps for 30 seconds in both cases (I aborted after that amount of time). I also tried different thread settings from 2 all the way up to 8 (my computer's number of cores). No difference.

Groucho2004
6th November 2017, 08:14
I viewed the AVISynth script output in VirtualDub. I used VD's "Run Video Analysis Pass" and watched the fps readout. I then moved the Prefetch call to a place both before and after the return statement. There was 0.00% difference: I got 2.04 fps for 30 seconds in both cases (I aborted after that amount of time). I also tried different thread settings from 2 all the way up to 8 (my computer's number of cores). No difference.
Using your script, I get these results:

"Prefetch(5)" placed after "return output":
FPS (min | max | average): 22.66 | 23.51 | 23.41
Memory usage (phys | virt): 79 | 97 MiB
Thread count: 23
CPU usage (average): 25%
"Prefetch(5)" placed before "return output":
FPS (min | max | average): 22.65 | 23.52 | 23.41
Memory usage (phys | virt): 80 | 97 MiB
Thread count: 28
CPU usage (average): 25%

As I mentioned, the CPU load is very low and the GPU filter is the bottleneck.
If you use a filter that's heavy on the CPU such as MDegrain you will see a difference in speed and CPU usage.

Groucho2004
6th November 2017, 08:19
[edit]Actually, I'm going to give up trying to get it to use MT. I just read through a huge portion of this thread, especially the long discussion between Groucho and MysteryX about using MT with this filter, with the KNLMeansCL author also making posts. My take from that is that MT may not even be possible with this filter, and at best, it is only going to provide a few percent improvement, not a 2x or 3x speed-up.
As I mentioned several times, multi-threading a GPU filter makes little sense. That doesn't mean that you can't multi-thread the rest of your filters. That of course only makes sense if you're using filters that are heavy on the CPU.

Khanattila
6th November 2017, 08:31
As I mentioned several times, multi-threading a GPU filter makes little sense. That doesn't mean that you can't multi-thread the rest of your filters. That of course only makes sense if you're using filters that are heavy on the CPU.Really, this is a topic that we have really talked about many times.

TheFluff
6th November 2017, 10:09
Moving prefetch to the line before the return statement did not do anything.

I'm going to take a break and see if I can figure out the error in my ways ...

Well. You explicitly set the KNLMeansCL MT mode to MT_SERIALIZED at the top of the script, which means that it - and everything upstream of it up to and including the source filter - will run single-threaded and synchronously, just like in vanilla Avisynth. You've thereby intentionally bottlenecked the script, so what are you expecting to see here, really? The only filters that are running multithreaded in your script are interleave() and weave().

You can definitely multithread KNLMeansCL by running multiple instances of it (MT_MULTI_INSTANCE, and I hope you have a ton of RAM) but the main benefit of this isn't that it improves the performance of KNLMeansCL itself, but that it allows filters upstream of it to run in parallel. Avisynth's parallelism is brain damaged, news at 11.

johnmeyer
6th November 2017, 21:01
Well. You explicitly set the KNLMeansCL MT mode to MT_SERIALIZED at the top of the script, which means that it - and everything upstream of it up to and including the source filter - will run single-threaded and synchronously, just like in vanilla Avisynth. You've thereby intentionally bottlenecked the script, so what are you expecting to see here, really? The only filters that are running multithreaded in your script are interleave() and weave().

You can definitely multithread KNLMeansCL by running multiple instances of it (MT_MULTI_INSTANCE, and I hope you have a ton of RAM) but the main benefit of this isn't that it improves the performance of KNLMeansCL itself, but that it allows filters upstream of it to run in parallel. Avisynth's parallelism is brain damaged, news at 11.You are right that in post #1232 I did include MT_SERIALIZE, but in my earlier post (#1223), I didn't have that. Believe me, I've tried all the various MT modes.

Your idea of MT_MULTI_INSTANCE is very intriguing. I didn't know about that. I'll pursue that and see what happens. I do happen to have a "ton of RAM," although whether AVISynth+ running KNLMeansCL will use it, or not, I don't know. It should be fun to try it and find out. Thanks!

RieGo
8th November 2017, 19:17
i'd like to share a little story in case you got the same problem.
so lately my knlmeanscl didn't work. it always threw some missing dependency errors.
i tried everything mostly reinstalling ms vs runtimes, but i couldn't figure out the problem.
my graphics driver was up to date - that's what i thought.

here's what actually happened: i got a new Win 10 Upgrade lately. what i didn't expect/know is that it replaces my graphics driver with a worse one - which doesn't have opencl support(?)
completely reinstalling the nvidia driver fixed everything and KNLMeansCL is working great again :)

johnmeyer
8th November 2017, 21:59
i'd like to share a little story in case you got the same problem.
so lately my knlmeanscl didn't work. it always threw some missing dependency errors.
i tried everything mostly reinstalling ms vs runtimes, but i couldn't figure out the problem.
my graphics driver was up to date - that's what i thought.

here's what actually happened: i got a new Win 10 Upgrade lately. what i didn't expect/know is that it replaces my graphics driver with a worse one - which doesn't have opencl support(?)
completely reinstalling the nvidia driver fixed everything and KNLMeansCL is working great again :)I think you are right about the graphics driver, and a few posts further up, Groucho tried to help me upgrade my XP driver, but the nVidia installer failed and I eventually gave up. My Win7 installation (same computer, different boot drive) has the last nVidia driver for Win7 and it will run KNLMeansCL.

As for having something replaced by a background upgrade that I don't authorize, I turn off ALL upgrades for everything, including Windows. Neither my Win XP or Win7 installation has been updated in seven years. As a result, I never have had the pleasure of turning on the computer, only to find that it doesn't behave like it did yesterday. As a result, I get a lot of work done because I don't spend any time in the "care and feeding" of my computer.

I partition my hard drives so that only the O/S and programs are on the boot partition. I can do an image backup in less than five minutes. So, if something bad does happen (people always worry that I'll get a virus or something like that, especially since I don't run any anti-virus programs), I can restore the computer in less than ten minutes. I've had to do this a few times when I've installed a new program that screws things up.

So: no background updates; no anti-virus software; no background programs (task manager only lists three processes in XP after I boot); and partition the boot drive. I highly recommend this to anyone who wants a fast, trouble-free computer.

edcrfv94
15th November 2017, 22:50
The result is different, which one is correct?


SetMemoryMax(3000)

ImageSource("1.png", end=0).Dither_convert_rgb_to_yuv(lsb=true,output="YV12").DitherPost(mode=6)

ConvertBits(bits=16)

KNLMeansCL(d=2, a=4, s=4, h=0.4, channels="Y", stacked=false, device_type="GPU")

ConvertToStacked().DitherPost(mode=6, ampo=1)



SetMemoryMax(3000)

ImageSource("1.png", end=0).Dither_convert_rgb_to_yuv(lsb=true,output="YV12").DitherPost(mode=6)

ConvertBits(bits=16)
ConvertToStacked()

KNLMeansCL(d=2, a=4, s=4, h=0.4, channels="Y", stacked=true, device_type="GPU")

DitherPost(mode=6, ampo=1)

yup
22nd November 2017, 06:47
Hi Khanattila!
Please give me link for original paper. I want understand how work all parameters (mainly a and s) Your plugin.
yup.

videoFred
22nd November 2017, 14:33
I realy would like to test this filter. Unfortunately I'm getting the following error message:

no compatible opencl platforms available

My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.

Any suggestions please?


Fred.

Atak_Snajpera
22nd November 2017, 14:42
I realy would like to test this filter. Unfortunately I'm getting the following error message:



My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.

Any suggestions please?


Fred.

Your GPU does not support OpenCL 1.2 !
https://www.geforce.com/hardware/notebook-gpus/geforce-gt-420m/specifications

Groucho2004
22nd November 2017, 14:52
My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.

Any suggestions please?


Fred.
As mentioned, your card does not support OpenCL 1.2. However, you can use an older version of KNLMeansCL (0.6.11 (https://github.com/Khanattila/KNLMeansCL/releases/tag/v0.6.11)).

videoFred
22nd November 2017, 15:25
Thank you both for the fast advice!
Will try 0.6.11 as suggested by Groucho! :thanks:

Fred.

johnmeyer
22nd November 2017, 22:01
I realy would like to test this filter. Unfortunately I'm getting the following error message:

My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.

Any suggestions please?I had the same problem, but now have everything working on Win7 64-bit, with AVISynth+ (r2504) and the 11/5/2017 version of KNLMeansCL. I went back to my notes to see what changes I made to get it to work, but cannot remember what I did (sorry!). I most definitely could NOT get it to work under XP where, for various reasons, I've been unable to install a later driver for my old nVidia GeForce 9800GT. Under Windows 7 I did not have that problem and have what I think is the last supported driver for that O/S, version 341.44.

My opinion of the filter is quite varied: on some material it performs brilliantly, clearly doing a better job than MDegrain2. This is especially true for "blotchy noise" that results from brightening really dark video. However, on other material, despite several people's claims that it doesn't destroy details, it absolutely ruined the video. This wasn't minor, but was really bad. The problems were most apparent on things like water glasses on a banquet table, where the subtle shadings on the glass disappeared. On another video, the wavy folds on a dress shirt also disappeared. So, take a hard look at any contoured surfaces that have no "high frequency" detail and instead simply have subtle changes in shading.

The filter is also dog slow without any GPU assist, and MT doesn't seem to do much (several people have said in this thread that MT and GPU end up working at odds, although without a GPU, I would think MT could still do something, but what do I know).

For me, any filter that cannot get above 1 fps is a unusable. I simply don't have multiple days to devote to any individual film or video. Life is full of "engineering trade-offs," and performance does matter.

Khanattila
23rd November 2017, 13:54
Hi Khanattila!
Please give me link for original paper. I want understand how work all parameters (mainly a and s) Your plugin.
yup.

B. Goossens, H.Q. Luong, J. Aelterman, A. Pizurica, and W. Philips,
"A GPU-Accelerated Real-Time NLMeans Algorithm for Denoising Color Video Sequences",
in Proc. ACIVS (2), 2010, pp.46-57.

VS_Fan
23rd November 2017, 17:18
B. Goossens, H.Q. Luong, J. Aelterman, A. Pizurica, and W. Philips,
"A GPU-Accelerated Real-Time NLMeans Algorithm for Denoising Color Video Sequences",
in Proc. ACIVS (2), 2010, pp.46-57.
You could also find useful the papers referred by Kevin Stone (aka ‘Tritical’) when he released 'TNLMeans' 10 years ago. Those are still available at the AviSynth Wiki (http://avisynth.nl/index.php/TNLMeans)

EDIT: A functional snapshot (http://web.archive.org/web/20100411094229/http://web.missouri.edu/~kes25c/) from 2010 of tritical's web page, provided by wayback machine, where you will find the referred papers.

There are some other references at Wikipedia (https://en.wikipedia.org/wiki/Non-local_means)

Groucho2004
24th November 2017, 18:45
However, on other material, despite several people's claims that it doesn't destroy details, it absolutely ruined the video. This wasn't minor, but was really bad. The problems were most apparent on things like water glasses on a banquet table, where the subtle shadings on the glass disappeared. On another video, the wavy folds on a dress shirt also disappeared.
Could you share the KNLMeansCL settings you used in these cases and possibly a clip to reproduce?

pcroland
25th November 2017, 01:17
Hi!

I recently find knlmeanscl and it works pretty great but I have some questions:

Why do I get glitches at the start of the video sometimes? And how should I get rid of them?
Here's an example: https://mega.nz/#F!mUpyTIII!IXp43ePL1PETUGyVMYNUUg (source and encode are both ~1min long)
DirectShowSource("D:\raccoons\DVD1\VIDEO_TS\VTS_01_1.VOB")
QTGMC(Preset="Fast")
SelectOdd()
Crop(14,2,-16,-0)
FillMargins(1,0,1,1)
bbmod(0,2,4,6)
knlmeanscl(D=2, A=3, h=3, device_type="GPU")
DeHalo_Alpha(rx=2.0, ry=2.0, darkstr=0.4, brightstr=1, lowsens=50, highsens=50, ss=1.5)
GradFun3(thr=0.35, radius=12, elast=3, mask=2, mode=0, smode=0, debug=0, lsb=False, lsb_in=False, staticnoise=False, y=3, u=3, v=3)
Spline36ResizeMod(688,538,1,0,-1,-1)

The other question is how can I speed up the encodeing process? knlmeanscl is the bottleneck right now. I have an i7-4790 but I don't have a dedicated GPU but knlmeanscl still runs faster with device_type="GPU". Should I get a GPU? :D
Thanks in advance,
pcroland.

Shirtfull
25th November 2017, 18:12
Hi!

Why do I get glitches at the start of the video sometimes? And how should I get rid of them?


Could be your source filter, try dgmpgdec

Groucho2004
25th November 2017, 18:43
Why do I get glitches at the start of the video sometimes? And how should I get rid of them?
Here's an example: https://mega.nz/#F!mUpyTIII!IXp43ePL1PETUGyVMYNUUg (source and encode are both ~1min long)
DirectShowSource("D:\raccoons\DVD1\VIDEO_TS\VTS_01_1.VOB")
QTGMC(Preset="Fast")
SelectOdd()
Crop(14,2,-16,-0)
FillMargins(1,0,1,1)
bbmod(0,2,4,6)
knlmeanscl(D=2, A=3, h=3, device_type="GPU")
DeHalo_Alpha(rx=2.0, ry=2.0, darkstr=0.4, brightstr=1, lowsens=50, highsens=50, ss=1.5)
GradFun3(thr=0.35, radius=12, elast=3, mask=2, mode=0, smode=0, debug=0, lsb=False, lsb_in=False, staticnoise=False, y=3, u=3, v=3)
Spline36ResizeMod(688,538,1,0,-1,-1)
There are a bunch of potential culprits for the glitches. First and foremost, DirectShowSource is the worst choice for your source. Use DGIndex/DGDecode for VOB.
If that doesn't solve the glitch problem, test each of the filters/functions separately.

The other question is how can I speed up the encodeing process? knlmeanscl is the bottleneck right now. I have an i7-4790 but I don't have a dedicated GPU but knlmeanscl still runs faster with device_type="GPU". Should I get a GPU? :DYes, get a decent card (GTX1060/70/80).

pcroland
25th November 2017, 18:49
There are a bunch of potential culprits for the glitches. First and foremost, DirectShowSource is the worst choice for your source. Use DGIndex/DGDecode for VOB.
If that doesn't solve the glitch problem, test each of the filters/functions separately.

Yes, get a decent card (GTX1060/70/80).

I tried DGIndex but there were still some glitches, for example the luma frame changed as it should but the chroma frames remained the same. I got an ASUS 1050 2GB, the encoding time is now 8fps and for some reason the glitches disappeared also :)

videoh
25th November 2017, 23:34
Earlier versions of the nVidia driver had a relevant MPEG2 bug. Maybe when you installed the 1050 you upgraded to the new driver, which has been fixed.

Still, there shouldn't be any problem with DGIndex. I'll have a look with your stream.