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 22nd July 2024, 11:28   #1561  |  Link
WolframRhodium
Registered User
 
Join Date: Jan 2016
Posts: 165
Quote:
Originally Posted by anton_foy View Post
Too bad, it is really fast and has so much better temporal stability compared to knlmeansCL.
The output of nlm-cuda should be closed to KNLMeansCL and should not result in an increase in image quality.
WolframRhodium is offline   Reply With Quote
Old 23rd July 2024, 00:29   #1562  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 721
Quote:
Originally Posted by WolframRhodium View Post
The output of nlm-cuda should be closed to KNLMeansCL and should not result in an increase in image quality.
My mistake, yes they seem to give identical results yet only the first 4 frames seems to differ from eachother even when both using the same settings. But that doesn't bother me. Great plugin

@Tormento
Is the author here on Doom9 still? I cannot access his own forum.

Last edited by anton_foy; 23rd July 2024 at 08:53.
anton_foy is offline   Reply With Quote
Old 23rd July 2024, 09:02   #1563  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,967
Quote:
Originally Posted by anton_foy View Post
Is the author here on Doom9 still? I cannot access his own forum.
I think he is lurking but not officially here.

You can’t access or you can’t register?

In the second case, perhaps some users here and on his forum can ask him to create you an account.

He is very capable but also a bit weird.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 13th August 2024, 01:25   #1564  |  Link
JamesJohnston
Registered User
 
Join Date: Jul 2024
Posts: 4
Likely bug: KNLMeansCL outputs garbage if image width is a multiple of 64

I reported this issue on GitHub, but I'm not sure if anyone's monitoring that, so posting it here as well. More details in the GitHub issue: https://github.com/pinterf/KNLMeansCL/issues/6

In short, if the image width is a multiple of 64, KNLMeansCL outputs garbage - as seen in this test case:

Code:
plugin_dir = "C:\VideoProject\Software\AviSynth-plugin\"
LoadPlugin(plugin_dir + "KNLMeansCL.dll")

function test(int width) {
    input = ColorBars(width=width, height=480, pixel_type="YV24").Trim(0, 50).Subtitle(String(width), size=36).FadeOut(50).ConvertToY8()
    output = input.KNLMeansCL(ocl_x=8, ocl_y=16, ocl_r=1)
    StackVertical(input, output)
}

StackHorizontal( \
    test(8*1),  test(8*2),  test(8*3),  test(8*4),  test(8*5),  test(8*6),  test(8*7),  test(8*8),  \
    test(8*9),  test(8*10), test(8*11), test(8*12), test(8*13), test(8*14), test(8*15), test(8*16), \
    test(8*17), test(8*18), test(8*19), test(8*20), test(8*21), test(8*22), test(8*23), test(8*24), \
    test(8*25), test(8*26), test(8*27), test(8*28), test(8*29), test(8*30), test(8*31), test(8*32), \
    test(8*33), test(8*34), test(8*35), test(8*36), test(8*37), test(8*38), test(8*39), test(8*40), \
    test(8*41), test(8*42), test(8*43), test(8*44), test(8*45), test(8*46), test(8*47), test(8*48) \
)
I posted an example of an output frame in the GitHub issue. But what happens is the bottom row (filter output) is missing outputs (they are all black) whenever width is a multiple of 64.

In real-world videos, I've seen where the filter output gets stuck at a specific frame, and doesn't change when I move the AvsPmod slider bar to other frames. Other times, it will show partial or total garbage pixels, as if it was displaying uninitialized memory.

In practice, I'm trying to crop a standard definition 720x480 video down by a multiple of 16, which is coming out with a width of 704. That seems like it would be a fairly common scenario...? but that's a multiple of 64, so the rendered output comes out as garbage.
JamesJohnston is offline   Reply With Quote
Old 30th November 2024, 06:00   #1565  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,641
with intel igpu in 13th gen
Code:
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()

it's intel problem or KNLMeansCL?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 30th November 2024, 10:32   #1566  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,967
Quote:
Originally Posted by real.finder View Post
it's intel problem or KNLMeansCL?
OpenCL should be GPU agnostic.

You tried with other GPUs as well?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 30th November 2024, 16:40   #1567  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,641
Quote:
Originally Posted by tormento View Post
OpenCL should be GPU agnostic.

You tried with other GPUs as well?
there are problems with KNLMeansCL and amd gpu already, only nvidia seems work fine with KNLMeansCL

