Soften: Difference between revisions

From Avisynth wiki
Jump to navigationJump to search
Raffriff42 (talk | contribs)
formatting, links, phrasing
Raffriff42 (talk | contribs)
m TemporalSoften: note AVS+ differences
Line 28: Line 28:
}}  
}}  


Blends corresponding pixels in neighboring frames. All frames no more than {{FuncArg|radius}} away are examined. Blending occurs only if corresponding pixels are within {{FuncArg|luma_threshold}} or {{FuncArg|chroma_threshold}}, as explained below.  
Blends corresponding pixels in neighboring frames. All frames no more than {{FuncArg|radius}} away are examined. Blending occurs only if corresponding pixels are within {{FuncArg|luma_threshold}} or {{FuncArg|chroma_threshold}}, as explained below.
 
{{AvsPluscon}} arguments are [[Autoscale_parameter|autoscaling]] – they are always 0-255 at all bit depths. 


:{{Par2|clip|clip|}}
:{{Par2|clip|clip|}}
:: Source clip. Supported color formats: all except [[RGB24]].
:: Source clip. Supported color formats: all except [[RGB24]] and [[Avisynthplus_color_formats|RGB48]]


:{{Par2|radius|int|}}
:{{Par2|radius|int|}}
Line 50: Line 52:
::Defines the maximum average pixel change between frames; set properly, this will avoid blending across scene changes.
::Defines the maximum average pixel change between frames; set properly, this will avoid blending across scene changes.
::*Good values are between 5 and 30, somewhat higher than {{FuncArg|luma_threshold}}.
::*Good values are between 5 and 30, somewhat higher than {{FuncArg|luma_threshold}}.
::*{{FuncArg|scenechange}} not supported in RGB modes.


:{{Par2|mode|int|1}}
:{{Par2|mode|int|1}}

Revision as of 15:00, 21 October 2017

SpatialSoften and TemporalSoften remove noise from a video clip by selectively blending pixels.

Syntax and Parameters

SpatialSoften

SpatialSoften(clip clip, int radius, int luma_threshold, int chroma_threshold)

Like Blur, SpatialSoften blends neighboring pixels in the frame – but with a wider possible radius, and only if neighboring pixels are within luma_threshold and chroma_threshold, as explained below.

clip  clip =
Source clip. Must be YUY2 color format.
int  radius =
Filter radius – defines which pixels are processed.
Range 0-32; radius=0 results in no smoothing. Values > 32 may cause AviSynth to crash.
int  luma_threshold, chroma_threshold =
When smoothing a given pixel P, SpatialSoften ignores any neighbor pixel Pn where:
  • Pn luma differs from P luma by more than luma_threshold, OR
  • Pn chroma differs from P chroma by more than chroma_threshold.


TemporalSoften

TemporalSoften(clip clip, int radius, int luma_threshold, int chroma_threshold [, int scenechange] [, int mode ] )

Blends corresponding pixels in neighboring frames. All frames no more than radius away are examined. Blending occurs only if corresponding pixels are within luma_threshold or chroma_threshold, as explained below.

AVS+ arguments are autoscaling – they are always 0-255 at all bit depths.

clip  clip =
Source clip. Supported color formats: all except RGB24 and RGB48
int  radius =
Filter radius. All frames no more than radius from the current frame are examined.
(for radius=2, FIVE frames are processed: the current frame, two ahead and two behind)
Range 0-7; radius=0 results in no smoothing.
int  luma_threshold =
When smoothing a given luma pixel Y, the corresponding pixel in neighboring frame Yn
is ignored where Yn differs from Y by more than luma_threshold.
int  chroma_threshold =
When smoothing a given chroma pixel C, the corresponding pixel in neighboring frame Cn
is ignored where Cn differs from C by more than chroma_threshold.
  • Good starting values are around 1 or 2 times luma_threshold.
int  scenechange = 0
Defines the maximum average pixel change between frames; set properly, this will avoid blending across scene changes.
  • Good values are between 5 and 30, somewhat higher than luma_threshold.
  • scenechange not supported in RGB modes.
int  mode = 1
New scripts should specify mode=2 to enable ISSE processing. For backward compatibility, mode=1 by default.


Examples

  • Good initial values:
TemporalSoften(3, 4, 8, scenechange=15, mode=2)


Changes

v2.56 TemporalSoften working also with RGB32 input (as well as YV12, YUY2)