View Full Version : [Neo] Vague-Denoiser
MeteorRain
19th April 2020, 09:47
Neo filters family is not to be confused with AviSynth-Neo. Neo filters family is not affiliated in any way with AviSynth-Neo.
[Neo] Vague Denoiser → GitHub (https://github.com/HomeOfAviSynthPlusEvolution/neo_Vague_Denoiser)
Vague Denoiser is a wavelet based denoiser.
Basically, it transforms each frame from the video input into the wavelet domain, using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to the obtained coefficients. It does an inverse wavelet transform after. Due to wavelet properties, it should give a nice smoothed result, and reduced noise, without blurring picture features.
It was originally written by Lefungus, and later modified by Kurosu and Fizick for further improvement. VapourSynth-VagueDenoiser was ported to VapourSynth interface and refactored by HolyWu. Kudos to them for creating and improving this fantastic tool.
Difference compared to VapourSynth-VagueDenoiser
Dual interface, supporting AviSynth+ and VapourSynth
Added SSE and AVX routine
Result bit-identicalness
Neo-Vague-Denoiser C - VapourSynth-VagueDenoiser C: identical
===== ===== ===== =====
Neo-Vague-Denoiser SSE - C: non-identical due to order of floating point addition and multiplication
Neo-Vague-Denoiser AVX - C: non-identical due to order of floating point addition and multiplication
PSNR on default parameters:
8-bit ~93dB; 16-bit ~115dB
Neo-Vague-Denoiser SSE - AVX: identical
StainlessS
19th April 2020, 10:06
Right from the beginning, my favourtite spatial denoiser, thanks very much.
EDIT: To below. yip, will do, again thanx :)
MeteorRain
19th April 2020, 10:07
You are very welcome. Definitely let me know if you see something wrong with it.
ChaosKing
19th April 2020, 10:36
32 float input crashes vsedit.
Smaller resolutions have a green border
clip = core.std.BlankClip(format=vs.YUV420P8, width=480, height=480, length=500)
clip = core.neo_vd.VagueDenoiser(clip)
Tested clang version x64 on win10 ryzen 2600
EDIT green border is only with opt=4 or 5 visible => AVX stuff.
MeteorRain
19th April 2020, 11:04
Please try r1v2.
Atak_Snajpera
19th April 2020, 13:42
Right from the beginning, my favourtite spatial denoiser, thanks very much.
EDIT: To below. yip, will do, again thanx :)
Too bad that it introduces reduction of resolution.
Original
https://i.postimg.cc/qvvkvBWq/job1-org.png
neo_vd(threshold=10.0, nsteps=6, y=3, u=3, v=3)
https://i.postimg.cc/1twSj8VC/job1-vd10.png
KNLMeansCL(d=1, a=2, s=4, h=6, device_type="GPU", device_id=0)
https://i.postimg.cc/nL5V58Rz/job1-knl6.png
One thing this filter does best is simulation of compression artefacts ;)
threshold=25.0
https://i.postimg.cc/52zqR1N7/job1-vd25.png
StainlessS
19th April 2020, 14:07
Dear me, never tried a threshold anywhere near as high as 25.0 or even 10.0.
My reminder thingy
# VagueDenoiser:- YUY2, YV12
# threshold:- filtering strength. 1-1.5 light : 2-3 strong)
# -ve NO LUMA SMOOTHING
# 0 = Automatic estmimation (DEFAULT)
# ChromaT = Chroma thresholding
# -ve NO Chroma SMOOTHING
# 0 = Automatic estmimation (DEFAULT)
# interlaced:- Process interlaced fields seperately. YV12 Only else ignored.
#VagueDenoiser(threshold=0.8,method=1,nsteps=6,chromaT=0,interlaced=false) # EDIT: These are what I would use as starting values.
I dont have a machine that is fast enough for that KNLMeansCL() whotsit. [I dont care how long it takes, but I do have my limits :) ]
EDIT: I also have little interest in cartoons.
ChaosKing
19th April 2020, 14:17
Please try r1v2.
All good now :thanks:
real.finder
19th April 2020, 14:48
Finally, thanks :thanks:
Atak_Snajpera
this filter also good for remove the bad ugly dither https://i.postimg.cc/tTBKJLbL/title00-track1-eng002928.png
with convertbits(16).neo_vd().convertbits(8) https://i.postimg.cc/sDT48smF/title00-track1-eng002928v.png
tormento
19th April 2020, 15:26
[Neo] Vague Denoiser
Are you the same Neo who did Neo AviSynth or your "Neo" is just a prefix to the filters?
If you were the same person, I'd be begging you to port all this to CUDA or OpenCL. :eek:
real.finder
19th April 2020, 16:32
Are you the same Neo who did Neo AviSynth or your "Neo" is just a prefix to the filters?
If you were the same person, I'd be begging you to port all this to CUDA or OpenCL. :eek:
no, the one who made avs neo is nekopanda (I think he don't even has doom9 id)
you should say OpenCL or CUDA :sly: cuz OpenCL work even with cpu only (not all cpus though)
tormento
19th April 2020, 17:01
no, the one who made avs neo is nekopanda
We need to do some recruiting for OpenCL and CUDA programming. Some filters definitely needs performance boost.
FranceBB
20th April 2020, 16:46
Works fine on Windows XP.
Thanks! ;)
it transforms each frame from the video input into the wavelet domain, using Cohen-Daubechies-Feauveau 9/7.
It does indeed.
Then it applies some filtering to the obtained coefficients. It does an inverse wavelet transform after. Due to wavelet properties, it should give a nice smoothed result, and reduced noise, without blurring picture features.
The Wavelet transform is one of the transform I like, although it's not my favorite.
It sure has a different approach when it comes to processing 'cause instead of dividing the image in blocks and macroblocks of arbitrary sizes (as long as they're square) like other transform, it processes the whole picture as a whole single block thus avoiding classic edge artifacts. Whether it's useful on denoise as well other than encoding I don't know, but the thing is that the last time I used this denoiser was a very long time ago and I didn't really plan to use the old Vague Denoiser in any modern footage, but since you updated it, I downloaded it, tested it and kept it in my sacred plugins folder 'cause, you know, it's just nice to have. :)
I also have little interest in cartoons.
Well, perhaps until your grandchildren will ask you to watch them with them; in that case you'll either like them or hate them for the rest of your life xD (just joking, just joking)
As a matter of fact, I began learning about AVS in 2006 only because of anime (i.e cartoons for adults), but I've encoded less and less of them as I grew up, mostly because of my job concerning only real life stuff and... also because I kinda grew up; still from time to time, although rarely, I still help the fansub I started with years ago. :')
If someone asks me something like "Hey, let's watch Your Name (https://en.wikipedia.org/wiki/Your_Name)", I'm still keen to watch it and I enjoy it.
Of course, I would NEVER watch stuff like cartoons for children that air on Cartoon Network or stuff like that.
Fun story: there was a time in 2016 when I had to QC all of them after encoding (it was my job T_T) and unfortunately I had to watch this kind of crap for children that I hated from the bottom of my hearth. (https://en.wikipedia.org/wiki/Star_vs._the_Forces_of_Evil) But it was my job... I couldn't do anything about it... :(
feisty2
20th April 2020, 17:56
don't you guys differentiate cartoon (comics in the US) and anime (comics in Japan)?
FranceBB
20th April 2020, 18:04
don't you guys differentiate cartoon (comics in the US) and anime (comics in Japan)?
We do, but anime nowadays are way different.
We can think about them as cartoons but for adults: they are very well developed and they have very good scripts, capable of describing in detail how characters grow up, thus sharing important messages about life, about friendship and so on...
Back when StainlessS was young, however, japanese anime were mainly about giant robots fighting against each other, which many people didn't find very appealing for obvious reasons...
He's from a completely different generation
tormento
20th April 2020, 19:11
This thread has definitely gone to hell.
real.finder
26th April 2020, 17:46
This thread has definitely gone to hell.
why?
We do, but anime nowadays are way different.
We can think about them as cartoons but for adults: they are very well developed and they have very good scripts, capable of describing in detail how characters grow up, thus sharing important messages about life, about friendship and so on...
Back when StainlessS was young, however, japanese anime were mainly about giant robots fighting against each other, which many people didn't find very appealing for obvious reasons...
He's from a completely different generation
not all USA cartoons for children, there are many for adults like South Park
but most cartoons don't has attractive drawing as most Japanese Animes
@MeteorRain
I note 16bit output not same as 8bit, is it normal or there are some bug?
tormento
26th April 2020, 17:57
why?
I was laughing on my own about misconceptions about anime/cartoons.
Some of the most quoted "anime" aired now are written, produced and drawn in other countries than Japan. Not because it costs less but because they are trendy and other country studios are interested to produce their own.
On the 1st best 10 anime aired now, 2/3 are chinese and chinese spoken.
Personally I trained my ear to japanese during these years and it's really hard to listen to them in mandarin.
Please keep also in mind that the so called "anime" or "manga" are the same as "cartoon" or "stripe", just with a different style.
Italian stripes, for examples, have worldwide recognized artists like Milo Manara or Hugo Pratt, with their unique style, completely different from american ones, with deep introspection of characters and stellar graphics. More modern artists, such as Zerocalcare, has chosen to go to a more "manga" style stripe, because it's what people want now, and he uses that style to spot life dilemmas, always in a bittersweet mood.
So, IMHO there is no difference between anime or cartoons, there are differences in the style and the cultural influence of every single nation.
real.finder
3rd May 2020, 03:35
@MeteorRain
I note 16bit output not same as 8bit, is it normal or there are some bug?
It is very clear with luma_histogram (https://forum.doom9.org//showthread.php?t=161411)
MeteorRain
3rd May 2020, 06:20
A minimal script please.
I tried the below and they look the same.
convertbits(16).rel_neo_vd().convertbits(8).luma_histogram()
rel_neo_vd().luma_histogram()
real.finder
3rd May 2020, 16:36
ColorBars
converttoyv12
AddGrainC
Interleave(neo_vd.luma_histogram(),convertbits(16).neo_vd().convertbits(8).luma_histogram())
https://i.postimg.cc/WzzS2HxP/2020-05-03-08-28-58.gif (https://postimages.org/)
MeteorRain
3rd May 2020, 19:18
Removing float to int rounding solved the problem. But to be honest I'm not quite sure we should remove the rounding.
The following code
ptr[x] = std::min(std::max(static_cast<int>(pad[x] + 0.5f), 0), ep.peak);
0.5f does not scale with bit depth, so if input is 158.5 in 8bit then it rounds up to 159, but 2536 in 12bit rounds to 2536 and bit-shifting to 158 in 8bit.
If I remove +0.5 then the results are identical, but the truncated result may not be as accurate as rounded.
What do you think?
real.finder
4th May 2020, 02:08
Removing float to int rounding solved the problem. But to be honest I'm not quite sure we should remove the rounding.
The following code
ptr[x] = std::min(std::max(static_cast<int>(pad[x] + 0.5f), 0), ep.peak);
0.5f does not scale with bit depth, so if input is 158.5 in 8bit then it rounds up to 159, but 2536 in 12bit rounds to 2536 and bit-shifting to 158 in 8bit.
If I remove +0.5 then the results are identical, but the truncated result may not be as accurate as rounded.
What do you think?
identical mean both be like 8bit or like 16bit? the 8bit should be the reference (since it like the old Vague-Denoiser)
and why it add 0.5f?
and since I am not a programmer, let's see what others say like pinterf
pinterf
4th May 2020, 09:38
For most cases float intermediate value is always rounded before casting (=truncating) to an integer. Adding a 0.5 plus a truncate to integer is like rounding to the nearest integer.
If the missing rounding is probably a bug and incorrect then we shouln't keep any plugin with the old (wrong) behaviour.
kedautinh12
30th May 2021, 16:59
real.finder updated new commits to fix Update AVS headers and copy frame properties for AVS+ and VS. If anyone interested
https://github.com/HomeOfAviSynthPlusEvolution/neo_Vague_Denoiser/pull/3/commits/b8f208ba76baaf6ce6847c1ce79311366112ed64
joearmstrong
13th February 2022, 11:15
I don't want to remove all noise from the video source, I just want to clean the video a bit for better compressibility. I refuse temporal denoisers because of the annoying scene change issue - during scene changes some frames are noisier than others due to temporal processing. After many testings I finally found this fantastic spatial denoiser which gave me the best results. With threshold=3.5 I succesfully cleaned a very noisy video - compressibility is much better now. Thank you for this useful denoiser!
joearmstrong
14th February 2022, 20:00
I'm missing the Wiener option from the original VagueDenoiser for 2-pass denoising. Can this function be implemented again?
Ceppo
24th February 2022, 01:16
MeteorRain:
I don't know where to write this, since I can't find a post. But "minideen" doesn't work if I preview the avs with a player. Is it just me?
kedautinh12
24th February 2022, 01:31
You can create issue here
https://github.com/HomeOfAviSynthPlusEvolution/MiniDeen/issues
Ceppo
24th February 2022, 08:04
Thank you!
banaguitar
7th September 2022, 04:54
Use AVSPmod32 and 32 bit dll, but it crashes
Don't know why
LigH
2nd October 2024, 18:17
Issue with neo-Vague-Denoiser r2 (https://github.com/HomeOfAviSynthPlusEvolution/neo_Vague_Denoiser/issues/7):
Processing 1920×800 px video in AviSynth+ with multithreading, neo_vd(nsteps=7) crashes VirtualDub2 x64 (it simply closes without any error message), while VirtualDub2 x86 runs with neo_vd(nsteps=9).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.