AviSynth / AviSynthPlus

AviSynth with improvements
http://avs-plus.net
977 stars 75 forks source link

SkewRows() is useless in it's current implementation - too coarse/imprecise (or it's just a bug?) #396

Closed vasyl-zabolotniy closed 3 months ago

vasyl-zabolotniy commented 3 months ago

From documentation:

The width and height of the output clip are therefore altered slightly, as follows: OutWidth = InWidth + skew (signed skew values acceptable)

.... The output does not look like that at all - smallest possible SkewRows(1) acts more like OutWidth = InWidth (1+0.75) Which is far from slightly*. Please consider fixing it.

qyot27 commented 3 months ago

The 'slightly' comment has nothing to do with what it looks like, but with the dimensions of the output image.

Version() = 513x154
Version().SkewRows(1) = 512x155

Version(width=7680,height=4320) = 7680x4320
Version(width=7680,height=4320).SkewRows(1) = 7681x4320

The description of what the filter actually does is shown in the example images (the actual code implementation is here). It was intended to fix a very specific problem that I honestly haven't seen happen in a long time, but was more common when people still relied on AVISource and DirectShowSource with some random VfW or DirectShow codec instead of better source filters.

https://forum.doom9.org/showthread.php?p=1532868#post1532868

That is a classic example of row skewing. The right and left sides of the image being stitched 1 pixel further across as you scan from bottom to top is the key hint. SkewRows(1) is designed to fix exactly this. The true width should have been 1367 not 1366. Unfortunately the last 768 pixels from the end of the top row will be missing.

vasyl-zabolotniy commented 3 months ago

I got it, thanks for clarification! I think I just found perfect alternative for what I need - HShear() function from (AviSynth Rotate plugin)