soifunc 0.11.1__py3-none-any.whl → 0.11.3__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
@@ -15,6 +15,9 @@ def retinex_deband(
15
15
  showmask: bool = False,
16
16
  ) -> vs.VideoNode:
17
17
  """
18
+ Debanding using a contrast-adaptive edge mask to preserve details
19
+ even in dark areas.
20
+
18
21
  "medium" `threshold` in f3kdb is 48. I think that's a bit strong.
19
22
  16 might be a more sane starting point. Increase as needed.
20
23
 
soifunc/denoise.py CHANGED
@@ -18,6 +18,7 @@ def hqbm3d(
18
18
  """
19
19
  High-quality presets for motion compensated denoising.
20
20
  Uses BM3D for luma and nl_means for chroma.
21
+ This is a good denoiser for preserving detail on high-quality sources.
21
22
 
22
23
  Sane strength values will typically be below 1.0.
23
24
  """
@@ -48,12 +49,13 @@ def mc_dfttest(
48
49
  """
49
50
  A motion-compensated denoiser using DFTTEST.
50
51
  Even at the default `thSAD` of 75, it works well at eliminating noise.
51
- Turn it up to 150 if you really need to nuke something.
52
- It does an *okay* job at preserving details, but not nearly as good
53
- as bm3d, so this is not recommended on clean, high quality sources.
52
+ Turn it up to 150 or more if you really need to nuke something.
53
+ It does a decent job at preserving details, but not nearly as good
54
+ as bm3d, so this is not recommended on clean, high-quality sources.
54
55
 
