SkewRows

From Avisynth wiki
Jump to: navigation, search

AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io


SkewRows(clip clip, int skew)

Skews the rows of a clip. It can be used to correct (deskew) problem clips such as the error message shown below.

The amount, skew, can be positive or negative. For YUY2 sources, skew should be even (divisible by 2).

All interleaved pixel formats are supported, including Y8. RGB images are skewed from the bottom up, while YUV images are skewed from the top down.

All of the input rows are joined together as one very long row, then sliced up based on the new width (= input width + skew).

The width and height of the output clip are therefore altered slightly, as follows:

  • OutWidth = InWidth + skew   (signed skew values acceptable)
  • OutHeight=(InHeight*InWidth+OutWidth-1)/OutWidth  (rounded up to nearest integer)

The last line is padded with grey pixels when required.

[edit] Examples

Skewrows before.png
(original with skew problem)
 
Skewrows after.png
SkewRows(1)

[edit] See also

AviSource and DirectShowSource pixel_type

For planar color formats, adding a '+' prefix, e.g. DirectShowSource(..., pixel_type="+YV12"), tells AviSynth the video rows are DWORD aligned in memory instead of packed. This can fix skew or tearing of the decoded video with bad codecs when the width of the picture is not divisible by 4.

[edit] Changelog

v2.60 Initial release
Personal tools