VariableBlur/Unsharp

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (minor formatting)
m (Description)
 
Line 2: Line 2:
 
'''Back to [[VariableBlur#Filters|VariableBlur]] ←'''
 
'''Back to [[VariableBlur#Filters|VariableBlur]] ←'''
 
== Description ==
 
== Description ==
Sharpens the image using unsharp filtering (http://homepages.inf.ed.ac.uk/rbf/HIPR2/unsharp.htm for an explanation).
+
Sharpens the image using unsharp filtering (see [http://homepages.inf.ed.ac.uk/rbf/HIPR2/unsharp.htm Unsharp Filter] for an explanation).
 
<br>
 
<br>
 
<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  

Latest revision as of 13:51, 20 December 2014

Back to VariableBlur

Contents

[edit] Description

Sharpens the image using unsharp filtering (see Unsharp Filter for an explanation).

[edit] Requirements


[edit] Syntax and Parameters

Unsharp (clip, float "varY", float "varC", float "strength", 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.


float  strength = 0.7
Strength of the sharpener, best values are between 0 (no sharpen) to 1 (more sharpen). Values outside this will produce strange results.


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

Unsharp with default values:

AviSource("Blah.avi")
Unsharp(varY=1.5, varC=1.5, strength=0.7, 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