soifunc 0.14.0__py3-none-any.whl → 0.14.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
soifunc/denoise.py CHANGED
@@ -4,9 +4,9 @@ from typing import Callable, Optional
4
4
 
5
5
  import vsdenoise
6
6
  from vsdenoise import DFTTest, bm3d, mc_degrain, nl_means
7
- from vstools import core, depth, get_u, get_y, join, split, vs
7
+ from vstools import check_variable, core, join, split, vs
8
8
 
9
- __all__ = ["MCDenoise", "magic_denoise", "hqbm3d", "mc_dfttest"]
9
+ __all__ = ["MCDenoise", "magic_denoise", "hqbm3d", "mc_dfttest", "Stab"]
10
10
 
11
11
 
12
12
  def hqbm3d(
@@ -218,3 +218,47 @@ def magic_denoise(clip: vs.VideoNode) -> vs.VideoNode:
218
218
  tbsize=3,
219
219
  ssystem=1,
220
220
  )
221
+
222
+
223
+ ##############################################################################
224
+ # Original script by g-force converted into a stand alone script by McCauley #
225
+ # then copied from havsfunc when they deleted it #
226
+ # latest version from December 10, 2008 #
227
+ ##############################################################################
228
+ def Stab(clp, dxmax=4, dymax=4, mirror=0):
229
+ if not isinstance(clp, vs.VideoNode):
230
+ raise vs.Error("Stab: this is not a clip")
231
+
232
+ clp = scdetect(clp, 25 / 255)
233
+ temp = clp.misc.AverageFrames([1] * 15, scenechange=True)
234
+ inter = core.std.Interleave(
235
+ [
236
+ core.rgvs.Repair(
237
+ temp, clp.misc.AverageFrames([1] * 3, scenechange=True), mode=[1]
238
+ ),
239
+ clp,
240
+ ]
241
+ )
242
+ mdata = inter.mv.DepanEstimate(trust=0, dxmax=dxmax, dymax=dymax)
243
+ last = inter.mv.DepanCompensate(data=mdata, offset=-1, mirror=mirror)
244
+ return last[::2]
245
+
246
+
247
+ def scdetect(clip: vs.VideoNode, threshold: float = 0.1) -> vs.VideoNode:
248
+ def _copy_property(n: int, f: list[vs.VideoFrame]) -> vs.VideoFrame:
249
+ fout = f[0].copy()
250
+ fout.props["_SceneChangePrev"] = f[1].props["_SceneChangePrev"]
251
+ fout.props["_SceneChangeNext"] = f[1].props["_SceneChangeNext"]
252
+ return fout
253
+
254
+ assert check_variable(clip, scdetect)
255
+
256
+ sc = clip
257
+ if clip.format.color_family == vs.RGB:
258
+ sc = clip.resize.Point(format=vs.GRAY8, matrix_s="709")
259
+
260
+ sc = sc.misc.SCDetect(threshold)
261
+ if clip.format.color_family == vs.RGB:
262
+ sc = clip.std.ModifyFrame([clip, sc], _copy_property)
263
+
264
+ return sc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soifunc
3
- Version: 0.14.0
3
+ Version: 0.14.1
4
4
  Summary: Soichiro's VapourSynth Functions Collection
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,10 +1,10 @@
1
1
  soifunc/__init__.py,sha256=H6BWoCLRW2ZD47wQtL72SIZvTpD6REH7cUqIYWvCn0k,174
2
2
  soifunc/deband.py,sha256=8mT1FqKAteUAs1XJYi8WvmlcJtyQN2OxM5mfiujTKX4,1887
3
- soifunc/denoise.py,sha256=rqWSbSd01Ppy0BZ8IsxJaarnCosF2gtoa7URagS6ESw,7233
3
+ soifunc/denoise.py,sha256=pWmGbFU5IRU0AAPi56a57NNBq-zaNUd7IG-nfdCgTeA,8897
4
4
  soifunc/interpolate.py,sha256=2Agg1N4GG9h6lkl7soy7G--ahVk3msbDfKGuRbj2Syo,7878
5
5
  soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  soifunc/resize.py,sha256=sOJpkovIEgaKvABEJTLfvYfKj6zvGf9pFRQMoWb7XdY,1998
7
- soifunc-0.14.0.dist-info/METADATA,sha256=mnto3BsBUHNojCaGOlJtGY5C8TM27afht5qQwH-sfTE,1287
8
- soifunc-0.14.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
9
- soifunc-0.14.0.dist-info/licenses/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
10
- soifunc-0.14.0.dist-info/RECORD,,
7
+ soifunc-0.14.1.dist-info/METADATA,sha256=xVcBWO_TJ36Fx2Mc60QwRH3XFeKMVYjhPM1NxWZZ1Gc,1287
8
+ soifunc-0.14.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
9
+ soifunc-0.14.1.dist-info/licenses/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
10
+ soifunc-0.14.1.dist-info/RECORD,,