AWarpsharp2/aWarp4
From Avisynth wiki
(Difference between revisions)
m (update) |
|||
Line 1: | Line 1: | ||
− | '''Back to [[aWarpSharp2#Filters|aWarpSharp2]]''' | + | '''Back to [[aWarpSharp2#Filters|aWarpSharp2]] ←''' |
+ | -------------------------------------------------- | ||
+ | <br> | ||
+ | <br> | ||
== Description == | == Description == | ||
− | + | :aWarp4 is designed for an even more custom warp-sharpening than [[AWarpsharp2/aWarp|aWarp]] allows. Unlike aWarp, this uses a 4x larger source clip than the edge mask. | |
− | + | :This is useful for improving the quality of the subpixel interpolation quality in the final step. Supersampling allows to produce a sharper result with lower {{Template:FuncDef|depth}}, which equals to less deformations. | |
− | :{{Template:FuncDef| | + | |
<br> | <br> | ||
− | |||
<br> | <br> | ||
− | ::{{ | + | == [[Script variables|Syntax and Parameters]] == |
+ | :{{Template:FuncDef|aWarp4 (''clip'', ''clip'', ''int'' "depth", ''int'' "chroma")}} | ||
+ | <br> | ||
+ | ::{{Par2| |clip| |}} | ||
+ | ::::Input clip; must be exactly 4 times the width and height of the edge mask clip. | ||
+ | <br> | ||
+ | ::{{Par2| |clip| |}} | ||
+ | ::::Edge mask clip; usually the input clip processed by [[AWarpsharp2/aSobel|aSobel]] and followed by [[AWarpsharp2/aBlur|aBlur]]. | ||
+ | ::::If you want more stable results it's good idea to do anti-aliasing and temporal filtering on the edge mask before passing it to the warping stage. | ||
+ | <br> | ||
+ | ::{{Par2|depth|int|3}} | ||
:::Range: -128 to 127<br> | :::Range: -128 to 127<br> | ||
::::Strength of the final warping. Negative values result in warping in opposite direction. | ::::Strength of the final warping. Negative values result in warping in opposite direction. | ||
<br> | <br> | ||
− | ::{{ | + | ::{{Par2|chroma|int|4}} |
:::Processing mode for chroma planes (U and V): | :::Processing mode for chroma planes (U and V): | ||
::::* 0 : fill with zeroes | ::::* 0 : fill with zeroes | ||
− | ::::* 1 : don't care | + | ::::* 1 : don't care |
::::* 2 : copy | ::::* 2 : copy | ||
::::* 3 : process | ::::* 3 : process | ||
− | ::::* 4 : guide by luma | + | ::::* 4 : guide by luma |
::::* 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 | ||
+ | <br> | ||
+ | == Examples == | ||
+ | Correct usage examples:<br> | ||
+ | <br> | ||
+ | *Using [[Resize|Spline36Resize]] to upscale: | ||
+ | input = [[AviSource]]("Blah.avi") | ||
+ | input4x = input.Spline36Resize(width*4, height*4, src_left=0.375, src_top=0.375) | ||
+ | edge_mask = input.aSobel(thresh=128, chroma=1).aBlur(blur=3, type=1, chroma=1)<br> | ||
+ | aWarp4(input4x, edge_mask, depth=3, chroma=4) | ||
+ | |||
+ | <br> | ||
+ | The following example is written differently but is identical to the one above. | ||
+ | [[AviSource]]("Blah.avi") | ||
+ | aWarp4(Spline36Resize(width*4, height*4, 0.375, 0.375), aSobel().aBlur()) | ||
+ | <br> | ||
+ | *Using [[nnedi3/nnedi3_rpow2|nnedi3_rpow2]] and [[Resize|Spline36Resize]] to upscale: | ||
+ | input = [[AviSource]]("Blah.avi") | ||
+ | input4x = input.nnedi3_rpow2(rfactor=2).Spline36Resize(width*4, height*4, 0.25, 0.25) | ||
+ | edge_mask = input.aSobel().aBlur()<br> | ||
+ | aWarp4(input4x, edge_mask) | ||
+ | <br> | ||
+ | *Using [[nnedi3/nnedi3_rpow2|nnedi3_rpow2]] to upscale: | ||
+ | input = [[AviSource]]("Blah.avi") | ||
+ | input4x = input.nnedi3_rpow2(rfactor=2).nnedi3_rpow2(rfactor=2) | ||
+ | edge_mask = input.aSobel().aBlur()<br> | ||
+ | aWarp4(input4x, edge_mask, depth=2) | ||
+ | <br> | ||
+ | <br> | ||
+ | -------------------------------------------------------- | ||
+ | '''Back to [[aWarpSharp2#Filters|aWarpSharp2]] ←''' |
Revision as of 03:57, 10 March 2014
Back to aWarpSharp2 ←
Description
- aWarp4 is designed for an even more custom warp-sharpening than aWarp allows. Unlike aWarp, this uses a 4x larger source clip than the edge mask.
- This is useful for improving the quality of the subpixel interpolation quality in the final step. Supersampling allows to produce a sharper result with lower depth, which equals to less deformations.
Syntax and Parameters
- aWarp4 (clip, clip, int "depth", int "chroma")
- clip =
- Input clip; must be exactly 4 times the width and height of the edge mask clip.
- clip =
- int depth = 3
- Range: -128 to 127
- Strength of the final warping. Negative values result in warping in opposite direction.
- Range: -128 to 127
- int depth = 3
- int chroma = 4
- Processing mode for chroma planes (U and V):
- 0 : fill with zeroes
- 1 : don't care
- 2 : copy
- 3 : process
- 4 : guide by luma
- 5 : same as 3, but don't process luma
- 6 : same as 4, but don't process luma
- Processing mode for chroma planes (U and V):
- int chroma = 4
Examples
Correct usage examples:
- Using Spline36Resize to upscale:
input = AviSource("Blah.avi") input4x = input.Spline36Resize(width*4, height*4, src_left=0.375, src_top=0.375) edge_mask = input.aSobel(thresh=128, chroma=1).aBlur(blur=3, type=1, chroma=1)
aWarp4(input4x, edge_mask, depth=3, chroma=4)
The following example is written differently but is identical to the one above.
AviSource("Blah.avi") aWarp4(Spline36Resize(width*4, height*4, 0.375, 0.375), aSobel().aBlur())
- Using nnedi3_rpow2 and Spline36Resize to upscale:
input = AviSource("Blah.avi") input4x = input.nnedi3_rpow2(rfactor=2).Spline36Resize(width*4, height*4, 0.25, 0.25) edge_mask = input.aSobel().aBlur()
aWarp4(input4x, edge_mask)
- Using nnedi3_rpow2 to upscale:
input = AviSource("Blah.avi") input4x = input.nnedi3_rpow2(rfactor=2).nnedi3_rpow2(rfactor=2) edge_mask = input.aSobel().aBlur()
aWarp4(input4x, edge_mask, depth=2)
Back to aWarpSharp2 ←