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. |
15th April 2020, 06:46 | #1 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
[Neo] FFT3D / DFTTest
This thread serves Neo-FFT3D and Neo-FFTTest.
Neo filters family is not to be confused with AviSynth-Neo. Neo filters family is not affiliated in any way with AviSynth-Neo. [Neo] FFT3D → GitHub FFT3DFilter is a 3D Frequency Domain filter - strong denoiser and moderate sharpener. It was originally written by Alexander G. Balakhnin aka Fizick, and later modified by martin53 for AviSynth 2.6 and later modified by Ferenc Pintér aka pinterf for further improvement, high bit depth, and more. Kudos to them for creating and improving this fantastic tool. Difference compared to pinterf/FFT3DFilter
Result bit-identicalness
[Neo] DFTTest → GitHub DFTTest is a 2D/3D Frequency Domain denoiser. It was originally written by tritical, and later modified by Ferenc Pintér aka pinterf for further improvement, high bit depth, and more. VapourSynth-DFTTest was ported to VapourSynth interface by HolyWu with further clean ups and efficient SSE2 and AVX2 SIMD routines. Kudos to them for creating and improving this fantastic tool. Difference compared to pinterf/dfttest
Difference compared to HomeOfVapourSynthEvolution/VapourSynth-DFTTest
Result bit-identicalness
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median Last edited by MeteorRain; 26th March 2021 at 17:39. |
15th April 2020, 08:10 | #2 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
I took a peek at your dual interface, I think the argument fetching part, particularly the part dealing with array parameters could be improved.
I don't think it's a good idea to assume array parameters are std::vector<T>, and to erase the vector while fetching the arguments. people might not use vector to store array parameters, it could also be std::array or a pointer to some pre-allocated memory or something else for various reasons. it's also not a good practice to erase the parameter container, the container might hold more default values than the number of values specified by the user. you lose all default values when you erase the container and the user loses the flexibility to specify a partial array, leaving the rest of default values untouched. I think it's best if the argument object itself behaves like a container (it does not necessarily to be an actual container) and let the filter developer decide how the arguments should be handled. Code:
// this is bad args.read("sigma_array", sigma_array); // this is better, and allows the user to specify a partial array for (auto x : range{ args["sigma_array"].size() }) sigma_array[x] = args["sigma_array"][x]; // or if you don't need the flexibility to specify a partial array for (auto sigma : args["sigma_array"]) sigma_array.push_back(sigma); Last edited by feisty2; 15th April 2020 at 08:20. |
15th April 2020, 08:54 | #3 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
Thanks for taking your time to look at the code. You are absolute right about parameter processing. Part of those code was copied from my previous projects years ago, and there's lots of room for improvement.
At this moment I'm trying to make scaffolding as quick as possible (this wrapper was made after your wrapper, so you know it's still very young). And my hope is if anyone has interests they can send merge requests to improve it. Of course, at this moment I'd aim at C++17 and not 20 or 23. Let's wait until C++20 or 23 becomes mainstream before moving forward. Your point about array makes a lot sense. I'll need some time to think about it. For now vectors are adequate to my needs, but I'll try to make it better. As you suggested, begin() and end() would be a good start.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median |
15th April 2020, 12:00 | #4 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
Please test dfttest beta1.
Example: neo_dfttest(ftype=0, sigma=8.0, sigma2=12.0, pmin=0.0, pmax=500.0, sbsize=4, smode=1, sosize=2, tbsize=1, tmode=0, tosize=0, opt=0, zmean=True, y=3, u=3, v=3, nlocation="0,0,20,40", slocation="0.0:3.0, 0.3 14.0 1.0,10.0", ssystem=1, threads=6) Syntax is similar to original AVS dfttest except:
Let me know any issues.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median Last edited by MeteorRain; 15th April 2020 at 12:36. |
15th April 2020, 12:06 | #5 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,990
|
Quote:
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
15th April 2020, 12:10 | #6 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
dither > 2 uses Mersenne Twister random number generator to dither data, so outputs would never be the same every time. Whether there are rounding "errors" or "differences" no longer matters, I think.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median |
15th April 2020, 12:16 | #7 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,990
|
Its just that some use a translator to read docs, and sometimes translators can change meaning a little and may result in much exaggerated significance.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
15th April 2020, 12:19 | #8 | Link | |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,804
|
Quote:
- 8-16 + 32 bit depth works fine - clip.neo_dfttest.DFTTest(ftype=0, sigma=8.0, sigma2=12.0, pmin=0.0, pmax=500.0, sbsize=4, smode=1, sosize=2, tbsize=1, tmode=0, tosize=0, opt=0, zmean=True, nlocation="0,0,20,40", slocation="0.0:3.0, 0.3 14.0 1.0,10.0", ssystem=1, threads=6) produces Code:
Core freed but 5 filter instance(s) still exist Core freed but 5 filter instance(s) still exist Core freed but 537600 bytes still allocated in framebuffers Core freed but 537600 bytes still allocated in framebuffers The parameters above triggers Code:
ValueError: invalid literal for int() with base 10: '0,0,20,40' Code:
neo_dfttest.DFTTest(sigma=8, sigma2=8) -- vapoursynth dfttest 7.9 fps -- vapoursynth neo dfttest 5.5 fps
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
|
15th April 2020, 12:34 | #9 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
Yea I haven't tested thoroughly on VS.
On VS nlocation and slocation and ss? are still arrays. I should have said those changes only apply to AVS. On VS array inputs are the same as vapoursynth-dfttest. I'll look on memory leaks later. Speed difference is probably because I've set it as serialized filter (so single threaded from VS point of view) for debugging purpose. Will change to parallel on release.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median |
15th April 2020, 12:43 | #10 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,804
|
So this would be correct?
Code:
neo_dfttest.DFTTest(nlocation=[0,0,20,40])
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
15th April 2020, 22:23 | #11 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
beta2
Fixes fmParallel Fixes nlocation crashes When nlocation does not crash, there seems no memory leaks found.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median |
16th April 2020, 00:23 | #12 | Link | |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,804
|
Quote:
Code:
Core freed but 1 filter instance(s) still exist Core freed but 1 filter instance(s) still exist
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
|
16th April 2020, 00:31 | #13 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
Supplying incorrect parameters may trigger an error with some temporary data not being freed correctly. I'll check where it leaks, but I don't think it's a big issue.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median |
16th April 2020, 00:34 | #14 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
I did some tests
Code:
ColorBars(width=640, height=480, pixel_type="yv12") admfilter(custom_filter="neo_fft3d(Sigma=(adSigma+1.0)/f)") Prefetch(4) I get and with https://forum.doom9.org/showthread.p...16#post1906016 it's just freeze! and sometimes and sometimes same as the 1st one
__________________
See My Avisynth Stuff |
16th April 2020, 01:06 | #15 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
I can't get your script work. I assume I should use "Advanced Denoising and anime bob v1.87"?
I get -- I don't know what 'MotionRampadc' means.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median |
16th April 2020, 01:23 | #16 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
Quote:
and from that error you get seems you didn't use any runtime MT fixed avs+ (both test avs+ builds I post) edit: also you maybe missed this GRunT update pinterf made years ago
__________________
See My Avisynth Stuff Last edited by real.finder; 16th April 2020 at 01:28. |
|
16th April 2020, 01:38 | #17 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
Okey grunt it is. Now I can see it crashed. Let me check.
That's easy to find. Filter initialization was executed concurrently, crashed the fftw library. I don't know if initialization should be thread safe or not. I'll add a mutex then.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median Last edited by MeteorRain; 16th April 2020 at 01:43. |
16th April 2020, 01:47 | #18 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
Quote:
edit: it fixed since this one https://forum.doom9.org/showthread.p...77#post1904777
__________________
See My Avisynth Stuff |
|
16th April 2020, 02:07 | #19 | Link |
結城有紀
Join Date: Dec 2003
Location: Oregon
Posts: 895
|
Yes my solution is similar to that. Usually initialization is single threaded, so you don't have to think about thread safety. In this case multiple instances were initialized so there needs to be a global mutex there. pinterf used static global, and I used a static local, the result would be similar.
beta3 thread-safe initialization.
__________________
My Projects x265 - Yuuki-Asuna-mod TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median Last edited by MeteorRain; 16th April 2020 at 02:14. |
16th April 2020, 03:07 | #20 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
Quote:
btw, how you end-up with this case? https://forum.doom9.org/showthread.p...43#post1905043 and aside from that, do you plan to did the same with all/most/some https://github.com/HomeOfVapourSynthEvolution ? (Dual interface with neo renames)
__________________
See My Avisynth Stuff Last edited by real.finder; 16th April 2020 at 03:35. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|