View Full Version : FastBlur - fast approximate Gaussian blurs
wonkey_monkey
30th June 2019, 17:39
FastBlur v0.4 (https://horman.net/avisynth/download/fastblur0.4.zip)
Doc: https://horman.net/avisynth/FastBlur.html
0.4: can now accept a function to animate blurs
0.3.2: new build from pinterf's GitHub project (https://github.com/pinterf/FastBlur/) which fixes bugs and supports frame properties
0.3.1: enabled clamping to avoid rounding error overflows
0.3: added threads parameter
Having been frustrated one too many times by VariableBlur's GaussianBlur and its bizarre syntax (and wildly variable speed), I've now written FastBlur, which performs an approximately Gaussian blur by repeated box blurs. It's much faster than GaussianBlur by default, and still at least 1.5x faster than GaussianBlur with multi-threading enabled (FastBlur is multi-threaded by default).
It also doesn't suffer from GaussianBlur's long start-up times.
https://i.imgur.com/u8Ffqhq.png
It supports all colour spaces and can optionally dither the output. It's also (approximately) gamma-aware, which means more visually-pleasing blurs (although this should be disabled if you're blurring a mask).
v0.4 can now also accept a function name as a parameter so that blurs can be animated without the overhead of the built-in Animate function:
function blur_function(int frame_no) {
return frame_no * 0.1; // increasing blur over time
}
function blur_function2(int frame_no) {
return [ sin(frame_no * 0.1) * 50, -sin(frame_no * 0.1) * 50 ] // bounce between horizontal and vertical blur (negative values have on effect)
}
FastBlur(ColorBars, "blur_function")
FastBlur(ColorBars, "blur_function2")
Sparktank
30th June 2019, 21:38
Pretty! Thanks!
StainlessS
1st July 2019, 03:23
Looks great, thanks awfully.
Fingerprint link @ you downloads page is 404.
EDIT: Is there a limit to iterations ?
wonkey_monkey
1st July 2019, 09:17
http://horman.net/fingerprint.zip
No limit to iterations. Three is usually plenty, you probably won't see any difference beyond five, and seven would definitely be overkill.
StainlessS
1st July 2019, 10:16
Thanks David.
Currently playing with S_Exlogo, got it working on RGB32 as well as original YUY2 (2.58+).
Will be adding Avs+ colorspaces when I figure out how, and what the new rules are.
Added Post Process Multi-blur as in StringRepeater thing posted yesterday.
Will add your FastBlur as Option, much better than repeated blur(1.58,1.58). [EDIT: Will be the only S_ExLogo required plugin if fastblur option is used.]
By the way, S_ExLogo script probably has more downloads than anything else that I've ever done, so is well popular.
EDIT: Would be lovely if YUY2 was also supported, but no sweat if not.
EDIT: Below new hi-liting in S_ExLogo(),
Outer purple border is clipping area to be ignored (ie black borders, pretend in this case),
Yellow area is the valid logo patch area that will have blurring applied [after the clipping has removed the red area (above yellow patch) from selected logo area, ie logo over black border ignored].
https://i.postimg.cc/C5CnMC6k/ExLogo.jpg (https://postimages.org/)
EDIT: Above, LogoMode=1, ie show coords
S_ExLogo(100,0,100,100,LOGOMODE=1,ClipX=32,ClipY=32,ClipW=-32,ClipH=-32,PostBlurCnt=POSTBLURCNT)
EDIT: For above example image, the [destined to be] blurred patch area in yellow will use only data from Left, Right, and Below valid yellow patch, black border area is ignored so
as to avoid getting a horrid blurred black mess instead of a ghastly logo. [EDIT: Although I guess I could additionally use LetterBox() on border area to blank to black].
EDIT:
[float]:
Blur radius (equivalent to PhotoShop Gaussian Blur's radius)
Any chance you could divulge anything about Photoshop blur radius in docs ?
[I find it real annoying when docs say 'does same as some other plugin arg', esp when other plugin aint no longer available]
EDIT: Guess I'll just pass the buck, and refer user to FastBlur docs, which refer to PhotoShop docs, and who knows what they say.
MysteryX
3rd July 2019, 12:34
EDIT: Guess I'll just pass the buck, and refer user to FastBlur docs, which refer to PhotoShop docs, and who knows what they say.
Sounds like administrative paperwork
wonkey_monkey
3rd July 2019, 13:01
Any chance you could divulge anything about Photoshop blur radius in docs ?
[I find it real annoying when docs say 'does same as some other plugin arg', esp when other plugin aint no longer available]
EDIT: Guess I'll just pass the buck, and refer user to FastBlur docs, which refer to PhotoShop docs, and who knows what they say.
Bigger numbers make more blur, that's all really. The connection with PhotoShop isn't really to assist with usage, it's just so, if you happen to know that in PhotoShop you'd use a radius of 16, you can use the same with FastBlur.
A radius of x is similar to three box blurs of radius x (centre pixel, plus x pixels on either side - perhaps not quite as blurry, but very close). And that's independent of the number of iterations used.
If you just want a box blur, set iterations = 1.
StainlessS
3rd July 2019, 13:24
Bigger numbers make more blur
See, now that wern't so difficult, now add it to your docs :)
Your Fastblur works great in S_ExLogo. [and does not by the way, suffer from RGB64 prob as posted in Devs forum just now]
StainlessS
3rd July 2019, 23:42
Wonkey,
Would you know of any blur type arrangement that when applied to a rectangular area, applied liittle to the perimeter
but greater variable amount to inner of rect. Maybe (sort of) in that well known bell shape in two dimensions. [3rd dim being blur amount bell shape]
EDIT: Or in simple pyramid style, linear to a peak in center.
[EDIT: or variable in between both styles, linear pyramid to bell.
[EDIT: or at max power a [squarish near corners] semi sphere].
EDIT: Maybe I can do it with Fast/Blur and masks, based on maybe distance from nearest edge, or something.
Dogway (in the devs forum, bout 6 months ago, I think) was doing what he called "vignette" or something like that,
think I need something like the opposite of that.
wonkey_monkey
4th July 2019, 09:51
There may be a way with another filter I'm writing but I don't see it being simple. Otherwise some solution with animate, crop, and stack might work, but it would be slow.
StainlessS
4th July 2019, 10:02
Would a mask together with blur be any prob, you think. [nearer white, more blur let through].
EDIT: Dogway thing:- https://forum.doom9.org/showthread.php?p=1872801&highlight=vignette#post1872801
wonkey_monkey
4th July 2019, 10:22
It wouldn't be the same as a true graduated blur, but it might work well enough for your purposes.
StainlessS
4th July 2019, 10:24
I guess a man on a galloping horse might not notice, thanks for your answer, think I might try make mask with the mysterious Expr() thing.
StainlessS
4th July 2019, 10:43
JFYI,
Its this that I would like to try avoid [trouble is, sometimes is desirable to work as it does, and sometimes not]
Original without blur
https://i.postimg.cc/Dy9N72bF/T1.jpg (https://postimages.org/)
blurred [upper left]
https://i.postimg.cc/2yqHfJkV/T2.jpg (https://postimages.org/)
EDIT:
Damn Wonkey, remember that you pointed out a PhotoImage.org "Petrol stations near me" advert,
they gotta be sneaking them in on purpose every now and then,
Had a "Banks near me" link inserted into the "hotlink for forums", if you link the page with advert link, and open another browser page and jump to link, the advert changes to another
different advert. A bit cheeky, but I can live with it.
[EDIT: Maybe only does it sometimes when you dont use your account to upload image]
EDIT: Think I'm gonna totally abandon any thoughts on above, may just make worse sometimes.
vcmohan
8th July 2019, 12:27
in my modplus (http://www.avisynth.nl/users/vcmohan/modPlus/modPlus.html) plugin there is a Gaussian blur filter GBlur. It has a radius and standard deviation (strength ) arguments to control the area of and amount of blur . It works multi thread under avisynth+. Request please check it and whether it works in a similar fashion. It does not take any time to start and does only one iteration. Borders equal to radius will remain unfiltered.
wonkey_monkey
8th July 2019, 13:18
I'm not really sure what you're asking... I'm a bit confused as to how radius and standard deviation work together in GBlur, since in FastBlur the parameter is actually a standard deviation which defines the radius (and just happens to be roughly equal to the radius with the default three iterations).
For what it's worth, the following calls give similar results:
a = FastBlur(1.5, gamma = false)
b = GBlur(8)
Increasing Gblur's standard deviation seems to make the result closer to a box blur, as these are similar:
a = FastBlur(5, iterations = 1, gamma = false)
b = GBlur(8, 10000)
vcmohan
15th July 2019, 14:10
I'm not really sure what you're asking... I'm a bit confused as to how radius and standard deviation work together in GBlur, since in FastBlur the parameter is actually a standard deviation which defines the radius (and just happens to be roughly equal to the radius with the default three iterations).[/code]
In Gaussian Blur depending on the standard deviation and radius values the outer values can be insignificant but are used neverthless increasing the computation time. By increase of std deviation this can be avoided but the blur deviates(theorotically) from pure gaussian. In GBlur it warns if insignificant values (those that will not change the end result) are in the outer part . Use of separable symmetric matrix of coefficients speeds up the process.
hello_hello
19th July 2019, 07:52
Does anyone else have a problem with FastBlur crashing when the width is not mod8, at least for YV12 video. The height mod doesn't seem to matter.
I'm running XP and Avisynth 2.6, if it matters.
Thanks for a nice plugin!
Groucho2004
19th July 2019, 08:39
Does anyone else have a problem with FastBlur crashing when the width is not mod8, at least for YV12 video. The height mod doesn't seem to matter.
I'm running XP and Avisynth 2.6, if it matters.Can't reproduce this. The only requirement is that the dimensions are even.
wonkey_monkey
19th July 2019, 09:32
It's possible there's an SSE instruction you don't have which is only used when the width isn't mod8. Does the following script crash?
colorbars(pixel_type = "yv12", width = 638, height = 480)
FastBlur(10)
pinterf
19th July 2019, 09:42
Does anyone else have a problem with FastBlur crashing when the width is not mod8, at least for YV12 video. The height mod doesn't seem to matter.
I'm running XP and Avisynth 2.6, if it matters.
Thanks for a nice plugin!
Possibly an unaligned Crop issue.
wonkey_monkey
19th July 2019, 10:23
Yes, it definitely could be that, because Avisynth+ keeps everything aligned (and FastBlur, a little lazily, relies on it), but older versions of Avisynth don't.
pinterf
19th July 2019, 10:40
Yes, it definitely could be that, because Avisynth+ keeps everything aligned (and FastBlur, a little lazily, relies on it), but older versions of Avisynth don't.
It's not lazyness, no other use case produces unaligned frames in classic Avisynth, unaligned crop just adjusts internal frame pointers.
It should be used with precaution.
Speed gain is marginal (if any, because next filter would fall back to C version internally if frame is not well aligned), scripts should do the Crop with "align"=true. This parameter is kept in Avisynth+ only for compatibility reasons.
hello_hello
19th July 2019, 12:41
All I can report at this stage is this will crash every time:
Spline36Resize(704,396)
Crop(2,0,-2,0,Align=true)
FastBlur(50)
Whereas this does not:
Spline36Resize(704,396)
Crop(4,0,-4,0)
FastBlur(50)
StainlessS
19th July 2019, 12:50
Tried the first example above with colorbars YV12, no problems with avs+, avs 2.60, avs v2.61alpha, avs Neo.
EDIT: Same with 2nd example script.
hello_hello
19th July 2019, 12:52
That's not fair. It crashes reliably for me. :(
Could you try it without Align=true? Just out of curiosity.
Cheers.
StainlessS
19th July 2019, 12:57
Later, gotta leave right now.
pinterf
19th July 2019, 12:59
That's not fair. It crashes reliably for me. :(
Could you try it without Align=true? Just out of curiosity.
Cheers.
No crash here, either.
What does "crash" means? Exit? Error message?
When fed into Avsmeter it would show the Exception text whether it is C0000005 or illegal instruction, whatever.
StainlessS
19th July 2019, 14:20
Same with Align=False
What player ?
Also, Vdub2 would show error message properly (usually).
pinterf
19th July 2019, 15:33
SSE4.1 is used but hello_hello's processor does not support it.
Tried Intel SDE emulator (https://software.intel.com/en-us/articles/intel-software-development-emulator) with --mrm option
I'm using this tool to emulate either pre-historic :) or too modern (= not available for me, e.g. AVX512) instruction sets.
This --mrm emulates Merom architecture.
AVSMeter 2.9.0 (x86) - Copyright (c) 2012-2019, Groucho2004
AviSynth 2.60, build:Aug 28 2012 [18:17:07] (2.6.0.3)
TID 16 SDE-ERROR: Executed instruction not valid for specified chip (CORE2): 0x16512cb7: pextrb byte ptr [ecx], xmm0, 0x0
Image: C:\Program Files (x86)\AviSynth+\plugins\FastBlur.dll+0x2cb7
Instruction bytes are: 66 0f 3a 14 01 00
TID 20 SDE-ERROR: Executed instruction not valid for specified chip (CORE2): 0x16512cb7: pextrb byte ptr [ecx], xmm0, 0x0
Image: C:\Program Files (x86)\AviSynth+\plugins\FastBlur.dll+0x2cb7
Instruction bytes are: 66 0f 3a 14 01 00
TID 19 SDE-ERROR: Executed instruction not valid for specified chip (CORE2): 0x16512cb7: pextrb byte ptr [ecx], xmm0, 0x0
Image: C:\ProTID 23 SDE-ERROR: Executed ig
wonkey_monkey
19th July 2019, 16:48
That makes sense. Pixels are written out in groups of four using older SSE instructions, but any stragglers get dealt with using newer instructions. For YV12 that means you have to be mod8 so that the chroma channels are mod4.
If you pad the video to the right by repeating the final column of pixels, the FastBlur result (after cropping again) should be identical.
StainlessS
19th July 2019, 17:53
Source available yet so as I can recompile, I am unlikely to use if not OK on my other machines [well once in a blue moon I might use it on No1 m/c].
(one a P4 with hyperthreading, no SSE4.1 , I'm pretty sure.
My core2 Q6600 has SSE4 I think but not SSE4.1, cant check at moment, I knocked it off a table a coupla days back and CPU + heatsink is currently detached from Motherboard).
That Emulator sounds pretty nifty.
EDIT: From The emulator FAQ:
Q: What are the system requirements?
Intel® SDE will run on IA-32 or Intel® 64 processors running Windows or Linux or OS X operating systems.
Q: What are the CPUID requirements?
Pin, and thus Intel SDE requires a Pentium 4 or later processor.
EDIT: Emulator [Windows] Downloads 17MB + 1.2MB. [Req:- Intel devs account (not so difficult to sign up, Free and pretty quick IIRC + access to loads of Intel stuff)]
EDIT: Looks like Q6600 only has SSE3/SSSE3, no SSE4.
hello_hello
20th July 2019, 06:55
Sorry, I was gone for a while but I see pinterf found the cause. It's nice to know I wasn't going mad. :)
StainlessS
20th July 2019, 07:58
It's nice to know I wasn't going mad. :)
A rather large conclusion to jump to based on Pinterf comment. :)
hello_hello
20th July 2019, 14:45
Here's what AVS meter shows when it crashes. Usually the program opening the script simply vanishes, so that's as close as I get to an error message. Is there a way to dig out more info?
https://i.postimg.cc/X7mxkq2h/AVSMeter.gif
StainlessS
20th July 2019, 16:12
Easiest way to see invisible error message is to right click on avs and Open with VDub2.
Here result of loading empty avs file info VD2 (I was kinda curious what it would produce):-
https://i.postimg.cc/CRp0nr4S/Empty.png (https://postimg.cc/CRp0nr4S)
MPC-HC just gives a "Scripts return was not a video clip (is the undefined value)".
hello_hello
20th July 2019, 21:30
It looks like Pinterf was correct.
https://i.postimg.cc/N0S3DSt7/VD.gif
For the function I'm using FastBlur for (blurring borders), I originally did something like this:
Left = Blend_Left.GaussResize(BorderL, Total_Height)\
.FastBlur(50, dither=true)\
.AddGrain(var=5.0, constant=true)
I worked around it by following wonkey_monkey's advice. Inside a function it's not a big hassle.
LMod = ((BorderL % 8) == 0) ? 0 : 8 - (BorderL - (floor(float(BorderL) / 8.0) * 8))
Left = Blend_Left.GaussResize(BorderL, Total_Height)\
.PointResize(BorderL+LMod, Total_Height, -LMod, 0, BorderL+LMod, 0)\
.FastBlur(50, dither=true)\
.Crop(LMod, 0,0, 0)\
.AddGrain(var=5.0, constant=true)
wonkey_monkey
25th December 2019, 01:40
Updated to fix a rounding/accumulation bug with floating point clips.
http://horman.net/avisynth/download/FastBlur.zip
Adrammelech
30th December 2019, 20:11
How does this compare with `Dither_box_filter16()` when using iterations=1
and gamma=false?
I tried matching the output between the two but I couldn't get the equivalent
radius from one to the other.
And since I'm on it, would you be willing to add the usual `y, u, v`
parameters from MaskTools/DitherTools, for convenience?
wonkey_monkey
31st December 2019, 12:07
FastBlur(9, iterations = 1, gamma = false) is pretty close. In general multiplying by 9/16 seems to work for other radiuses.
There seems to be a border bug in the version I recently uploaded which I'll sort out later. EDT: never mind, there was no bug, it was a dithertools misunderstanding.
Copying all the functionality of y/u/v seems more trouble than its worth at the moment.
StainlessS
31st December 2019, 18:38
YUY2 would also be lovely if not too much bother [we all know just how eager you are to please :) ]
Adrammelech
31st December 2019, 19:51
I don't know, it doesn't quite seem to match to me, especially after
immediately going with smaller radii than the one you presented in such 9:16
ratio.
I ask mostly because I've been wanting to replace many of the stack16
filters/functions I normally use (particularly from DitherTools) to proper
HBD that AviSynth+ supports, and this one seems to be the closest to fit the
criteria for a box blur.
wonkey_monkey
31st December 2019, 21:23
It was visually indistinguishable to me. Can you post a comparison screenshot and/or your script?
wonkey_monkey
31st December 2019, 22:49
YUY2 would also be lovely if not too much bother [we all know just how eager you are to please :) ]
:rolleyes:
Download it again (now converts internally to YV16 and back)
StainlessS
31st December 2019, 23:40
What a lovely XMas + New Year pressy, thanx muchly :)
EDIT: Would also be good if somewhere there was some indication of version/date eg
zip file, doc file, or version resource details (or even via some eg "Version" arg showing curent version on frame).
Its real easy to add version resource stuff.
From Uglarm,
version.h [Stuff generally changing per plugin or version in BLUE]
#define Version_Major 0
#define Version_Minor 00 // Two Digits
#define Version_Beta 00 // Two Digits (00 = Not beta)
#define MyPlugName "Uglarm\0"
#define MyVersion_Copyright "Krzysztof Wojdon\0"
#define MyVersion_Implementor "Milan Cutka\0"
// #x Encloses the argument x in quotes.
// #@x Encloses the argument x in single quotes.
// ## Concatenates tokens used as arguments to form other tokens.
#define _STR(x) #x
#define STR(x) _STR(x)
#define MyVersion_Number Version_Major,Version_Minor,Version_Beta,0
#if(Version_Beta > 0)
#define MyVersion_String STR(Version_Major) "." STR(Version_Minor) ".Beta" STR(Version_Beta)
#else
#define MyVersion_String STR(Version_Major) "." STR(Version_Minor) "." STR(Version_Beta) "." STR(0)
#endif
// Below MUST BE set for avs v2.58 and avs+ x64, Configuration Properties/Resources/General/PreProcessor Definitions
// Avs v2.58, Add definition 'AVISYNTH_PLUGIN_25'
// Avs+ v2.60 x64, Add definition '_WIN64'
#ifdef AVISYNTH_PLUGIN_25
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_25.dll\0"
#define MyDescription "Avisynth v2.58 32 bit CPP Plugin\0"
#else
#ifdef _WIN64
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_x64.dll\0"
#define MyDescription "Avisynth+ v2.60 64 bit CPP Plugin\0"
#else
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_x86.dll\0"
#define MyDescription "Avisynth+ v2.60 32 bit CPP Plugin\0"
#endif
#endif
resource.h
#ifndef IDC_STATIC
#define IDC_STATIC (-1) // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#endif
#include "Version.h"
resource.rc
#include <windows.h>
#include <commctrl.h> // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#include <richedit.h> // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#include "resource.h"
//
// Version Information resources
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION MyVersion_Number
PRODUCTVERSION MyVersion_Number
FILEOS VOS_NT
FILETYPE VFT_DLL //VFT_DLL for DLL, VFT_APP for application
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", MyComments
VALUE "FileDescription", MyDescription
VALUE "FileVersion", MyVersion_String
VALUE "LegalCopyright", MyVersion_Copyright
VALUE "OriginalFilename", MyOriginalDllName
VALUE "ProductName", MyPlugName
VALUE "SpecialBuild", MyVersion_Implementor
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
For x64, Need to add _WIN64 to CPP Preprocessor Definitions, also to Resource Preprocessor Definitions.
NOTE, in VS2008 Express, resource editor is not supplied, can right click on an rc file, and select "Open With", and then
"Source Code (Text) Editor (Default)",
and click, "Set Default".
Then you can simply edit as text file, is real easy.
Once you figure it out, just copy above files into new source directory, edit plugin name and version in Version.h,
add the _WIN64 stuff to Project, and thats pretty much it.
EDIT: Stuff to edit in Version.h, per plugin,
#define Version_Major 0
#define Version_Minor 00 // Two Digits
#define Version_Beta 00 // Two Digits (00 = Not beta)
#define MyPlugName "Uglarm\0"
#define MyVersion_Copyright "Krzysztof Wojdon\0"
#define MyVersion_Implementor "Milan Cutka\0"
EDIT: or from TitleBar plugin
#define Version_Major 1
#define Version_Minor 02 // Two Digits
#define Version_Beta 00 // Two Digits (00 = Not beta)
#define MyPlugName "TitleBar\0"
#define MyVersion_Copyright "(c) 2018, Stephen Jones AKA StainlessS\0"
#define MyVersion_Implementor "(c) 2018, Stephen Jones AKA StainlessS\0"
Have a guddun :)
EDIT: Or more here:- https://forum.doom9.org/showthread.php?p=1834694&
EDIT: I dont bother to #include resource.h into project (its included via resource.rc)
https://i.postimg.cc/Rhv65nMp/Untitled-00.jpg (https://postimages.org/)
And in the CPP file
#include "compiler.h"
#include <windows.h>
#include <stdio.h>
#include <math.h>
//#ifdef AVISYNTH_PLUGIN_25 // ONLY if doing v2.5 plug, also need add AvisynthPluginInit2 stuff where AddFunction goes
// #include "Avisynth25.h"
//#else
#include "Avisynth.h"
//#endif
StainlessS
1st January 2020, 01:06
With this very first on-site post of 2020GMT, I'de like to wish everyone a happy New Year 2020, and while I'm at it, a Merry XMas 2020 too (I'm bound to be first at that, I think).
real.finder
2nd February 2021, 05:33
There's no source code yet because it relies on an unfinished library for another filter, but when that's finished I'll release the source code for both.
still not yet?
in my modplus (http://www.avisynth.nl/users/vcmohan/modPlus/modPlus.html) plugin there is a Gaussian blur filter GBlur. It has a radius and standard deviation (strength ) arguments to control the area of and amount of blur . It works multi thread under avisynth+. Request please check it and whether it works in a similar fashion. It does not take any time to start and does only one iteration. Borders equal to radius will remain unfiltered.
I'm not really sure what you're asking... I'm a bit confused as to how radius and standard deviation work together in GBlur, since in FastBlur the parameter is actually a standard deviation which defines the radius (and just happens to be roughly equal to the radius with the default three iterations).
For what it's worth, the following calls give similar results:
a = FastBlur(1.5, gamma = false)
b = GBlur(8)
Increasing Gblur's standard deviation seems to make the result closer to a box blur, as these are similar:
a = FastBlur(5, iterations = 1, gamma = false)
b = GBlur(8, 10000)
In Gaussian Blur depending on the standard deviation and radius values the outer values can be insignificant but are used neverthless increasing the computation time. By increase of std deviation this can be avoided but the blur deviates(theorotically) from pure gaussian. In GBlur it warns if insignificant values (those that will not change the end result) are in the outer part . Use of separable symmetric matrix of coefficients speeds up the process.
Variance = 4.0
rad=round(Variance*2)
#~ sh_Padding(rad,rad,rad,rad).GBlur(rad,sqrt(Variance)).crop(rad,rad,-rad,-rad)
#~ BinomialBlur(Variance)
FastBlur(sqrt(Variance),iterations=rad,gamma=false)
seems all 3 are same to me, but I will not use FastBlur since there are no source code for it, Cuz I will not repeat the past mistakes like using frfun7, SmoothAdjust and many others and then pray for Miracle to happen by someone reverse engineer them (like what happen in sangnom2 or awarpsharp2) or the author give the source code after begging (like what happen in checkmate)!
vcmohan gblur one as it also is not a perfect replace for BinomialBlur https://forum.doom9.org/showpost.php?p=1933514&postcount=13
DTL
3rd February 2021, 15:06
[size=6]
Having been frustrated one too many times by VariableBlur's GaussianBlur and its bizarre syntax (and wildly variable speed), I've now written [b]FastBlur, which performs an approximately Gaussian blur by repeated box blurs.
[/code]
You can very good cosplay FIR gaussian transform with much smaller in kernel size IIR filter and also almost 'radius-independent' so it have one processing time for any blur value. There is even full working SIMD-optimized demo on intel website so I think this plugin is port of IIR-based gauss-blur for Avisynth.
Not sure how it compared with 'repeated box blurs' approach for speed.
I even thinking of IIR-based convolution for 2D/planar resampler for save some time but it looks much harder to cosplay Jinc kernel with limited number samples of IIR filter kernel.
wonkey_monkey
9th March 2021, 18:46
I've updated the Zip file to include what is hopefully the complete source code, now that I've rewritten one of the dependent libraries to not be a mess of files. There's no .sln file or anything though - blame Visual Studio for not supporting hard links, otherwise it would have been simple.
http://horman.net/avisynth/download/FastBlur.zip
StainlessS
9th March 2021, 19:00
Thanks Wonkey.
Does it have any particular version number, or do we just choose our own :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.