VariableBlur/GaussianBlur

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Syntax and Parameters)
m (minor formatting)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
[[Category:Plugin_Filters]]
+
{{FilterCat4|External_filters|Plugin_functions|Adjustment_filters|Blurring}}
[[Category:Blurring]]
+
 
'''Back to [[VariableBlur#Filters|VariableBlur]] ←'''
 
'''Back to [[VariableBlur#Filters|VariableBlur]] ←'''
 
== Description ==
 
== Description ==
:GaussianBlur works by converting the image to the frequency domain using FFTW and complex multiplying it with the Gaussian  
+
:GaussianBlur works by converting the image to the frequency domain using FFTW and complex multiplying it with the Gaussian kernel in the frequency domain before converting the result back to the spatial domain giving the same result as doing a convolution in the spatial domain just faster for large kernel sizes.
:kernel in the frequency domain before converting the result back to the spatial domain giving the same result as doing a convolution in the spatial domain just faster for large kernel sizes.
+
 
<br>
 
<br>
  
 
== Requirements ==
 
== Requirements ==
:- [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|Progressive]] input only  
+
* [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|Progressive]] input only  
:- Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]
+
* Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]
  
:- GaussianBlur requires an [[SSE2]] capable CPU
+
: * GaussianBlur requires an [[SSE2]] capable CPU
 
<br>
 
<br>
  
Line 18: Line 16:
 
<br>
 
<br>
 
::{{Par2||clip| }}
 
::{{Par2||clip| }}
:::Input clip
+
:::Input clip.
 
<br>
 
<br>
 
::{{Par2|varY|float|1.5}}
 
::{{Par2|varY|float|1.5}}
Line 26: Line 24:
 
<br>
 
<br>
 
::{{Par2|border|int|4}}
 
::{{Par2|border|int|4}}
:::Setup how the border of the image is threated.
+
:::Setup how the border of the image is treated.
:::Posible values:
+
:::Possible values:
 
::::*-255 to 0 : The area outside the image is filled with the absolute value.
 
::::*-255 to 0 : The area outside the image is filled with the absolute value.
::::*1 : Wrap around. The right border will be blured with the left border and the top border with the bottom border.  
+
::::*1 : Wrap around. The right border will be blurred with the left border and the top border with the bottom border.  
::::: This is the default behaivior when doing convolution in the frequency domain so this will be the fastest option.
+
::::: This is the default behavior when doing convolution in the frequency domain so this will be the fastest option.
 
::::*2 : Don't process borders.
 
::::*2 : Don't process borders.
 
::::*3 : Fill the area outside the border by replication of border value.
 
::::*3 : Fill the area outside the border by replication of border value.
Line 37: Line 35:
 
<br>
 
<br>
 
::{{Par2|integrate|bool|false}}
 
::{{Par2|integrate|bool|false}}
:::If true the coefficient used will be a mean value of the area the pixel covers. Use this if you consider each pixel  
+
:::If true the coefficient used will be a mean value of the area the pixel covers.  
:::to be made of an infinite number of infinite small pixels or if you like the result :-). If integration is used the image will be softer.
+
:::Use this if you consider each pixel to be made of an infinite number of infinite small pixels or if you like the result :-). If integration is used the image will be softer.
 
<br>
 
<br>
 
::{{Par2|Y|int|3}}
 
::{{Par2|Y|int|3}}
Line 84: Line 82:
 
  GaussianBlur(varY=1.5, varC=1.5, border=4, integrate=false, Y=3, U=2, V=2, gfunc=-1, gfuncc=-1, pcr=0, pcrc=0, nthreads=1)
 
  GaussianBlur(varY=1.5, varC=1.5, border=4, integrate=false, Y=3, U=2, V=2, gfunc=-1, gfuncc=-1, pcr=0, pcrc=0, nthreads=1)
  
<br>
 
 
<br>
 
<br>
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
 