I think CPU is the only standard (Especially X86-X64 since in apple m1-m4 is kind of different from another arm from what I've heard, I know someone use x86 port of his program to make it work in m1-m4), so maybe it's good idea to make cpu port of KNLMeansCL (opencl in cpu is dropped in modren cpus) edit: there are https://forum.doom9.org/showthread.php?t=172966 already but not as KNLMeansCL, xNLMeans maybe got things that not in KNLMeansCL but there are also things in KNLMeansCL that not in xNLMeans, so maybe someone update xNLMeans to make it ultimate NLMeans
__________________
See My Avisynth Stuff

Last edited by real.finder; 30th November 2024 at 17:04.
real.finder is offline   Reply With Quote
Old 30th November 2024, 17:37   #1568  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,483
Quote:
Originally Posted by real.finder View Post
with intel igpu in 13th gen
Code:
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()

it's intel problem or KNLMeansCL?
I can't reproduce that here with an Arc A770, Ubuntu 24.10.
qyot27 is offline   Reply With Quote
Old 30th November 2024, 23:21   #1569  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,967
Quote:
Originally Posted by real.finder View Post
it's good idea to make cpu port of KNLMeansCL
Or not.

There are plugins that works really well under cpu, others really good on GPU. I think KNLMeansCL could be a real performance hit on a CPU.

Why don’t you simply use the CPU version of BM3D? I find it in many ways superior.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 1st December 2024, 04:46   #1570  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 583
CPU KNLM Choices:
1) CPU "port": https://github.com/AmusementClub/vs-nlm-ispc
2) CPU OpenCL runtime: https://www.intel.com/content/www/us...l-support.html
Z2697 is offline   Reply With Quote
Old 1st December 2024, 15:00   #1571  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 898
Quote:
Originally Posted by real.finder View Post
there are problems with KNLMeansCL and amd gpu already, only nvidia seems work fine with KNLMeansCL

