FredThompson
13th July 2003, 07:27
This works. However if the guts of the function are replaced with the commented-out lines, it does not. AviSynth appears to have problems creating the variable SwitchThreshold. The name, itself, is irrelevant. AviSynth reports:
I don't know what SwitchThreshold means
([ScriptClip], line 4)
I'm stumped. Since the variable name is irrelevant, it can't be an operator or definition scope problem. Any ideas?
ConvertToYV12()
even=SelectEven(SeparateFields()).KVCD_Filter()
odd=SelectOdd(SeparateFields()).KVCD_Filter()
Interleave(even,odd).Weave()
Limiter(min_luma=16)
function KVCD_Filter(clip c){
MaxTreshold = 1.50
Max=5
nf = 0 # Current frame.
undot(c)
asharp(1,4)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.1))
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) , 1, 1) ")
#SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
#ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
#unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
#TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")
return last}
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2}
I don't know what SwitchThreshold means
([ScriptClip], line 4)
I'm stumped. Since the variable name is irrelevant, it can't be an operator or definition scope problem. Any ideas?
ConvertToYV12()
even=SelectEven(SeparateFields()).KVCD_Filter()
odd=SelectOdd(SeparateFields()).KVCD_Filter()
Interleave(even,odd).Weave()
Limiter(min_luma=16)
function KVCD_Filter(clip c){
MaxTreshold = 1.50
Max=5
nf = 0 # Current frame.
undot(c)
asharp(1,4)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.1))
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) , 1, 1) ")
#SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
#ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
#unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
#TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")
return last}
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2}