55
- The `noisy` parameter helps preserve more detail on high-quality but grainy sources,
56
- but is slower.
56
+ The `noisy` parameter did help preserve more detail on high-quality but grainy sources.
57
+ Currently it is deprecated, as the presets in `vsdenoise` changed,
58
+ but it may be un-deprecated in the future.
57
59
  """
58
60
  # TODO: Do we need to tweak anything for the `noisy` param?
59
61
  blksize = select_block_size(clip)
soifunc/interpolate.py CHANGED
@@ -4,6 +4,7 @@ import platform
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  import vstools
7
+ from vsscale import autoselect_backend
7
8
  from vstools import vs
8
9
 
9
10
  if TYPE_CHECKING:
@@ -40,15 +41,7 @@ def rate_doubler(
40
41
  model=vsmlrt.RIFEModel.v4_25_heavy,
41
42
  # Why these defaults? Because running ML stuff on AMD on Windows sucks hard.
42
43
  # Trial and error led me to finally find that ORT_DML works.
43
- backend=(
44
- backend
45
- if backend
46
- else (
47
- vsmlrt.Backend.ORT_DML()
48
- if platform.system() == "Windows"
49
- else vsmlrt.Backend.TRT()
50
- )
51
- ),
44
+ backend=(backend if backend else autoselect_backend()),
52
45
  )
53
46
  # TODO: Handle other chroma samplings
54
47
  clip = clip.resize.Bicubic(
@@ -98,15 +91,7 @@ def decimation_fixer(
98
91
  doubled = vsmlrt.RIFE(
99
92
  clip,
100
93
  model=vsmlrt.RIFEModel.v4_25_heavy,
101
- backend=(
102
- backend
103
- if backend
104
- else (
105
- vsmlrt.Backend.ORT_DML()
106
- if platform.system() == "Windows"
107
- else vsmlrt.Backend.TRT()
108
- )
109
- ),
94
+ backend=(backend if backend else autoselect_backend()),
110
95
  )
111
96
 
112
97
  out_clip = None
soifunc/resize.py CHANGED
@@ -11,7 +11,7 @@ from vskernels import (
11
11
  ScalerLike,
12
12
  Spline36,
13
13
  )
14
- from vsscale import SSIM, ArtCNN, GenericScaler
14
+ from vsscale import ArtCNN, GenericScaler
15
15
  from vstools import check_variable_format, inject_self, is_gpu_available, join, vs
16
16
 
17
17
  __all__ = [
@@ -53,18 +53,14 @@ def good_resize(
53
53
 
54
54
  is_upscale = clip.width < width or clip.height < height
55
55
  chroma_scaler = Spline36()
56
- if anime:
57
- if is_upscale:
58
- if gpu:
59
- luma_scaler = ArtCNN()
60
- else:
61
- luma_scaler = NNEDI3(scaler=Hermite(sigmoid=True))
62
- else:
63
- luma_scaler = Hermite(sigmoid=True)
56
+
57
+ # We've ended up where the only special case is anime + upscale + GPU enabled
58
+ if anime and is_upscale and gpu:
59
+ luma_scaler = ArtCNN(scaler=Hermite(sigmoid=True))
64
60
  elif is_upscale:
65
- luma_scaler = NNEDI3(scaler=SSIM())
61
+ luma_scaler = NNEDI3(scaler=Hermite(sigmoid=True))
66
62
  else:
67
- luma_scaler = SSIM()
63
+ luma_scaler = Hermite(sigmoid=True)
68
64
 
69
65
  return HybridScaler(luma_scaler, chroma_scaler).scale(
70
66
  clip, width, height, shift=shift
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.3
2
+ Name: soifunc
3
+ Version: 0.11.3
4
+ Summary: Soichiro's VapourSynth Functions Collection
5
+ License: MIT
6
+ Author: Josh Holmer
7
+ Author-email: jholmer.in@gmail.com
8
+ Requires-Python: >=3.12,<4.0
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: vapoursynth (>=68)
14
+ Requires-Dist: vsjetpack (>=0.5.2,<0.6.0)
15
+ Description-Content-Type: text/markdown
16
+
17
+ ## soifunc
18
+
19
+ Vapoursynth scripts that might be useful to someone
20
+
21
+ ### Installation
22
+
23
+ #### Arch Linux
24
+
25
+ Install from [AUR](https://aur.archlinux.org/packages/vapoursynth-plugin-soifunc-git)
26
+
27
+ #### Other
28
+
29
+ First install the required plugins which are not available in pip:
30
+
31
+ - [neo_f3kdb](https://github.com/HomeOfAviSynthPlusEvolution/neo_f3kdb)
32
+ - [znedi3](https://github.com/sekrit-twc/znedi3)
33
+ - [nnedi3_resample](https://github.com/HomeOfVapourSynthEvolution/nnedi3_resample)
34
+
35
+ Install from pip:
36
+
37
+ ```bash
38
+ pip install soifunc
39
+ ```
40
+
41
+ Or the latest git version:
42
+
43
+ ```bash
44
+ pip install git+https://github.com/shssoichiro/soifunc.git
45
+ ```
46
+
47
+ ### Usage
48
+
49
+ Please see the inline codedoc comments for usage details.
50
+
@@ -0,0 +1,10 @@
1
+ soifunc/__init__.py,sha256=H6BWoCLRW2ZD47wQtL72SIZvTpD6REH7cUqIYWvCn0k,174
2
+ soifunc/deband.py,sha256=MbI5OOG8JpWqM5B5ux6OU784-39PtCMQWrh9mk4k2xY,1273
3
+ soifunc/denoise.py,sha256=ALTftqL9Q1cPLKtAU60mT3-RUkVHXBqgg2Pa9GwjGIY,6982
4
+ soifunc/interpolate.py,sha256=dgYczCdn716afJ3sZgQgcF6KfAkaU2J_obJD-Kp7wP4,4091
5
+ soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ soifunc/resize.py,sha256=jr1kLU8IrXcLphjkhcXhls1HjhIKiryD8n6Kvwe1DU4,2988
7
+ soifunc-0.11.3.dist-info/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
8
+ soifunc-0.11.3.dist-info/METADATA,sha256=WOVeRBpkaPbIDrnl59VYGDRD07cwKb-XACCUhv4Tr4s,1214
9
+ soifunc-0.11.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
+ soifunc-0.11.3.dist-info/RECORD,,
@@ -1,116 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: soifunc
3
- Version: 0.11.1
4
- Summary: Soichiro's VapourSynth Functions Collection
5
- License: MIT
6
- Author: Josh Holmer
7
- Author-email: jholmer.in@gmail.com
8
- Requires-Python: >=3.12,<4.0
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.12
12
- Classifier: Programming Language :: Python :: 3.13
13
- Requires-Dist: vapoursynth (>=68)
14
- Requires-Dist: vsjetpack (>=0.5.1,<0.6.0)
15
- Description-Content-Type: text/markdown
16
-
17
- ## soifunc
18
-
19
- Vapoursynth scripts that might be useful to someone
20
-
21
- ### Installation
22
-
23
- #### Arch Linux
24
-
25
- Install from [AUR](https://aur.archlinux.org/packages/vapoursynth-plugin-soifunc-git)
26
-
27
- #### Other
28
-
29
- First install the required plugins which are not available in pip:
30
-
31
- - [neo_f3kdb](https://github.com/HomeOfAviSynthPlusEvolution/neo_f3kdb)
32
- - [znedi3](https://github.com/sekrit-twc/znedi3)
33
- - [nnedi3_resample](https://github.com/HomeOfVapourSynthEvolution/nnedi3_resample)
34
-
35
- Install from pip:
36
-
37
- ```bash
38
- pip install soifunc
39
- ```
40
-
41
- Or the latest git version:
42
-
43
- ```bash
44
- pip install git+https://github.com/shssoichiro/soifunc.git
45
- ```
46
-
47
- ### Usage
48
-
49
- Any of the functions will require an `import soifunc` prior to where they are used.
50
-
51
- #### good_resize
52
-
53
- `clip = soifunc.good_resize(clip, 1920, 1080)`
54
-
55
- Resizes a clip to the specified dimensions using a high quality method.
56
-
57
- For upscaling, luma is resized using `nnedi3_resample`.
58
-
59
- For downscaling, luma is resized using `SSIM_downsample`.
60
-
61
- Chroma is always resized using `Spline36`.
62
-
63
- **If this filter causes your video to produce a blank output**, see this issue: https://github.com/HomeOfVapourSynthEvolution/VapourSynth-TCanny/issues/14
64
-
65
- Additional Params:
66
-
67
- - `gpu`: Whether to use the OpenCL version of supported dependencies. Defaults to auto-detect.
68
-
69
- #### retinex_deband
70
-
71
- `clip = soifunc.retinex_deband(clip, threshold = 16 [, showmask = False])`
72
-
73
- High quality debanding using a retinex mask, designed to preserve details in both light and dark areas.
74
-
75
- `threshold` controls debanding strength. `16` is a reasonable starting point. Increase as needed until satisfied.
76
-
77
- `showmask` is an optional debugging parameter, setting this to `True` will output the mask that will be used to preserve edges.
78
-
79
- Note that this debander does not automatically add grain.
80
- If you need to add grain before encoding, use `vsdeband.AddNoise`.
81
- If you're using AV1 grain synthesis, you _do not_ need to add grain before encoding.
82
-
83
- #### MCDenoise
84
-
85
- Applies motion compensation to a denoised clip to improve detail preservation.
86
- Credit to Clybius for creating this code.
87
-
88
- Example usage:
89
-
90
- ```python
91
- import soifunc
92
- import dfttest2
93
- import functools # functools is built in to python
94
- denoiser = functools.partial(dfttest2.DFTTest, sigma=1.5, backend=dfttest2.Backend.CPU)
95
- clip = soifunc.MCDenoise(clip, denoiser)
96
- ```
97
-
98
- Params:
99
-
100
- - `denoiser`: A function defining how to denoise the motion-compensated frames.
101
- Denoiser params can be added using `functools.partial`.
102
- - `prefilter`: An optional prefiltered input clip to enable better searching for motion vectors
103
-
104
-
105
- #### MagicDenoise
106
-
107
- Clybius's magic denoise function.
108
-
109
- Uses dark magic to denoise heavy grain from videos.
110
- Zero parameters, only magic.
111
-
112
- Params:
113
-
114
- - `clip`: The input video to apply deinterlacing to
115
- - `gpu`: Whether to use the OpenCL version of supported dependencies.
116
-
@@ -1,10 +0,0 @@
1
- soifunc/__init__.py,sha256=H6BWoCLRW2ZD47wQtL72SIZvTpD6REH7cUqIYWvCn0k,174
2
- soifunc/deband.py,sha256=nbtRwktdN8Y-OuiSsj1mVg9vzJhJlu7r6dqs_TLa6rg,1174
3
- soifunc/denoise.py,sha256=6MY4m3x64gEIgnbVT48htFthG51sLsERN1YGbNYTdGY,6798
4
- soifunc/interpolate.py,sha256=MNpYyO037H00vqA5d-WijeBd475oMssEvFLGXgeXPxw,4400
5
- soifunc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- soifunc/resize.py,sha256=PCq-nGt8ZHG4dlx3H1R_dRAebHWEc9Eu_coO3VRGlCY,3028
7
- soifunc-0.11.1.dist-info/LICENSE,sha256=vgEDSMEV1J2nMiCgXE5_sjNtw2VT7_lP7rkAnrFKOWI,1068
8
- soifunc-0.11.1.dist-info/METADATA,sha256=eGGA-OZ6xqMU8J8Yy806Z5vhOktA_-fxpjpMYt8957I,3364
9
- soifunc-0.11.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
- soifunc-0.11.1.dist-info/RECORD,,