MVTools2/MSuper

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (category)
(formatting, links, phrasing)
Line 3: Line 3:
 
'''Back to [[MVTools#Filters|MVTools2]] ←'''
 
'''Back to [[MVTools#Filters|MVTools2]] ←'''
 
-------------------------------------------------
 
-------------------------------------------------
<br>
+
 
<br>
+
 
 
== Description ==
 
== Description ==
:Get source clip and prepare special "super" clip with multilevel (hierarchical scaled) frames data. The super clip is used by both MAnalyse and motion compensation (client) functions.  
+
Get source clip and prepare a special '''''super''''' clip with multilevel, hierarchically scaled frame data. The super clip is used by both [[MAnalyse]] and other motion compensation client functions.  
:For storing and transferring its parameters we use audio properties of super clip (specifically, num_audio_samples) as a trick. So, audio is killed in super clip.  
+
 
:That is one of reasons why we additionally use a source clip with client functions. You may have a look at the super clip yourself (it has normal format).
+
For storing and transferring metadata we use audio properties of the super clip (specifically, ''num_audio_samples'') as a trick. So, audio is killed in the super clip. That is one of reasons why we require a separate source clip with '''MVTools''' client functions. You may have a look at the super clip yourself; it has a normal format.
<br>
+
 
<br>
+
 
== Syntax and Parameters ==
 
== Syntax and Parameters ==
:{{Template:FuncDef|MSuper (clip, int "hpad", int "vpad", int "pel", int "levels", bool "chroma", int "sharp", int "rfilter", clip "pelclip", bool "isse", bool "planar") }}
+
{{FuncDef|MSuper (clip, int "hpad", int "vpad", int "pel", int "levels", bool "chroma", <br>
<br>
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int "sharp", int "rfilter", clip "pelclip", bool "isse", bool "planar") }}
::{{Par2|hpad|int|8}}
+
:::Horizontal padding added to source frame (both left and right). Small padding is added for more correct motion estimation near frame borders.
+
<br>
+
::{{Par2|vpad|int|8}}
+
::::Vertical padding added to source frame (both top and bottom). Small padding is added for more correct motion estimation near frame borders.
+
<br>
+
::{{Par2|pel|int|2}}
+
:::It is the accuracy of the motion estimation. Value can only be 1, 2 or 4.
+
  
::::*1 : means precision to the pixel.
+
:{{Par2|hpad|int|8}}
::::*2 : means precision to half a pixel.
+
::Horizontal padding added to source frame (both left and right). Small padding is added for more correct motion estimation near frame borders.
::::*4 : means precision to quarter of a pixel, produced by spatial interpolation (more accurate but slower and not always better due to big level scale step).
+
<br>
+
::{{Par2|levels|int|0}}
+
:::It is the number of hierarchical levels in super clip frames. MAnalyse needs all levels, but for other client functions single finest level is enough (courser levels are not used).
+
:::Default : 0 (auto, all possible levels are produced).
+
<br>
+
::{{Par2|chroma|bool|true}}
+
:::If set to true, it allows to prepare chroma planes too in superclip. (false - luma only).
+
<br>
+
::{{Par2|sharp|int|2}}
+
:::Subpixel interpolation method for pel=2,4.
+
  
::::*0 : use for soft interpolation (bilinear).
+
:{{Par2|vpad|int|8}}
::::*1 : bicubic interpolation (4 tap Catmull-Rom)
+
::Vertical padding added to source frame (both top and bottom). Small padding is added for more correct motion estimation near frame borders.
::::*2 : 2 for sharper Wiener interpolation (6 tap, similar to Lanczos).
+
<br>
+
::{{Par2|rfilter|int|2}}
+
:::Hierarchical levels smoothing and reducing (halving) filter.
+
  
::::* 0 : simple 4 pixels averaging like unfiltered [[SimpleResize]] (old method)
+
:{{Par2|pel|int|2}}
::::* 1 : triangle (shifted) filter like [[ReduceBy2]] for more smoothing (decrease aliasing)
+
::Set motion estimation accuracy. Value can only be 1, 2 or 4.
::::* 2 : triangle filter like [[BilinearResize]] for even more smoothing
+
:::*1 : means precision to the pixel.
::::* 3 : quadratic filter for even more smoothing
+
:::*2 : means precision to half a pixel.
::::* 4 : cubic filter like [[BicubicResize]](b=1,c=0) for even more smoothing
+
:::*4 : means precision to quarter of a pixel, produced by spatial interpolation (more accurate but slower and not always better due to big level scale step).
  
