function salFPS3( \ clip input, float FPS, \ int "mode", int "protection", int "protection2", \ int "iterate", int "reset", int "initialise") { mode = default(mode, warp) #fast protection = default(protection, 80) protection2= default(protection2,20) iterate = default(iterate, 2) reset = default(reset, 50) initialise = default(initialise, 6) originalFPS = input.framerate() input mp = FindMotion(iterate = iterate, reset = reset, \ initialise = initialise) p = MotionFPS(FPS,mode,Motion = mp) p_edge = mt_edge(mode="prewitt",thy1=protection2,thy2=0).MotionFPS(FPS,mode,Motion = mp) maskp = mp.SumStretchFPSMask(FPS, protection) mn = FindMotion(iterate = iterate, reset = reset, \ initialise = initialise, from = next) n = MotionFPS(FPS,mode,Motion = mn, source = next) n_edge = mt_edge(mode="prewitt",thy1=protection2,thy2=0).MotionFPS(FPS,mode,Motion = mn, source=next) maskn = mn.SumStretchFPSMask(FPS, protection, source = next) eps = 0.0001 maskp assumeFPS(originalFPS) CombineFPS(FPS, maskp, maskn.Invert()) bilinearresize(input.width(), input.height(), 0,0, eps+width/8.,eps+height/8. ) mpro=last mt_merge(p_edge, n_edge, last, luma=true, u=3, v=3) mt_lut(yexpr="128 x 128 - abs 112 / 128 * - 2 *") # 112/128* added to roughly compensate for the inherent # clamping formerly done by the (now missing) ConvertToRGB. mt_inpand() bicubicresize(m16(width/8.),m16(height/8.),1/3.,1/3.) mt_binarize(protection2,false) temporalsoften(1,255,0,255) mt_binarize(80,false) mt_expand(mode=mt_circle(3)) mt_inflate() bicubicresize(input.width(), input.height(), 1,0 ) tehmask=last mt_merge(p, n, mpro, luma=true, u=3, v=3) mt_merge(last,input.blendfps(FPS,aperture=FPS/float(input.framerate())) \,tehmask, luma=true, u=3,v=3) } function m16(float x) {x<16?16:int(round(x/16.0)*16)}