########## BEGIN OF base.avs ##########
# This file is a part of SmoothVideo Project (SVP) ver.4
# This is NOT the full AVS script, all used variables are defined via
# JScript code that generates the full script text.

function interpolate(clip src)
{
# input_um - original frame in 4:2:0
# input_m  - cropped and resized (if needed) frame
# input_m8 - input_m converted to 8-bit
#RESIZE-CODE
	nvof==0 ? eval("""
		super=SVSuper(input_m8, super_params)
		vectors=SVAnalyse(super, analyse_params, src=input_m8)
		smooth=SVSmoothFps(input_m, super, vectors, smoothfps_params, mt=threads, src=input_um)
	""") : eval("""
		smooth=SVSmoothFps_NVOF(input_m, smoothfps_params, nvof_src=input_m8, mt=threads, src=input_um)
	""")

	return demo_mode==0 ? smooth : demo(input_m,smooth)
}

input=last

	stereo_type==0 ? eval(""" interpolate(input)
""") : 	stereo_type==1 ? eval("""
		lf = interpolate(input.crop(0,0,input.width/2,0))
		rf = interpolate(input.crop(input.width/2,0,0,0))
		StackHorizontal(lf, rf)
""") : 	stereo_type==2 ? Eval("""
		lf = interpolate(input.crop(0,0,0,input.height/2))
		rf = interpolate(input.crop(0,input.height/2,0,0))
		StackVertical(lf, rf)""") : input

########### END OF base.avs ###########