::: You may also try to apply some external filter to superclip or its coarse bottom part (by appropriate crop and overlay).
+
:{{Par2|levels|int|0}}
<br>
+
::Set the number of hierarchical levels in super clip frames. [[MAnalyse]] needs all levels, but for other client functions a single, finest level is enough (courser levels are not used). Default = 0 (auto, all possible levels are produced).  
::{{Par2|pelclip|clip| }}
+
:::Optional upsampled source clip for using instead of internal subpixel interpolation (for {{Template:FuncDef|pel}}>1).
+
:::Pixels at rows and colunms positions multiple to pel (0,2,4,... for {{Template:FuncDef|pel}}=2) (without padding) must be original source pixels, other pixels must be interpolated.
+
  
::::Example for {{Template:FuncDef|pel}}=2: LanczosResize(width*2,height*2,src_left=0.25, src_top=0.25).
+
:{{Par2|chroma|bool|true}}
::::Recent note: it is true for luma, but is not exactly corresponded to chroma pixels positions of internal MVTools interpolation.
+
::If true, prepare chroma planes also. (false = luma only).
::::Nevertheless vectors and motion compensation are quite similar for usual clips, same chroma would be with src_left=0.5 for YUY2 and additionally src_top=0.5 for YV12).
+
 
 +
:{{Par2|sharp|int|2}}
 +
::Sub-pixel interpolation method for {{FuncArg|pel}} = 2 or 4.
 +
:::*0 : soft interpolation (bilinear).
 +
:::*1 : bicubic interpolation (4 tap Catmull-Rom)
 +
:::*2 : sharper Wiener interpolation (6 tap, similar to Lanczos).
 +
 
 +
:{{Par2|rfilter|int|2}}
 +
::Hierarchical levels smoothing and reducing (halving) filter.
 +
:::* 0 : simple 4 pixels averaging like unfiltered [[SimpleResize]] (old method)
 +
:::* 1 : triangle (shifted) filter like [[ReduceBy2]] for more smoothing (decrease aliasing)
 +
:::* 2 : triangle filter like [[BilinearResize]] for even more smoothing
 +
:::* 3 : quadratic filter for even more smoothing
 +
:::* 4 : cubic filter like [[BicubicResize]](b=1,c=0) for even more smoothing
 +
 
 +
:: You may also try to apply some external filter to ''superclip'' or its coarse bottom part (by appropriate crop and overlay).
 +
 
 +
:{{Par2|pelclip|clip| }}
 +
::Optional upsampled source clip for using instead of internal sub-pixel interpolation (for {{FuncArg|pel}}>1).
 +
::Pixels at rows and columns positions multiple to {{FuncArg|pel}} (0,2,4,... for {{FuncArg|pel}}=2) (without padding) must be original source pixels; other pixels must be interpolated.
 +
 
 +
::Example for {{Template:FuncDef|pel}}=2:
 +
<div {{BoxWidthIndent|60|6}} >
 +
MSuper(..., pel=2, pelclip=LanczosResize(width*2,height*2,src_left=0.25, src_top=0.25))
 +
</div>
 +
::Another useful {{FuncArg|pelclip}} is the [[eedi3]] edge-directed resampler.
 +
::Recent note: it is true for luma, but is not exactly corresponded to chroma pixels positions of internal '''MVTools''' interpolation. Nevertheless, vectors and motion compensation are quite similar for usual clips, same chroma would be with ''src_left=0.5'' for YUY2 and additionally ''src_top=0.5'' for YV12.{{Clarify}}
 +
 
 +
:{{Par2|isse|bool|true}}
 +
::If true, enable ISSE, MMX and other CPU optimizations. You may want to disable them for for debugging. If your processor doesn't support CPU optimizations, it will be disabled anyway (and you won't be able to activate them). Default is True.
 +
 
 +
:{{Par2|planar|bool|false}}
 +
::If true, use special planar color format for [[YUY2]] clips both for input and output. '''Ignored for YV12 clips.'''
 +
:::'''MSuper''' uses a special trick for storing frames with [[planar]] color in an interleaved YUY2 container. This way we can avoid numerous internal interleaved to planar conversions and increase speed. You can convert normal interleaved YUY2 source clip to planar format with the ''Interleaved2planar'' function from [[RemoveGrain_v0.9/SSETools]] plugin by {{Author/kassandro}}, and convert final result by ''Planar2interleaved'' function. This special planar YUY2 format is also supported by [[RemoveGrain_v0.9|Removegrain]] plugin by Kassandro, [[MaskTools2]] plugin by Manao and some others.
 +
::Note: super clip is always planar. Default is false.  
  
:::Other useful example is [[eedi3]] edge-directed resampler.
 
<br>
 
::{{Par2|isse|bool|true}}
 
:::Flag which allows to enable (if set to True) or disable (if set to False) ISSE, MMX and other CPU optimizations (for debugging).
 
:::Default is True. If your processor doesn't support CPU optimizations, it will be disabled anyway (and you won't be able to activate them).
 
<br>
 
::{{Par2|planar|bool|false}}
 
