ASharp

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Examples: typ)
(ASharp v1.0.0 update (port from VS))
 
Line 1: Line 1:
{{FilterCat4|External_filters|Plugins|Restoration_filters|Sharpeners}}
+
{{FilterCat6|External_filters|Plugins|Plugins_x64|Restoration_filters|Sharpeners|Deep_color_tools}}
 
{{Filter3
 
{{Filter3
| {{Author/Marc FD}}
+
|1={{Author/Marc FD}}, {{Author/Asd-g}}
| v0.95
+
|2=v1.0.0
| [http://ziquash.chez-alice.fr/asharp%20v0.95.zip asharp v0.95.zip]
+
|3=[https://github.com/Asd-g/AviSynth-ASharp/releases ASharp-1.0.0.7z]
| [[:Category:Sharpeners|Sharpeners]]
+
|4=[[:Category:Sharpeners|Sharpeners]]
| [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
+
|5=[https://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
|6=[http://forum.doom9.org/showthread.php?t=38436 Doom9 Thread]}}
+
|6=[https://forum.doom9.org/showthread.php?t=38436 Doom9 Thread]}}
 
<br>
 
<br>
 
== Description ==
 
== Description ==
[[aSharp|asharp]] is an adaptive sharpening filter; basically a very common [http://en.wikipedia.org/wiki/Unsharp_masking unsharp mask] with 3 simple ideas:
+
[[ASharp]] is an adaptive sharpening filter; basically a very common [http://en.wikipedia.org/wiki/Unsharp_masking unsharp mask] with 3 simple ideas:
 
*Adaptive thresholding to avoid noise enhancement.
 
*Adaptive thresholding to avoid noise enhancement.
 
*Block adaptive sharpening to avoid DCT block edges enhancement.
 
*Block adaptive sharpening to avoid DCT block edges enhancement.
 
*Block based adaptive thresholding to avoid DCT block edges enhancement.
 
*Block based adaptive thresholding to avoid DCT block edges enhancement.
Like most AviSynth sharpeners, [[aSharp|asharp]] only processes the luma channel, the chroma channels are simply copied from the input clip (chroma sharpening seems to only introduce artifacts).
+
Like most AviSynth sharpeners, [[ASharp]] only processes the luma channel, the chroma channels are simply copied from the input clip (chroma sharpening seems to only introduce artifacts).
 
<br>
 
<br>
 
<br>
 
<br>
 
== Requirements ==
 
== Requirements ==
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/ greater]
+
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
 +
* [x64]: [[AviSynth+]]
 
* [[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: [[YV12]]
+
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 +
**AviSynth+: all [[planar]] Y and YUV(A) formats (8/10/12/14/16-bit) are supported.
 
<br>
 
<br>
  
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef|asharp (clip, float "T", float "D", float "B", bool "hqbf") }}
+
:{{Template:FuncDef|ASharp (clip, float "T", float "D", float "B", bool "hqbf") }}
 
<br>
 
<br>
 
::{{Par2||clip| }}
 
::{{Par2||clip| }}
:::Input clip.
+
:::A clip to process. It must be in YUV 8..16-bit planar format.
 
<br>
 
<br>
::{{Par2|T|float|2}}
+
::{{Par2|T|float|2.0}}
:::Unsharp masking threshold. Range is from 0 to 32. 0 will do nothing, 1 is like 32 with ffdshow/VDub unsharp mask filter, it'll enhance contrast 1x.
+
:::Unsharp masking threshold.  
 +
:::*0 will do nothing, 1 will enhance contrast 1x.
 +
:::*Range is from 0 to 32.
 
<br>
 
<br>
::{{Par2|D|float|4}}
+
::{{Par2|D|float|4.0}}
:::Adaptive sharpening strength. Range is from 0 to 16.
+
:::Adaptive sharpening strength to avoid sharpening noise.
:::*Set to 0 to disable.
+
:::If greater than 0, the threshold is adapted for each pixel (bigger for edges) and t acts like a maximum.
:::*If {{Template:FuncDef3|D}}<tt>>0</tt>, adaptive thresholding is enabled. The threshold is adapted for each pixel (bigger for edges). If adaptive sharpening is enabled, {{Template:FuncDef3|T}} acts like a maximum.
+
:::*Set to 0 to disable it.
 +
:::*Must be between 0 and 16.
 
<br>
 
<br>
::{{Par2|B|float|-1}}
+
::{{Par2|B|float|-1.0}}
:::Block adaptive sharpening. The range is from 0 to 4.  
+
:::Block adaptive sharpening.
:::*Set to a negative value to disable (default).
+
:::It avoids sharpening the edges of DCT blocks by lowering the threshold around them.
:::*If {{Template:FuncDef3|B}}<tt>>=0</tt>, block adaptive sharpening is enabled. It acts very simply, by lowering the threshold around DCT-blocks edges. If you use it, avoid any non [[modulo|mod8]] cropping before asharp.
+
:::Use with blocky videos. If cropping the video before [[ASharp]] the top and left edges must be cropped by [[mod8|multiples of 8]].
:::*It works only with adaptive sharpening, when {{Template:FuncDef3|D}}<tt>>0</tt>.
+
:::*Set to a negative value to disable it.
 +
:::*Must be less than 4.
 
<br>
 
<br>
 
::{{Par2|hqbf|bool|false}}
 
::{{Par2|hqbf|bool|false}}
Line 49: Line 55:
 
asharp with default settings (adaptive sharpening):
 
asharp with default settings (adaptive sharpening):
 
  [[AviSource]]("Blah.avi")
 
  [[AviSource]]("Blah.avi")
  asharp(T=2, D=4, B=-1, hqbf=false)
+
  asharp(T=2.0, D=4.0, B=-1.0, hqbf=false)
  
  
 
Simple unsharp masking with a strength of 2x (adaptive sharpening disabled):
 
Simple unsharp masking with a strength of 2x (adaptive sharpening disabled):
  asharp(T=2, D=0)
+
  asharp(T=2.0, D=0.0)
 
<br>
 
<br>
  
 
== Changelog ==
 
== Changelog ==
 
  Version      Date(D/M/Y)      Changes<br>
 
  Version      Date(D/M/Y)      Changes<br>
  v0.95        27/11/2002       - fixed some bugs
+
v1.0.0      2020/09/25      - Initial release; port of the VapourSynth plugin
 +
                              - AviSynth+: self-registers as [[MT_NICE_FILTER]].
 +
  v0.95        2002/11/27       - fixed some bugs
 
                               - added mmx compatibility
 
                               - added mmx compatibility
 
                               - first GPL source release
 
                               - first GPL source release
Line 81: Line 89:
 
<br>
 
<br>
 
== External Links ==
 
== External Links ==
*[http://forum.doom9.org/showthread.php?t=38436 Doom9 Forum] - asharp discussion.
+
*[https://forum.doom9.org/showthread.php?t=38436 Doom9 Forum] - asharp discussion.
 +
*[https://github.com/Asd-g/AviSynth-ASharp GitHub] - Source code repository.
 
<br>
 
<br>
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
 
'''Back to [[External_filters#Sharpeners|External Filters]] &larr;'''
 
'''Back to [[External_filters#Sharpeners|External Filters]] &larr;'''

Latest revision as of 02:33, 26 September 2020

Abstract
Author Marc FD, Asd-g
Version v1.0.0
Download ASharp-1.0.0.7z
Category Sharpeners
License GPLv2
Discussion Doom9 Thread


Contents

[edit] Description

ASharp is an adaptive sharpening filter; basically a very common unsharp mask with 3 simple ideas:

  • Adaptive thresholding to avoid noise enhancement.
  • Block adaptive sharpening to avoid DCT block edges enhancement.
  • Block based adaptive thresholding to avoid DCT block edges enhancement.

Like most AviSynth sharpeners, ASharp only processes the luma channel, the chroma channels are simply copied from the input clip (chroma sharpening seems to only introduce artifacts).

[edit] Requirements


[edit] Syntax and Parameters

ASharp (clip, float "T", float "D", float "B", bool "hqbf")


clip   =
A clip to process. It must be in YUV 8..16-bit planar format.


float  T = 2.0
Unsharp masking threshold.
  • 0 will do nothing, 1 will enhance contrast 1x.
  • Range is from 0 to 32.


float  D = 4.0
Adaptive sharpening strength to avoid sharpening noise.
If greater than 0, the threshold is adapted for each pixel (bigger for edges) and t acts like a maximum.
  • Set to 0 to disable it.
  • Must be between 0 and 16.


float  B = -1.0
Block adaptive sharpening.
It avoids sharpening the edges of DCT blocks by lowering the threshold around them.
Use with blocky videos. If cropping the video before ASharp the top and left edges must be cropped by multiples of 8.
  • Set to a negative value to disable it.
  • Must be less than 4.


bool  hqbf = false
High quality block filtering (aka block based adaptive thresholding). Set to true to enable.


[edit] Examples

asharp with default settings (adaptive sharpening):

AviSource("Blah.avi")
asharp(T=2.0, D=4.0, B=-1.0, hqbf=false)


Simple unsharp masking with a strength of 2x (adaptive sharpening disabled):

asharp(T=2.0, D=0.0)


[edit] Changelog

Version      Date(D/M/Y)      Changes
v1.0.0 2020/09/25 - Initial release; port of the VapourSynth plugin - AviSynth+: self-registers as MT_NICE_FILTER. v0.95 2002/11/27 - fixed some bugs - added mmx compatibility - first GPL source release


[edit] Archived Downloads

Version Download Mirror
v0.95


[edit] External Links




Back to External Filters

Personal tools