import vapoursynth
from vapoursynth import core

if (video_in.width <= display_res[0] and video_in.height <= display_res[1] and container_fps < 31):
	input_clip = core.std.AssumeFPS(clip=video_in, fpsnum=container_fps*1000000, fpsden=1000000)
	super_clip = core.mv.Super(clip=input_clip, rfilter=4)
	bwd_vec = core.mv.Analyse(super=super_clip, blksize=32, overlap=8, search=3, dct=5, isb=True)
	fwd_vec = core.mv.Analyse(super=super_clip, blksize=32, overlap=8, search=3, dct=5, isb=False)
	final_clip = core.mv.FlowFPS(clip=input_clip, super=super_clip, mvbw=bwd_vec, mvfw=fwd_vec, num=0)
	final_clip.set_output()
else:
	video_in.set_output()
