View Full Version : When to resize - filter order


hudsonhawk
6th June 2003, 18:15
Hello All,

Given the following script used to encode a fairly noisy VHS Interlaced source to DVD:

#########################################
LoadPlugin("D:\Video\Avisynth\Plugins\LoadPluginEx.dll")
LoadPlugin("D:\Video\Avisynth\Plugins\Convolution3D.dll")

AVISource("d:\Video\Capture\Clip10001.avi")

KillAudio()

Seg1= Trim(32,5129).FadeIn2(30).FadeOut2(30)
Seg2= Trim(5147,19821).FadeIn2(30).FadeOut2(30)
Seg3= Trim(19830,36708).FadeIn2(30).FadeOut2(30)
Seg4= Trim(36721,38842).FadeIn2(30).FadeOut2(60)

JoinClips= Seg1++Seg2++Seg3++Seg4

PreFilter= JoinClips.Crop(16,8,-16,-8).BilinearResize(352,464).SeparateFields()

FilteredEven= PreFilter.SelectEven().Undot().Unfilter(20,20).Cnr2().FluxSmooth().Convolution3D(0,32,128,16,32,10,0)

FilteredOdd= PreFilter.SelectOdd().Undot().Unfilter(20,20).Cnr2().FluxSmooth().Convolution3D(0,32,128,16,32,10,0)

PostFilter= Interleave(FilteredEven,FilteredOdd).Weave().AddBorders(0,8,0,8)

return PostFilter
########################################

Can anyone offer any reasons why I should or shouldn't resize after applying filters? Also, should Unfilter be the last filter, or is it where it should be?

Thanks!

MasterYoshidino
7th June 2003, 17:50
heres a through explanation
When you resize you are either ringing the picture (Bicubic/Lanczos or any that exponentially samples a picture) since they increase contrast; or you are precision sampling using BilinearResize to preserve the dvd look w/o sharpening. This causes either "blurring" or "sharpening" which should not be spatially smoothed. In other words, resize after any spatial filters. You can still apply temporal filters after a resize though (TemporalSmoother, Dup, etc.) without fearing the image quality being sacrificed.

Unfilter though is one filter I do not know enough to answer your question.

hudsonhawk
9th June 2003, 01:01
Thank you for the reply and for the valuable assistance!