soifunc 0.8.1__py3-none-any.whl → 0.9.0__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/deband.py CHANGED
@@ -34,7 +34,7 @@ def retinex_deband(
34
34
  "The format {format.name} is not supported! It must be an 8-16bit integer YUV bit format!",
35
35
  )
36
36
 
37
- mask = dre_edgemask(clip)
37
+ mask = dre_edgemask.CLAHE(clip)
38
38
 
39
39
  if showmask:
40
40
  return mask
soifunc/denoise.py CHANGED
@@ -3,7 +3,7 @@ from __future__ import annotations
3
3
  from typing import Callable, Optional
4
4
 
5
5
  import vsdenoise
6
- from vsdenoise import DFTTest, FilterType, Profile
6
+ from vsdenoise import DFTTest, FilterType, Profile, mc_degrain
7
7
  from vstools import core, vs
8
8
 
9
9
  __all__ = ["MCDenoise", "magic_denoise", "hqbm3d", "mc_dfttest"]
@@ -21,20 +21,18 @@ def hqbm3d(
21
21
 
22
22
  Sane strength values will typically be below 1.0.
23
23
  """
24
- mv = vsdenoise.MVTools.denoise(
24
+ mv = mc_degrain(
25
25
  clip,
26
+ preset=vsdenoise.MVToolsPresets.HQ_SAD,
26
27
  tr=2,
27
- thSAD=100,
28
- block_size=32,
29
- overlap=16,
30
- range_conversion=3.5,
31
- sad_mode=vsdenoise.SADMode.SPATIAL.same_recalc,
32
- search=vsdenoise.SearchMode.DIAMOND,
33
- motion=vsdenoise.MotionMode.HIGH_SAD,
28
+ thsad=100,
29
+ refine=3,
30
+ blksize=select_block_size(clip),
34
31
  prefilter=vsdenoise.Prefilter.DFTTEST(
35
32
  clip,
36
33
  slocation=[(0.0, 1.0), (0.2, 4.0), (0.35, 12.0), (1.0, 48.0)],
37
34
  ssystem=1,
35
+ full_range=3.5,
38
36
  planes=0,
39
37
  ),
40
38
  planes=None,
@@ -53,13 +51,30 @@ def mc_dfttest(
53
51
  Even at the default `thSAD` of 75, it works well at eliminating noise.
54
52
  Turn it up to 150 if you really need to nuke something.
55
53
  It does an *okay* job at preserving details, but not nearly as good
56
- as bm3d, so this is not recommended on high quality sources.
57
- Use it to fix sources that are already dog water.
54
+ as bm3d, so this is not recommended on clean, high quality sources.
55
+
56
+ The `noisy` parameter helps preserve more detail on high-quality but grainy sources,
57
+ but is slower.
58
58
  """
59
- profile = vsdenoise.MVToolsPresets.NOISY if noisy else vsdenoise.MVToolsPresets.CMDE
60
- pre = vsdenoise.Prefilter.DFTTEST(clip)
61
- mc = vsdenoise.MVTools(pre, **profile)
62
- return mc.degrain(ref=clip, thSAD=thSAD)
59
+ # TODO: Do we need to tweak anything for the `noisy` param?
60
+ return mc_degrain(
61
+ clip,
62
+ prefilter=vsdenoise.Prefilter.DFTTEST,
63
+ preset=vsdenoise.MVToolsPresets.HQ_SAD,
64
+ thsad=thSAD,
65
+ tr=2,
66
+ refine=3,
67
+ blksize=select_block_size(clip),
68
+ )
69
+
70
+ def select_block_size(clip: vs.VideoNode):
71
+ if clip.width >= 1920 or clip.height >= 1080:
72
+ return 64
73
+ if clip.width >= 1600 or clip.height >= 900:
74
+ return 48
75
+ if clip.width >= 1280 or clip.height >= 720:
76
+ return 32
77
+ return 16
63
78
 
64
79
 
65
80
  def MCDenoise(
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: soifunc
3
- Version: 0.8.1
3
+ Version: 0.9.0
4
4
  Summary: Soichiro's VapourSynth Functions Collection
5
5
  License: MIT
6
6
  Author: Josh Holmer
@@ -9,13 +9,9 @@ Requires-Python: >=3.12,<4.0
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
12
13
  Requires-Dist: vapoursynth (>=68)
13
- Requires-Dist: vsdeband (>=1.2.2,<2.0.0)
14
- Requires-Dist: vsdenoise (>=2.7.1,<3.0.0)
15
- Requires-Dist: vskernels (>=3.3.1,<4.0.0)
16
- Requires-Dist: vsmasktools (>=1.3.2,<2.0.0)
17
- Requires-Dist: vsscale (>=2.2.1,<3.0.0)
18
- Requires-Dist: vstools (>=3.3.4,<4.0.0)
14
+ Requires-Dist: vsjetpack (>=0.3.4,<0.4.0)
19
15
  Description-Content-Type: text/markdown
20
16
 
21
17
  ## soifunc
@@ -0,0 +1,9 @@
1
+ soifunc/__init__.py,sha256=o8id_imdLYtSpVNfB-G4Pru9GtEPqdkcpyyW3yQt-6U,127
2
+ soifunc/deband.py,sha256=GB9ksv-G1EOkro7mEN44p1vxLCnY2x4d4SqKhHxQ6Z8,1176
3
+ soifunc/denoise.py,sha256=NiMdXZX2c0OMRU8m1KXCAZcLgP54a2y9l-F1IrcQMYQ,6822
4
+ soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ soifunc/resize.py,sha256=irh4Mo8OidoYYXkwjvekMCtgb4Fp0YVszTQLfONJcNU,4344
6
+ soifunc-0.9.0.dist-info/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
7
+ soifunc-0.9.0.dist-info/METADATA,sha256=mhk0o3NeyBJ6fZU5itBPHQjyvI3VXQ08epCr3sZ7Z9c,3363
8
+ soifunc-0.9.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
9
+ soifunc-0.9.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,9 +0,0 @@
1
- soifunc/__init__.py,sha256=o8id_imdLYtSpVNfB-G4Pru9GtEPqdkcpyyW3yQt-6U,127
2
- soifunc/deband.py,sha256=XQuc2TLvvA-BDfM8AfMQOhuzQZ5AMLqJkNNNEy4HmCM,1170
3
- soifunc/denoise.py,sha256=5H11XSgYj1-fmzdnNVyGckB08QP0W6mYIcoXKyaLeEI,6513
4
- soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- soifunc/resize.py,sha256=irh4Mo8OidoYYXkwjvekMCtgb4Fp0YVszTQLfONJcNU,4344
6
- soifunc-0.8.1.dist-info/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
7
- soifunc-0.8.1.dist-info/METADATA,sha256=TazN2zM4CLXDrsKNWAn7FLqBEbespbgfnJTDyBc-kVQ,3519
8
- soifunc-0.8.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
9
- soifunc-0.8.1.dist-info/RECORD,,