I think CPU is the only standard (Especially X86-X64 since in apple m1-m4 is kind of different from another arm from what I've heard, I know someone use x86 port of his program to make it work in m1-m4), so maybe it's good idea to make cpu port of KNLMeansCL (opencl in cpu is dropped in modren cpus) edit: there are https://forum.doom9.org/showthread.php?t=172966 already but not as KNLMeansCL, xNLMeans maybe got things that not in KNLMeansCL but there are also things in KNLMeansCL that not in xNLMeans, so maybe someone update xNLMeans to make it ultimate NLMeans
KNLMeansCL is old __AVISYNTH_8_H__ and openCL 1.2.
Code:
plugins/Khanattila/NLMAvisynth.cpp: In constructor 'NLMAvisynth::NLMAvisynth(PClip, int, int, int, double, const char*, int, double, PClip, const char*, int, int, int, int, bool, bool, int, IScriptEnvironment*)':
plugins/Khanattila/NLMAvisynth.cpp:215:38: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
  215 |     cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
      |                                      ^~~~
plugins/Khanattila/NLMAvisynth.cpp:215:61: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
  215 |     cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
      |                                                             ^~~~
plugins/Khanattila/NLMAvisynth.cpp:216:42: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
  216 |     cl_channel_type channel_type_p_out = NULL;
      |                                          ^~~~
ffplay_avx2.exe KNLMeansCL.avs =
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()

https://forum.doom9.org/showthread.p...21#post2010721

Last edited by Jamaika; 1st December 2024 at 16:18.
Jamaika is offline   Reply With Quote
Old 1st December 2024, 16:25   #1572  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,641
Quote:
Originally Posted by qyot27 View Post
I can't reproduce that here with an Arc A770, Ubuntu 24.10.
maybe windows driver bug? like this https://forum.doom9.org/showthread.p...73#post1963373

Quote:
Originally Posted by tormento View Post
Or not.

There are plugins that works really well under cpu, others really good on GPU. I think KNLMeansCL could be a real performance hit on a CPU.

Why don’t you simply use the CPU version of BM3D? I find it in many ways superior.
the cpu plugins of NLMeans in avs can't be used as drop-in replacement for KNLMeansCL
BM3D is another story

Quote:
Originally Posted by Z2697 View Post
that for vs only?
anyway thanks for CPU OpenCL runtime link, I thought Intel no longer supported that

Quote:
Originally Posted by Jamaika View Post
KNLMeansCL is old __AVISYNTH_8_H__ and openCL 1.2.
Code:
plugins/Khanattila/NLMAvisynth.cpp: In constructor 'NLMAvisynth::NLMAvisynth(PClip, int, int, int, double, const char*, int, double, PClip, const char*, int, int, int, int, bool, bool, int, IScriptEnvironment*)':
plugins/Khanattila/NLMAvisynth.cpp:215:38: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
  215 |     cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
      |                                      ^~~~
plugins/Khanattila/NLMAvisynth.cpp:215:61: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
  215 |     cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
      |                                                             ^~~~
plugins/Khanattila/NLMAvisynth.cpp:216:42: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
  216 |     cl_channel_type channel_type_p_out = NULL;
      |                                          ^~~~
ffplay_avx2.exe KNLMeansCL.avs =
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()
don't know, but avs should be backward compatible unless there are bugs in KNLMeansCL, anyway it still work with nvidia for me (in my home pc, the igpu bug using remote server)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 1st December 2024, 17:22   #1573  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 898
You tried my version. Is it the same or not?
Jamaika is offline   Reply With Quote
Old 3rd December 2024, 05:06   #1574  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,641
Quote:
Originally Posted by Jamaika View Post
You tried my version. Is it the same or not?
where? your link is for ffmpeg
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 3rd December 2024, 09:56   #1575  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 898
I added it above. Yes, you run it via ffplay_avx2
https://www.sendspace.com/file/mou7uc

Last edited by Jamaika; 3rd December 2024 at 09:59.
Jamaika is offline   Reply With Quote
Old 4th December 2024, 03:49   #1576  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,641
Quote:
Originally Posted by Jamaika View Post
I added it above. Yes, you run it via ffplay_avx2
https://www.sendspace.com/file/mou7uc
no need to do it in this case

anyway, it worked with
Code:
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(device_type="cpu")
after install w_opencl_runtime_p_2024.2.0.980.exe so it's gpu problem (maybe the driver)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 4th December 2024, 08:16   #1577  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 898
I will just add that I have installed latest opencl.
https://github.com/KhronosGroup/Open...04b5522fdffcd6
Jamaika is offline   Reply With Quote
Old 7th December 2024, 03:30   #1578  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,641
Quote:
Originally Posted by Jamaika View Post
I will just add that I have installed latest opencl.
https://github.com/KhronosGroup/Open...04b5522fdffcd6
it's same as https://i.postimg.cc/02HPRr4f/Untitled.png
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 7th December 2024, 11:34   #1579  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,479
Quote:
Originally Posted by real.finder View Post
with intel igpu in 13th gen
Code:
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()
it's intel problem or KNLMeansCL?
Reproduced.

device_id = 0 (Nvidia driver)
no problems, this setting is using NVidia 1660 on my machine.

device_id = 1: (Intel driver)
artifacts.
This id is using my Intel UHD 750 driver. It looks like if there were internal format or endian-ness problems (e.g. how a 32 bit data is ordered YUVX or XVUY)

Hint: with
Code:
info=true
you can display the actual driver config.

Code:
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=1, info=true)
My processor is 11th Gen Intel(R) Core(TM) i7-11700, but obviously, there must be a hidden driver setting which has to be checked to figure out that a pixel format which is good for one driver why is not good for the other.
pinterf is offline   Reply With Quote
Old 7th December 2024, 12:33   #1580  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 898
Quote:
Originally Posted by pinterf View Post
Hint: with
Code:
info=true
you can display the actual driver config.

Code:
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=1, info=true)
My processor is 11th Gen Intel(R) Core(TM) i7-11700, but obviously, there must be a hidden driver setting which has to be checked to figure out that a pixel format which is good for one driver why is not good for the other.
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=1, info=true)
[avisynth @ 0000023e209d9f60] KNLMeansCL: no compatible opencl platforms available!
(AudioBoost.avs, line 2)
AudioBoost.avs: Unknown error occurred


ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=0, info=true)
KNLMeansCL
Version 1.1.1e
Copyright(C) Khanattila
Bits per sample: 8
Search window: 5x5x3
Similarity neightborhood: 9x9
Num of ref pixels: 74
Local work size: 16x16 - 16x8x3
Platform info
Name: NVIDIA CUDA
Version: OpenCL 3.0 CUDA 12.6.65
Device info
Name: NVIDIA Geforce RTX 3050
Vendor: NVIDIA Corporation
Version: OpenCL 3.0 CUDA 560.94

It works.

Last edited by Jamaika; 7th December 2024 at 12:36.
Jamaika 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 16:40.


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