'''Back to [[VariableBlur#Filters|VariableBlur]] &larr;'''
 
'''Back to [[VariableBlur#Filters|VariableBlur]] &larr;'''

Latest revision as of 11:01, 21 September 2014

Back to VariableBlur

Contents

[edit] Description

GaussianBlur works by converting the image to the frequency domain using FFTW and complex multiplying it with the Gaussian kernel in the frequency domain before converting the result back to the spatial domain giving the same result as doing a convolution in the spatial domain just faster for large kernel sizes.


[edit] Requirements

* GaussianBlur requires an SSE2 capable CPU


[edit] Syntax and Parameters

GaussianBlur (clip, float "varY", float "varC", int "border", bool "integrate", int "Y", int "U", int "V", int "gfunc", int "gfuncc", int "pcr", int "pcrc", int "nthreads")


clip   =
Input clip.


float  varY = 1.5
float  varC = 1.5
Variance to use; this will not be rounded.
varY is for luma, varC is for chroma (U/V). For RGB input varC is ignored and varY is used for all planes.


int  border = 4
Setup how the border of the image is treated.
Possible values:
  • -255 to 0 : The area outside the image is filled with the absolute value.
  • 1 : Wrap around. The right border will be blurred with the left border and the top border with the bottom border.
This is the default behavior when doing convolution in the frequency domain so this will be the fastest option.
  • 2 : Don't process borders.
  • 3 : Fill the area outside the border by replication of border value.
  • 4 : fill the area outside the border by mirroring. (Default value)
3/4 are slightly slower but give much nicer results.


bool  integrate = false
If true the coefficient used will be a mean value of the area the pixel covers.
Use this if you consider each pixel to be made of an infinite number of infinite small pixels or if you like the result :-). If integration is used the image will be softer.


int  Y = 3
int  U = 2
int  V = 2
Controls which planes the filter is applied to:
  • 3 : corresponding plane will be filtered
  • 2 : corresponding plane will be copied from the source
  • 1 : corresponding plane will be ignored
  • from 0 to -255 : corresponding plane will be assigned the absolute value.
For RGB input the Y value is used for all planes (RGB for RGB24 and RGBA for RGB32) and U/V are ignored.


int  gfunc = -1
int  gfuncc = -1
Set the gamma function to use for Y and U/V planes. Possible values:
  • -1 = do not correct gamma (same processing as version 0.4) - Default
  • 0 = sRGB
  • 1 = BT.709, SMPTE 170M
  • 2 = SMPTE 240M
  • 3 = BT.470-2 System M (straight 2.2 gamma, no linear segment)
  • 4 = BT.470-2 System B,G (straight 2.8 gamma, no linear segment)
  • 5 = (straight 2.22222 gamma, no linear segment)
  • 6 = (straight 1.8 gamma, no linear segment)
  • 7 = linear, no gamma compensation
Gamma-correction will be undone (forward gamma transfer function) prior to filtering, and then reapplied (inverse gamma transfer function) after filtering.
gfunc is for luma, gfuncc is for chroma (U/V). For RGB input gfunc is used for all planes and gfuncc is ignored.


int  pcr = 0
int  pcrc = 0
Set the pixel value range for Y and U/V planes. Only used if gfunc or gfuncc is greater than or equal to 0.
Possible values:
  • 0 = [0,255]
  • 1 = [16,235]
  • 2 = [16,240]
pcr is for luma, pcrc is for chroma (U/V). For RGB input pcr is used for all planes and pcrc is ignored.


int  nthreads = 1
Set the number of threads for processing.


[edit] Examples

GaussianBlur with default values:

AviSource("Blah.avi")
GaussianBlur(varY=1.5, varC=1.5, border=4, integrate=false, Y=3, U=2, V=2, gfunc=-1, gfuncc=-1, pcr=0, pcrc=0, nthreads=1)




Back to VariableBlur

Personal tools