Skip to content

Commit 1b31364

Browse files
committed
add hidden interp setting: block size
1 parent 98ad030 commit 1b31364

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

target/defaults.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ fps: 1920
55
speed: medium
66
tuning: weak
77
algorithm: 23
8+
block size: auto
89
use gpu: no
910
area:
1011

target/jamba.vpy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ if (ip := rc['interpolation'])['enabled'].lower() in YES:
308308
NewNum=float(ip['fps']),
309309
NewDen=1,
310310
OverrideAlgo=int(ip['algorithm']),
311+
OverrideBlockSize=ip['block size'],
311312
OverrideArea=area
312313
)
313314

target/scripts/havsfunc.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def Overlay(base, overlay, x=0, y=0, mask=None, opacity=1.0, mode='normal', plan
187187
Source: https://github.com/xyx98/my-vapoursynth-script/blob/master/xvs.py
188188
"""
189189
def InterFrame(Input, Preset='Medium', Tuning='Film', NewNum=None, NewDen=1, GPU=True, gpuid=0, OverrideAlgo=None, OverrideArea=None,
190-
FrameDouble=False):
190+
FrameDouble=False, OverrideBlockSize='auto'):
191191

192192
if not isinstance(Input, vs.VideoNode):
193193
raise TypeError('InterFrame: This is not a video')
@@ -218,12 +218,21 @@ def InterFrameProcess(clip,oclip):
218218
SuperString += 'gpu:1}' if GPU else 'gpu:0}'
219219

220220
# Create VectorsString
221-
if Tuning == 'animation' or Preset == 'fastest':
222-
VectorsString = '{block:{w:32,'
223-
elif Preset in ['fast', 'faster'] or not GPU:
224-
VectorsString = '{block:{w:16,'
221+
if OverrideBlockSize not in [None, '', 'auto']:
222+
if 'x' in OverrideBlockSize: # contains a width, and height
223+
width, height = OverrideBlockSize.split('x')
224+
VectorsString = '{block:{w:' + width + ','
225+
if height != '':
226+
VectorsString += 'h:' + height + ','
227+
else: # only contains width
228+
VectorsString = '{block:{w:' + OverrideBlockSize + ','
225229
else:
226-
VectorsString = '{block:{w:8,'
230+
if Tuning == 'animation' or Preset == 'fastest':
231+
VectorsString = '{block:{w:32,'
232+
elif Preset in ['fast', 'faster'] or not GPU:
233+
VectorsString = '{block:{w:16,'
234+
else:
235+
VectorsString = '{block:{w:8,'
227236

228237
if Tuning == 'animation' or Preset == 'fastest':
229238
VectorsString += 'overlap:0'
@@ -281,7 +290,7 @@ def InterFrameProcess(clip,oclip):
281290
if Tuning == 'weak':
282291
SmoothString += ',area_sharp:1.2},scene:{blend:true,mode:0,limits:{blocks:50}}}'
283292
else:
284-
SmoothString += ',area_sharp:1.2},scene:{blend:true,mode:0}}'
293+
SmoothString += ',area_sharp:1.2},scene:{blend:false,mode:0}}'
285294

286295
# Make interpolation vector clip
287296
Super = core.svp1.Super(clip, SuperString)

0 commit comments

Comments
 (0)