AWarpSharp2/aWarpSharp2

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (category)
(small documentation update)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
[[Category:Plugin_Filters]]
+
{{FilterCat4|External_filters|Plugin_functions|Adjustment_filters|Sharpeners}}
[[Category:Sharpening]]
+
<tt>aWarpSharp2</tt> performs edge detection, blurring, and warping, all in one.
'''Back to [[aWarpSharp2#Filters|aWarpSharp2]] &larr;'''
+
--------------------------------------------------------
+
 
<br>
 
<br>
 
<br>
 
<br>
== Description ==
+
== [[Script variables|Syntax and Parameters]] ==
The same as '''[[AWarpsharp2/aWarp|aWarp(]][[AWarpsharp2/aSobel|aSobel().]][[AWarpsharp2/aBlur|aBlur())]]''' but a bit faster.
+
<br>
+
<br>
+
==Syntax and Parameters ==
+
 
:{{Template:FuncDef|aWarpSharp2 (''clip'', ''int'' "thresh", ''int'' "blur", ''int'' "type", ''int'' "depth", ''int'' "chroma")}}
 
:{{Template:FuncDef|aWarpSharp2 (''clip'', ''int'' "thresh", ''int'' "blur", ''int'' "type", ''int'' "depth", ''int'' "chroma")}}
 +
<br>
 +
::{{Par2| |clip| |}}
 +
:::Input clip.
 
<br>
 
<br>
 
::{{Par2|thresh|int|128}}
 
::{{Par2|thresh|int|128}}
:::Range: 0 to 255<br>
+
:::Saturation limit for edge detection; no pixel in the edge mask will have a value greater than {{Template:FuncDef3|thresh}}. Reduce for less aggressive sharpening.
::::Saturation limit for edge detection. Reduce for less aggressive sharpening.
+
:::Range: 0 to 255
 
<br>
 
<br>
 
::{{Par2|blur|int|2}}
 
::{{Par2|blur|int|2}}
:::Range: 0 to 100<br>
+
:::Number of blur passes over edge mask. Less passes increase sharpening effect, but can produce major artifacts with high {{Template:FuncDef3|depth}} and {{Template:FuncDef3|thresh}} values.<br>
::::Number of blur passes over edge mask.<br>
+
:::You can use values higher than 100, but probably won't see any difference. Chroma is processed with <code>({{Template:FuncDef3|blur}}+1)/2</code> passes.<br>
::::Less passes increase sharpening effect, but can produce major artifacts with high {{Template:FuncDef|depth}} and {{Template:FuncDef|thresh}} values.<br>
+
:::Range: 0 to 100
::::You can use values higher than 100, but probably won't see any difference.<br>
+
 
::::Chroma is processed with (blur+1)/2 passes.<br>
+
:::<span style="color:red">'''Note:'''</span> Unless {{Template:FuncDef3|blur}} is specifically set, it will default to 3 if {{Template:FuncDef3|type}}=1.
:::<span style="color:red">'''Note:'''</span> Unless {{Template:FuncDef|blur}} is specifically set, it will default to 3 if {{Template:FuncDef|type}}=1.
+
 
<br>
 
<br>
 
::{{Par2|type|int|0}}
 
::{{Par2|type|int|0}}
::::Type of blur:
+
:::Type of blur:
:::::* 0 : radius 6 blur.
+
:::* 0 : radius 6 blur (some kind of 13x13 average).
:::::* 1 : radius 2 blur, requires around 8x more passes than {{Template:FuncDef|type}}=0 for the same effect (will be 2.5x slower), but will produce better quality.
+
:::* 1 : radius 2 blur (some kind of 5x5 average), requires around 8x more passes than {{Template:FuncDef3|type}}=0 for the same effect (will be 2.5x slower), but will produce better quality.
 
<br>
 
<br>
 
::{{Par2|depth|int|16}}
 
::{{Par2|depth|int|16}}
:::Range: -128 to 127<br>
+
:::Strength of the final warping. Negative values result in warping in opposite direction, i.e. will blur the image instead of sharpening.
::::Strength of the final warping. Negative values result in warping in opposite direction.
+
:::Range: -128 to 127
 +
:::<span style="color:red">'''Note:'''</span> Chroma channels are internally processed with <code>{{Template:FuncDef|depth}}/2</code>.
 
<br>
 
<br>
 
::{{Par2|chroma|int|4}}
 
::{{Par2|chroma|int|4}}
::::Processing mode for chroma planes (U and V):
+
:::Processing mode for the chroma channels (U and V):
:::::* 0 : fill with zeroes
+
:::* 0 : fill with 0x80(128), output is grayscale.
:::::* 1 : don't care
+
:::* 1 : don't care - chroma will be trashed.
:::::* 2 : copy
+
:::* 2 : copy chroma channels from the input clip.
:::::* 3 : process
+
:::* 3 : process chroma; create an edge mask from each chroma channel and use those to warp each chroma channel individually.
:::::* 4 : guide by luma
+
:::* 4 : process chroma; use the edge mask from the luma to warp the chroma channels.
:::::* 5 : same as 3, but don't process luma
+
:::* 5 : same as 3, but don't process luma.
:::::* 6 : same as 4, but don't process luma
+
:::* 6 : same as 4, but don't process luma.
 +
