Soothe

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(reformat)
Line 1: Line 1:
{{FilterCat|External_filters|Unclassified_filters|Unclassified_filters}}
+
{{FilterCat|External_filters|Scripts|Unclassified_filters}}
{{Filter|Didée|1.0||Unknown|
+
* YV12
+
|}}
+
{{Template:FuncDef|Soothe(clip sharp, clip orig, int ''keep'')}}
+
  
== Abstract ==
+
{{Filter3
 
+
|Didée
Lessens the temporal instability and aliasing caused by sharpening, by comparing the original and sharpened clip, leaving a smoother and slightly softer output.
+
|1.0
 
+
|
=== Requires Filters ===
+
|Unclassified filters
*[[MaskTools]] 1.5x or 2
+
|
 +
|6=[http://forum.doom9.org/showthread.php?t=99679 Doom9 Thread]}}
  
 
== Description ==
 
== Description ==
 
+
[[Soothe]] lessens the temporal instability and aliasing caused by sharpening, by comparing the original and sharpened clip, leaving a smoother and slightly softer output. [[Soothe]] is a small postprocessor function for sharpening filters. The goal is temporal stabilization of clips that have been sharpened before. It is reasonably fast (contains 1 <tt>mt_lutxy</tt> and 2 <tt>mt_makediff</tt> operations and one [[TemporalSoften]] - that's about the cheapest possibility for what is done), and seems to work pretty well.
This is a small postprocessor function for sharpening filters. The goal is temporal stabilization of clips that have been sharpened before. It is reasonably fast (contains 3 different YV12Lutxy operations and one TemporalSoften - that's about the cheapest possibility for what is done. Plugin coders are welcome :) ), and seems to work pretty well.
+
  
 
The introduction of jitter on the temporal axis is a general problem of sharpening operations, since sharpening (usually) considers spatial aspects only. Therefore, Soothe() does a very simple job: get the difference between [source] and [sharpened source], apply a TemporalSoften on this difference BUT allow only changes towards 128 ("neutral"), and then apply this temporally calmed difference back to the original clip.
 
The introduction of jitter on the temporal axis is a general problem of sharpening operations, since sharpening (usually) considers spatial aspects only. Therefore, Soothe() does a very simple job: get the difference between [source] and [sharpened source], apply a TemporalSoften on this difference BUT allow only changes towards 128 ("neutral"), and then apply this temporally calmed difference back to the original clip.
Line 20: Line 16:
  
 
'''Advantages:'''
 
'''Advantages:'''
 
 
* more steady appearance (less "nervous")
 
* more steady appearance (less "nervous")
 
* less bitrate required
 
* less bitrate required
Line 26: Line 21:
 
* smoother motion compaired to plain-sharpening, since motion-blurred edges will be less sharpened
 
* smoother motion compaired to plain-sharpening, since motion-blurred edges will be less sharpened
 
* less artefacts in moving areas
 
* less artefacts in moving areas
* LimitedSharpen can run faster, since one can get away with less supersampling
+
* LimitedSharpenFaster can run faster, since one can get away with less [[supersampling]]
 
* should only help, never harm
 
* should only help, never harm
  
 
'''Disadvantages:'''
 
'''Disadvantages:'''
 
 
* overall sharpening effect is reduced, but this can be compensated by a little more initial sharpening.
 
* overall sharpening effect is reduced, but this can be compensated by a little more initial sharpening.
 +
<br>
 +
== Requirements ==
 +
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/ greater]
 +
* Supported color formats: [[YV12]]
  
=== Parameters ===
+
==== Required Plugins ====
 +
Latest version of the following plugins are recommended unless stated otherwise.<br>
 +
*[[MaskTools2]]
 +
Additional [[planar]] colorspaces are supported when using AviSynth 2.6 and appropriate MaskTools2.
 +
<br>
 +
<br>
 +
== [[Script variables|Syntax and Parameters]] ==
 +
::{{Template:FuncDef|Soothe(clip sharp, clip orig, int "keep")}}
 +
<br>
 +
::{{Par2| |clip| }}
 +
:::Sharpened clip.
  
{{ParR|keep|int|24|0-100}}
+
::{{Par2| |clip| }}
Minimum percent of the original sharpening to keep.
+
:::Original clip.
  
 +
::{{Par2|keep|int|24}}
 +
:::Minimum percent of the original sharpening to keep; range: 0-100.
 +
<br>
 
== Examples ==
 
== Examples ==
 
+
We use [[LimitedSharpen|LimitedSharpenFaster]]() as sharpener, and we'll keep at least 20% of its result:
We use LimitedSharpen() as sharpener, and we'll keep at least 20% of its result:
+
 
<pre>
 
<pre>
 +
AviSource("blah.avi")
 
dull  = last
 
dull  = last
sharp  = dull.LimitedSharpen( ss_x=1.25, ss_y=1.25, strength=150, overshoot=1 )
+
sharp  = dull.LimitedSharpenFaster(ss_x=1.25, ss_y=1.25, strength=150, overshoot=1)
  
Soothe( sharp, dull, 20 )
+
Soothe(sharp, dull, keep=20)
 
</pre>
 
</pre>
 
+
<br>
== Changelog ==
+
 
+
 
+
== Links ==
+
[http://forum.doom9.org/showthread.php?t=99679 Doom9 thread]
+
 
+
 
+
 
+
 
== Soothe.avsi ==
 
== Soothe.avsi ==
 
<pre>
 
<pre>
Line 74: Line 77:
 
# 14th July 2007, http://forum.doom9.org/showthread.php?p=1024318
 
# 14th July 2007, http://forum.doom9.org/showthread.php?p=1024318
 
</pre>
 
</pre>
 
+
<br>
(from [http://forum.doom9.org/showthread.php?p=1024318])
+
==External Links ==
 +
*[http://forum.doom9.org/showthread.php?t=99679 Doom9 Forum] - Soothe discussion.
 +
<br>

Revision as of 14:59, 15 August 2015


Abstract
Author Didée
Version 1.0
Download
Category Unclassified filters
License
Discussion Doom9 Thread

Contents

Description

Soothe lessens the temporal instability and aliasing caused by sharpening, by comparing the original and sharpened clip, leaving a smoother and slightly softer output. Soothe is a small postprocessor function for sharpening filters. The goal is temporal stabilization of clips that have been sharpened before. It is reasonably fast (contains 1 mt_lutxy and 2 mt_makediff operations and one TemporalSoften - that's about the cheapest possibility for what is done), and seems to work pretty well.

The introduction of jitter on the temporal axis is a general problem of sharpening operations, since sharpening (usually) considers spatial aspects only. Therefore, Soothe() does a very simple job: get the difference between [source] and [sharpened source], apply a TemporalSoften on this difference BUT allow only changes towards 128 ("neutral"), and then apply this temporally calmed difference back to the original clip. Effectively, this will reduce the overall effect of sharpening - less in static areas, and more in moving areas.

Advantages:

  • more steady appearance (less "nervous")
  • less bitrate required
  • somewhat positive effect on detail that is, due to the sharpening, prone to aliasing
  • smoother motion compaired to plain-sharpening, since motion-blurred edges will be less sharpened
  • less artefacts in moving areas
  • LimitedSharpenFaster can run faster, since one can get away with less supersampling
  • should only help, never harm

Disadvantages:

  • overall sharpening effect is reduced, but this can be compensated by a little more initial sharpening.


Requirements

  • AviSynth 2.5.8 or greater
  • Supported color formats: YV12

Required Plugins

Latest version of the following plugins are recommended unless stated otherwise.

Additional planar colorspaces are supported when using AviSynth 2.6 and appropriate MaskTools2.

Syntax and Parameters

Soothe(clip sharp, clip orig, int "keep")


clip   =
Sharpened clip.
clip   =
Original clip.
int  keep = 24
Minimum percent of the original sharpening to keep; range: 0-100.


Examples

We use LimitedSharpenFaster() as sharpener, and we'll keep at least 20% of its result:

AviSource("blah.avi")
dull   = last
sharp  = dull.LimitedSharpenFaster(ss_x=1.25, ss_y=1.25, strength=150, overshoot=1)

Soothe(sharp, dull, keep=20)


Soothe.avsi

function Soothe(clip sharp, clip orig, int "keep")
{
Assert(sharp.width == orig.width && sharp.height == orig.height,
 \  "Soothe: clip dimensions must match!")
keep  = default(keep, 24)
keep  = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP    = string(keep)
diff  = mt_makediff(orig,sharp)
diff2 = diff.temporalsoften(1,255,0,32,2)
diff3 = mt_lutxy(diff,diff2,  "x 128 - y 128 - * 0 < x 128 - 100 / "  + KP 
 \                           + " * 128 + x 128 - abs y 128 - abs > x " + KP 
 \                           + " * y 100 " + KP + " - * + 100 / x ? ?")
return( mt_makediff(orig,diff3,chroma="copy first") )
}
# 14th July 2007, http://forum.doom9.org/showthread.php?p=1024318


External Links


Personal tools