VariableBlur/GaussianBlur

From Avisynth wiki
Jump to: navigation, search

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