# SuperSVP support vk.com/potplayerms t.me/supersvp
Try{ Core=Core }
catch(err){
fps= 45 #1..10 - 1..10X,>10 - target FPS. You can proportionally (targefps-originalfps) decrease CPU load reducing this value
Quality1= 0 Quality2=Quality1 #0-3 0-weakest, 3 - best. As I know, usually in original SVP Quality2=Quality1 , but you can control it manually
ArtefactRemove = 0 BlockSize = 0 #ArtefactRemove 0 - default, 50 - middle, 200 - strong. Bigger values gives less smoothing; BlockSize 0-8, 0-w32, ol0; 1-w32,ol1; 2-w32; 3-ol; 4-ol1; 5-default 16,ol2; 6-w8,ol0; 7-w8,ol1; 8-w8 . Bigger block faster and less noisy, but small have better smooth.
GPU= 1 # 0 - off | 1(11) - 1st GPU on 1st platform | 12 - 2nd GPU on 1st platform | 21 - 1st GPU on 2nd platform...
#BlockSize
Mode= 1 #1 - каждый ориг кадр используется один раз, остальное - расчётные кадры, 0 - из двух ориг кадров остаётся один, остальные расчётные (объясните, ЗАЧЕМ?! Ведь рассчётные хуже и доп нагрузка на ЦПУ), 2 - каждый ориг кадр дублируется (ЗАЧЕМ?! На выходе фейк уплавнение, нагрузка на ГПУ сильно возрастёт), 3 - по ситуации (дефолт), грузит ЦПУ примерно как 0. Я понимаю, что в сложных сценах может быть оправдан переход в 2 режим, но зачем он торчит в нулевом?!
Pel= 1 # 2 is default, higher is slower. The accuracy of the motion estimation. 1 means a precision to the pixel, 2 means a precision to half a pixel, 4 - to quarter pixel (not recommended to use). But Pel=1 is Okay
Thsad="thsad:200"#200 default, 250 for better quality, 1000 for smooth animation, 65000 for... I do not know, but it used some time ago.
Algo= 13 #13 algo for movies, 2 for animation. There is other algos, but they works bad, imho
OSD=2 #Times in seconds to show OSD, 9=infinity
#KOSTYLI - they improve speed, may reduce quality
CoarseWidth="width:530,"#default 1050, higher is slower
WeakGPU= 0 #if your GPU is overload, 1 means linear:false, 2 - cubic:0; 3 - cubic:0,linear:false . In modern version if SVP decides thay you have weak GPU, it paste only linear:false. Cubic:0 is for previous versions
SearchDistance="" #"distance:0," speeds up, but can looks good on GPU. Developers do not use it in script generator
#vectors= 3 #2 loads gpu less, but worse quality
Super_Override=""#like {scale:{up:0},gpu:1}
Analyse_Override=""
Smoothfps_Override=""
SetMemoryMax(2700)
PPcheck=1#WIDTH
PPcheck==1? eval ("""
SetFilterMTMode("ffdshow_source",3)
ffdshow_source()
ConvertToYV12()
global threads=4 #for regular player
""") : eval ("""
global threads=round(1.823 * #CPUS) #valid only for PotPlayer. You can calculate and input numbers of CPU Cores*2 manually
SetFilterMTMode("potplayer_source",3)
potplayer_source()
#ConvertToYV12()
""")}
orignum=FrameRateNumerator
origdenom=FrameRateDenominator
bit=GetProcessInfo()
Try{LoadPlugin(""+String(bit)+"\svpflow1.dll")
LoadPlugin(""+String(bit)+"\svpflow2.dll")}
catch(err){LoadPlugin("AviSynth\"+String(bit)+"\svpflow1.dll")
LoadPlugin("AviSynth\"+String(bit)+"\svpflow2.dll")}
#LoadPlugin("RoboCrop_x86.dll")
#LoadPlugin("C:\Program Files (x86)\SVP 4\plugins\svpflow1.dll")
#LoadPlugin("C:\Program Files (x86)\SVP 4\plugins\svpflow2.dll")
#LoadPlugin("C:\Program Files (x86)\SVP 4\plugins64\svpflow1.dll")
#LoadPlugin("C:\Program Files (x86)\SVP 4\plugins64\svpflow2.dll")
SetFilterMTMode("DEFAULT_MT_MODE",2)
SetFilterMTMode("SVSuper",1)
SetFilterMTMode("SVAnalyse",1)
denum=10000
origframerate=framerate
num=ceil(float(fps)*denum/Framerate)
framerate>40?eval("""num=1 denum=1""") : ""
fps <= 10 ? eval("""rate = "num:"+String(fps)+",den:1" """) : eval(""" rate = "num:"+String(num)+",den:"+String(denum)+",abs:false" """)
weakgpuparam= WeakGPU==1? "linear:false," : WeakGPU==2? "cubic:0," : WeakGPU==3? "linear:false,cubic:0," : ""
gpuid = (gpu>1) ? "gpuid:"+String(gpu)+"," : ""
Quality1 == 0 ? eval("""
AnalyseMainSearchCoarse="satd:false,"
""") : Quality1 == 1 ? eval("""
AnalyseMainSearchCoarse="type:2,distance:-6,"
""") : Quality1 == 2 ? eval("""
AnalyseMainSearchCoarse="distance:-8,"
""") : Quality1 == -1 ? eval("""
AnalyseMainSearchCoarse="distance:-8,"#okay...
Super_Override=""#like {scale:{up:0},pel:1,gpu:1}
Analyse_Override="{block:{w:32,overlap:0},main:{search:{type:2,distance:0,coarse:{width:530,type:2,distance:-1,satd:false,bad:{range:0}}},refine:[{thsad:200,search:{type:2,distance:0}}]}}}"
Smoothfps_Override=""
""") : Quality1 == -2 ? eval("""
AnalyseMainSearchCoarse="distance:-8,"#okay...
Super_Override="{scale:{up:0,down:2},gpu:1,pel:1,full:false}"#like {scale:{up:0},gpu:1}
Analyse_Override="{block:{w:32,overlap:0},main:{search:{type:2,distance:0,coarse:{width:530,type:2,distance:-1,satd:false,bad:{range:0}}},refine:[{thsad:0,search:{type:2,distance:0}}]}}}"
Smoothfps_Override=""
""") : eval ("""
AnalyseMainSearchCoarse="distance:-12,"
""")
AnalyseMainQuality2=""
Quality2 == 0 ? eval("""
AnalyseMainQuality2="range:0"
""") : Quality2 == 1 ? eval("""
""") : Quality2 == 2 ? eval("""
AnalyseMainQuality2="sad:2000,range:24"
""") : eval ("""
AnalyseMainQuality2="sad:2000"
""")
pel < 2 ? eval("""
pelparams="pel:1,full:false"
""") : eval("""
pelparams="pel:"+String(pel)+""
""")
AnalyseBlock = BlockSize==0 ? "block:{w:32,overlap:0}," : BlockSize==1 ? "block:{w:32,overlap:1}," : BlockSize==2 ? "block:{w:32}," : BlockSize==3 ? "block:{overlap:0}," : BlockSize==4 ? "block:{overlap:1}," : BlockSize==5 ? "block:{}," : BlockSize==6 ? "block:{w:8,overlap:0}," : BlockSize==7 ? "block:{w:8,overlap:1}," : BlockSize==8 ? "block:{w:8}," : "block:{},"
BlockSizePx = BlockSize==0 ? "32" : BlockSize==1 ? "28" : BlockSize==2 ? "24" : BlockSize==3 ? "16" : BlockSize==4 ? "14" : BlockSize==5 ? "12" : BlockSize==6 ? "8" : BlockSize==7 ? "7" : BlockSize==8 ? "6" : "12"
gpuparams = gpu>0 ? "scale:{up:0},gpu:1" : "scale:{up:2},gpu:0"
#MultiplerW=width/DisplayW
#MultiplerH=height/DisplayH
##width*height<DisplayW*DisplayW? OverrideRes=0 : OverrideRes=1
#OverrideRes==1?eval(""" """)
#MultiplerW>MultiplerH? cropstring="width/MultiplerW,height/MultiplerH,c=0.75":cropstring=""
#RoboCrop()
global source_width = width
global source_height = height
global crop_string = ""
global resize_string = ""#BicubicResize(1366,768,b=0,c=0.75)"
global super_params = Super_Override=="" ? "{"+gpuparams+","+pelparams+"}" : Super_Override
#global analyse_params = "{"+AnalyseBlock+"main:{search:{type:2,"+SearchDistance+"coarse:{"+CoarseWidth+""+AnalyseMainSearchCoarse+" bad:{"+AnalyseMainQuality2+"}}},refine:[{"+thsad+"}]}}}"
part1="{"+AnalyseBlock+"main:{search:{"+SearchDistance+"coarse:{"+CoarseWidth+""+AnalyseMainSearchCoarse+""
part2="bad:{"+AnalyseMainQuality2+"}},type:2}},refine:[{"+thsad+",search:{}}]}"
global analyse_params = Analyse_Override == "" ? ""+part1+""+part2+"" : Analyse_Override
global smoothfps_params = Smoothfps_Override=="" ? "{"+weakgpuparam+"rate:{"+rate+"},"+gpuid+"algo:"+String(algo)+",mask:{area:"+String(ArtefactRemove)+"},scene:{mode:"+String(mode)+"}}" : Smoothfps_Override
global demo_Mode=0
global stereo_type=0
########## 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.
NewWidth = 1366
NewHeight = 768
SourceAspect = float(source_width) / float(source_height)
MyAspect = float(NewWidth) / float(NewHeight)
SourceAspect > MyAspect ? eval("""
ResizedWidth=NewWidth
ResizedHeight=round(float(source_height) * float(NewWidth) / float(source_width) / 2.0) * 2
""") : eval("""
ResizedHeight=NewHeight
ResizedWidth=round(float(source_width) * float(NewHeight) / float(source_height) / 2.0 ) * 2
""")
#resize_string="BicubicResize("+String(ResizedWidth)+","+String(ResizedHeight)+",b=0,c=0.75)"
function interpolate(clip src)
{
input = crop_string=="" ? src : eval("src."+crop_string)
input = resize_string=="" ? input : eval("input."+resize_string)
#MT-MODE-1 #do not remove this line!
super=SVSuper(input, super_params)
vectors=SVAnalyse(super, analyse_params, src=input)
smooth=SVSmoothFps(input, super, vectors, smoothfps_params, mt=threads, src=src)
#MT-MODE-2 #do not remove this line!
return demo_Mode==0 ? smooth : demo(input,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 ###########
#override= Analyse_Override=="" || Smoothfps_Override=="" ||Super_Override=="" ? "" : "OVERRIDE MODE" WTF why dont works
override= Analyse_Override!="" ? "OVERRIDE MODE" : Smoothfps_Override!="" ? "OVERRIDE MODE" : Super_Override!="" ? "OVERRIDE MODE" : ""
#"Orignumden="+String(orignum)+"/"+String(Origdenom)+"->"+String(FrameRateNumerator)+"/"+String(FrameRateDenominator)+"/8\n" + \
SourceAspect = float(source_width) / float(source_height)
targetframerate=framerate
OSDtime= OSD==9? (Framecount-1) : round(float(FrameRateNumerator)*OSD/FrameRateDenominator)
OSD>0? eval("""
fontsize=round(40*width/1920.0)
Subtitle( \
""+String(source_width)+"x"+String(source_height)+" "+String(SourceAspect)+":1 "+String(origframerate)+"*"+String(float(num)/denum)+"="+String(targetframerate)+"("+String(fps)+") "+override+" SuperSVP support vk.com/potplayerms t.me/supersvp \n" + \
"Quality1:"+String(Quality1)+"/3, Quality2:"+String(Quality2)+"/3\n" + \
"ArtefactRemove:"+String(ArtefactRemove)+", Block:"+String(BlockSize)+"/8 "+BlockSizePx+"px\n" + \
"GPU:"+String(gpu)+", Mode:"+String(mode)+"/3\n" + \
"Pel:"+String(pel)+"/4, Threads:"+String(threads)+"\n" + \
"WeakGPU:"+String(weakgpu)+"/3, Coarse"+String(CoarseWidth)+" Search"+String(SearchDistance)+"\n" + \
"OSD:"+String(OSD)+"sec, OSDframes:"+String(OSDtime)+"\n" , \
font="Comic Sans MS", size=fontsize, lsp=10, last_frame = OSDtime )
Subtitle( \
"PPcheck:"+String(PPcheck)+"\n" + \
""+super_params+"\n" + \
""+part1+"\n" + \
""+part2+"\n" + \
""+smoothfps_params+"\n", \
font="Comic Sans MS", size=40*width/1920, y= height-6*fontsize, lsp=10, last_frame = OSDtime )
""") : ("")
WriteFileStart("someinfo.txt", "analyse_params")
Prefetch(threads)
/*
190424
Более быстрый и корректный скрипт, запись лаконичнее
Исправлена ошибка, приводящая к нарушению генерации скрипта. Рефайн отодвинут, поиску присвоено значение по умолчанию type:2
Debug переименован в OSD, запись по возможности более лаконичная запись
Упрощённая запись ОСДов - если указать 0, то её не будет, если указать 9 - она будет идти вечно, если указать любое другое значение - она будет столько секунд, сколько надо
*/