:::Flag to use special planar color format for YUY2 clips both for input and output of function. It uses special trick for storing of frames with planar color data organization (separate Y, U, V planes in memory) in normal interleaved YUY2 frames format as a container. This way we can avoid numerous internal interleaved to planar conversions and increase speed. You can convert normal interleaved YUY2 source clip to planar format with Interleaved2planar function from RemoveGrain plugin by kassandro, and convert final result by Planar2interleaved function. This special planar YUY2 format is also supported by Removegrain plugin by Kassandro, MaskTools2 plugin by Manao and some others. This parameter is ignored for YV12 clips. Note: super clip is always planar. Default is planar=false.
 
<br>
 
  
 
== Examples ==
 
== Examples ==
MSuper with default values.
+
[[TODO]]
[[AviSource]]("blah.avi")
+
 
<br>
+
 
<br>
+
 
------------------------------------------------
 
------------------------------------------------
 
'''Back to [[MVTools#Filters|MVTools2]] &larr;'''
 
'''Back to [[MVTools#Filters|MVTools2]] &larr;'''

Revision as of 06:36, 6 January 2016

Back to MVTools2



Description

Get source clip and prepare a special super clip with multilevel, hierarchically scaled frame data. The super clip is used by both MAnalyse and other motion compensation client functions.

For storing and transferring metadata we use audio properties of the super clip (specifically, num_audio_samples) as a trick. So, audio is killed in the super clip. That is one of reasons why we require a separate source clip with MVTools client functions. You may have a look at the super clip yourself; it has a normal format.

Syntax and Parameters

MSuper (clip, int "hpad", int "vpad", int "pel", int "levels", bool "chroma",
      int "sharp", int "rfilter", clip "pelclip", bool "isse", bool "planar")

int  hpad = 8
Horizontal padding added to source frame (both left and right). Small padding is added for more correct motion estimation near frame borders.
int  vpad = 8
Vertical padding added to source frame (both top and bottom). Small padding is added for more correct motion estimation near frame borders.
int  pel = 2
Set motion estimation accuracy. Value can only be 1, 2 or 4.
  • 1 : means precision to the pixel.
  • 2 : means precision to half a pixel.
  • 4 : means precision to quarter of a pixel, produced by spatial interpolation (more accurate but slower and not always better due to big level scale step).
int  levels = 0
Set the number of hierarchical levels in super clip frames. MAnalyse needs all levels, but for other client functions a single, finest level is enough (courser levels are not used). Default = 0 (auto, all possible levels are produced).
bool  chroma = true
If true, prepare chroma planes also. (false = luma only).
int  sharp = 2
Sub-pixel interpolation method for pel = 2 or 4.
  • 0 : soft interpolation (bilinear).
  • 1 : bicubic interpolation (4 tap Catmull-Rom)
  • 2 : sharper Wiener interpolation (6 tap, similar to Lanczos).
int  rfilter = 2
Hierarchical levels smoothing and reducing (halving) filter.
  • 0 : simple 4 pixels averaging like unfiltered SimpleResize (old method)
  • 1 : triangle (shifted) filter like ReduceBy2 for more smoothing (decrease aliasing)
  • 2 : triangle filter like BilinearResize for even more smoothing
  • 3 : quadratic filter for even more smoothing
  • 4 : cubic filter like BicubicResize(b=1,c=0) for even more smoothing
You may also try to apply some external filter to superclip or its coarse bottom part (by appropriate crop and overlay).
clip  pelclip =
Optional upsampled source clip for using instead of internal sub-pixel interpolation (for pel>1).
Pixels at rows and columns positions multiple to pel (0,2,4,... for pel=2) (without padding) must be original source pixels; other pixels must be interpolated.
Example for pel=2:
MSuper(..., pel=2, pelclip=LanczosResize(width*2,height*2,src_left=0.25, src_top=0.25))
Another useful pelclip is the eedi3 edge-directed resampler.
Recent note: it is true for luma, but is not exactly corresponded to chroma pixels positions of internal MVTools interpolation. Nevertheless, vectors and motion compensation are quite similar for usual clips, same chroma would be with src_left=0.5 for YUY2 and additionally src_top=0.5 for YV12.[clarification needed]
bool  isse = true
If true, enable ISSE, MMX and other CPU optimizations. You may want to disable them for for debugging. If your processor doesn't support CPU optimizations, it will be disabled anyway (and you won't be able to activate them). Default is True.
bool  planar = false
If true, use special planar color format for YUY2 clips both for input and output. Ignored for YV12 clips.
MSuper uses a special trick for storing frames with planar color in an interleaved YUY2 container. This way we can avoid numerous internal interleaved to planar conversions and increase speed. You can convert normal interleaved YUY2 source clip to planar format with the Interleaved2planar function from RemoveGrain_v0.9/SSETools plugin by Kassandro, and convert final result by Planar2interleaved function. This special planar YUY2 format is also supported by Removegrain plugin by Kassandro, MaskTools2 plugin by Manao and some others.
Note: super clip is always planar. Default is false.


Examples

TODO



Back to MVTools2

Personal tools