I'm having a heck of a time adapting the optimal script to field-oriented execution for use with pure-video sources.
AviSynth 2.5x seems to choke on this script. Can anyone help figure out what's going wrong?
I don't care if a function is used or not. All it needs is a way to encapsulate the kvcd lines.
The ReverseFieldDominance lines ensures we're always working with proper TFF
AVISource("source.avi")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\asharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ReverseFieldDominance.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\STMedianFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\unfilter.dll")
Limiter(min_luma=16)
GetParity() ? nop() : ReverseFieldDominance()
even=SelectEven(SeparateFields()).KVCD_Filter()
odd=SelectOdd(SeparateFields()).KVCD_Filter()
Interleave(even,odd).Weave()
Limiter(min_luma=16)
##########################
function KVCD_Filter(){
MaxTreshold = 1.50
nf = 0 # Current frame.
undot()
limiter()
asharp(2, 4)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.2))
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) ,0, 2) ")
Limiter()
return }
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2}
|