:::Luma plane (Y) is always processed, except for mode 5 and 6 which simply copy the luma channel from the input clip.
 
<br>
 
<br>
 
== Examples ==
 
== Examples ==
 
aWarpSharp2 with default values:
 
aWarpSharp2 with default values:
 
  [[AviSource]]("Blah.avi")
 
  [[AviSource]]("Blah.avi")
  aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=4)
+
  aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=4)<br>
 +
#The same as aWarp(aSobel().aBlur(blur=2, type=0), depth=16) but a bit faster.
 +
<br>
 +
Guide chroma channels with luma edge mask but only process chroma (luma channel will be copied from the input clip).
 +
aWarpSharp2(thresh=128, blur=2, type=0, depth=16, '''chroma=6''')<br>
 +
#Identical to [[MergeChroma]](last, aWarpSharp2()) but faster and more memory efficient.
 +
<br>
 +
Process chroma channels with their own independent edge mask and copy luma channel from the input clip.
 +
aWarpSharp2(thresh=128, blur=2, type=0, depth=16, '''chroma=5''')<br>
 +
#Identical to [[MergeChroma]](last, aWarpSharp2(chroma=3)) but faster and more memory efficient.
 
<br>
 
<br>
 +
Only process the luma channel and copy chroma channels from the input clip.
 +
aWarpSharp2(thresh=128, blur=2, type=0, depth=16, '''chroma=2''')<br>
 +
#Identical to [[MergeLuma]](last, aWarpSharp2()) but faster and more memory efficient.
 
<br>
 
<br>
 
--------------------------------------------------------
 
--------------------------------------------------------
 
'''Back to [[aWarpSharp2#Filters|aWarpSharp2]] &larr;'''
 
'''Back to [[aWarpSharp2#Filters|aWarpSharp2]] &larr;'''

Latest revision as of 23:01, 9 November 2015

aWarpSharp2 performs edge detection, blurring, and warping, all in one.

[edit] Syntax and Parameters

aWarpSharp2 (clip, int "thresh", int "blur", int "type", int "depth", int "chroma")


clip   =
Input clip.


int  thresh = 128
Saturation limit for edge detection; no pixel in the edge mask will have a value greater than thresh. Reduce for less aggressive sharpening.
Range: 0 to 255


int  blur = 2
Number of blur passes over edge mask. Less passes increase sharpening effect, but can produce major artifacts with high depth and thresh values.
You can use values higher than 100, but probably won't see any difference. Chroma is processed with (blur+1)/2 passes.
Range: 0 to 100
Note: Unless blur is specifically set, it will default to 3 if type=1.


int  type = 0
Type of blur:
  • 0 : radius 6 blur (some kind of 13x13 average).
  • 1 : radius 2 blur (some kind of 5x5 average), requires around 8x more passes than type=0 for the same effect (will be 2.5x slower), but will produce better quality.


int  depth = 16
Strength of the final warping. Negative values result in warping in opposite direction, i.e. will blur the image instead of sharpening.
Range: -128 to 127
Note: Chroma channels are internally processed with depth/2.


int  chroma = 4
Processing mode for the chroma channels (U and V):
  • 0 : fill with 0x80(128), output is grayscale.
  • 1 : don't care - chroma will be trashed.
  • 2 : copy chroma channels from the input clip.
  • 3 : process chroma; create an edge mask from each chroma channel and use those to warp each chroma channel individually.
  • 4 : process chroma; use the edge mask from the luma to warp the chroma channels.
  • 5 : same as 3, but don't process luma.
  • 6 : same as 4, but don't process luma.
Luma plane (Y) is always processed, except for mode 5 and 6 which simply copy the luma channel from the input clip.


[edit] Examples

aWarpSharp2 with default values:

AviSource("Blah.avi")
aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=4)
#The same as aWarp(aSobel().aBlur(blur=2, type=0), depth=16) but a bit faster.


Guide chroma channels with luma edge mask but only process chroma (luma channel will be copied from the input clip).

aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=6)
#Identical to MergeChroma(last, aWarpSharp2()) but faster and more memory efficient.


Process chroma channels with their own independent edge mask and copy luma channel from the input clip.

aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=5)
#Identical to MergeChroma(last, aWarpSharp2(chroma=3)) but faster and more memory efficient.


Only process the luma channel and copy chroma channels from the input clip.

aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=2)
#Identical to MergeLuma(last, aWarpSharp2()) but faster and more memory efficient.



Back to aWarpSharp2

Personal tools