AviSynth IResize Function

From [ http://www.sonycreativesoftware.com/forums/ShowMessage.asp?MessageID=761070 ] referring to [ http://forum.doom9.org/showthread.php?t=140233&page=3 ].  Does low-pass filter “automatically” during resizing to reduce twitter/shimmer/aliasing etc.

  • source=AviSource(“d:\fs.avi”).ColorYUV(levels=”TV->PC”).AssumeTFF  #Expands levels if frameserved in YUY2
  • IResize(source,720,480)
  • function IResize(clip Clip, int NewWidth, int NewHeight) {
    •   Clip
    •   SeparateFields()
    •   Shift=(GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
    •   E  = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0,    Shift)
    •   O  = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0,   -Shift)
    •   Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0,  2*Shift)
    •   Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift)
    •   Interleave(E, O)
    •   IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
    •   Weave()
  • }

Spline36Resize can be replaced by another resizer if you wish.

Leave a Reply

You must be logged in to post a comment.