fft ¶
Classes:
-
DFTTest
–2D/3D frequency domain denoiser.
-
FilterType
–Filtering types for DFTTest.
-
NLocation
– -
SInterMode
–SLocation interpolation mode.
-
SLocation
–Specify a range of frequencies to target.
-
SynthesisType
–Synthesis type for spatial processing.
Functions:
-
fft3d
–Applies FFT3DFilter, a 3D frequency-domain filter used for strong denoising and mild sharpening.
Attributes:
-
FilterTypeT
– -
SLocT
– -
SLocationT
– -
SynthesisTypeT
–
SLocationT module-attribute
¶
SLocationT = (
float
| SLocation
| Sequence[Frequency | Sigma]
| Sequence[tuple[Frequency, Sigma]]
| Mapping[Frequency, Sigma]
)
BackendInfo ¶
Bases: KwargsT
Methods:
-
__call__
– -
from_param
–
Attributes:
-
backend
(Backend
) – -
num_streams
(int
) – -
resolved_backend
(Backend
) –
Source code
353 354 355 356 |
|
__call__ ¶
__call__(
clip: VideoNode,
sloc: SLocT | None = None,
ftype: FilterTypeT | None = None,
block_size: int | None = None,
overlap: int | None = None,
tr: int | None = None,
tr_overlap: int | None = None,
swin: SynthesisTypeT | None = None,
twin: SynthesisTypeT | None = None,
zmean: bool | None = None,
alpha: float | None = None,
ssystem: int | None = None,
blockwise: bool = True,
planes: PlanesT = None,
*,
func: FuncExceptT | None = None,
default_args: KwargsT | None = None,
**dkwargs: Any
) -> VideoNode
Source code
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
|
from_param classmethod
¶
from_param(value: Backend | BackendInfo) -> BackendInfo
Source code
358 359 360 |
|
DFTTest ¶
DFTTest(
clip: VideoNode | None = None,
plugin: Backend | BackendInfo = AUTO,
sloc: SLocT | None = None,
**kwargs: Any
)
2D/3D frequency domain denoiser.
Classes:
-
Backend
–
Methods:
-
denoise
– -
extract_freq
– -
insert_freq
– -
merge_freq
–
Attributes:
-
clip
– -
default_args
– -
default_slocation
– -
plugin
–
Source code
540 541 542 543 544 545 546 547 548 549 |
|
Backend ¶
Bases: CustomIntEnum
Methods:
-
__call__
–
Attributes:
__call__ ¶
__call__(*, opt: int = ...) -> BackendInfo
__call__(
*,
threads: int = ...,
fft_threads: int = ...,
opt: int = ...,
dither: int = ...
) -> BackendInfo
__call__(*, device_id: int = 0, in_place: bool = True) -> BackendInfo
__call__(*, device_id: int = 0, num_streams: int = 1) -> BackendInfo
__call__() -> BackendInfo
__call__(**kwargs: Any) -> BackendInfo
__call__(**kwargs: Any) -> BackendInfo
Source code
533 534 |
|
denoise ¶
denoise(
ref: VideoNode,
sloc: SLocT | None = None,
/,
ftype: FilterTypeT = WIENER,
tr: int = 0,
tr_overlap: int = 0,
swin: SynthesisTypeT = HANNING,
twin: SynthesisTypeT = RECTANGULAR,
block_size: int = 16,
overlap: int = 12,
zmean: bool = True,
alpha: float | None = None,
ssystem: int = 0,
blockwise: bool = True,
planes: PlanesT = None,
func: FuncExceptT | None = None,
**kwargs: Any,
) -> VideoNode
denoise(
sloc: SLocT,
/,
*,
ftype: FilterTypeT = WIENER,
tr: int = 0,
tr_overlap: int = 0,
swin: SynthesisTypeT = HANNING,
twin: SynthesisTypeT = RECTANGULAR,
block_size: int = 16,
overlap: int = 12,
zmean: bool = True,
alpha: float | None = None,
ssystem: int = 0,
blockwise: bool = True,
planes: PlanesT = None,
func: FuncExceptT | None = None,
**kwargs: Any,
) -> VideoNode
denoise(
ref_or_sloc: VideoNode | SLocT,
sloc: SLocT | None = None,
/,
ftype: FilterTypeT = WIENER,
tr: int = 0,
tr_overlap: int = 0,
swin: SynthesisTypeT = HANNING,
twin: SynthesisTypeT = RECTANGULAR,
block_size: int = 16,
overlap: int = 12,
zmean: bool = True,
alpha: float | None = None,
ssystem: int = 0,
blockwise: bool = True,
planes: PlanesT = None,
func: FuncExceptT | None = None,
**kwargs: Any,
) -> VideoNode
Source code
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 |
|
extract_freq ¶
Source code
616 617 618 619 |
|
insert_freq ¶
Source code
621 622 623 |
|
merge_freq ¶
Source code
625 626 627 628 629 |
|
FilterType ¶
Bases: CustomIntEnum
Filtering types for DFTTest.
Methods:
-
__call__
–
Attributes:
-
MULT
–mult = sigma
-
MULT_PSD
–mult = (psd >= pmin && psd <= pmax) ? sigma : sigma2
-
MULT_RANGE
–mult = sigma * sqrt((psd * pmax) / ((psd + pmin) * (psd + pmax)))
-
THR
–mult = psd < sigma ? 0.0 : 1.0
-
WIENER
–mult = max((psd - sigma) / psd, 0) ^ f0beta
MULT_PSD class-attribute
instance-attribute
¶
MULT_PSD = 3
mult = (psd >= pmin && psd <= pmax) ? sigma : sigma2
MULT_RANGE class-attribute
instance-attribute
¶
MULT_RANGE = 4
mult = sigma * sqrt((psd * pmax) / ((psd + pmin) * (psd + pmax)))
__call__ ¶
__call__(**kwargs: Any) -> FilterTypeWithInfo
Source code
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
FilterTypeWithInfo ¶
Bases: KwargsT
NLocation ¶
SInterMode ¶
Bases: CustomEnum
SLocation interpolation mode.
Methods:
-
__call__
–
Attributes:
-
CUBIC
– -
LINEAR
– -
NEAREST
– -
NEAREST_UP
– -
QUADRATIC
– -
SPLINE
– -
SPLINE_LINEAR
– -
ZERO
–
__call__ ¶
__call__(location: SLocationT, /, res: int = 20, digits: int = 3) -> SLocation
__call__(
h_loc: SLocationT | None = None,
v_loc: SLocationT | None = None,
t_loc: SLocationT | None = None,
/,
res: int = 20,
digits: int = 3,
) -> MultiDim
__call__(
*location: SLocationT, res: int = 20, digits: int = 3
) -> SLocation | MultiDim
__call__(
*locations: SLocationT, res: int = 20, digits: int = 3
) -> SLocation | MultiDim
Source code
65 66 67 68 69 70 71 |
|
SLocation ¶
SLocation(
locations: (
Sequence[Frequency | Sigma]
| Sequence[tuple[Frequency, Sigma]]
| Mapping[Frequency, Sigma]
),
interpolate: SInterMode | None = None,
strict: bool = True,
)
Specify a range of frequencies to target.
Classes:
-
MultiDim
–
Methods:
-
boundsCheck
– -
from_param
– -
interpolate
–
Attributes:
Source code
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
MultiDim dataclass
¶
MultiDim(
horizontal: SLocationT | Literal[False] | None = None,
vertical: SLocationT | Literal[False] | None = None,
temporal: SLocationT | Literal[False] | None = None,
)
Attributes:
-
horizontal
(SLocationT | Literal[False] | None
) – -
temporal
(SLocationT | Literal[False] | None
) – -
vertical
(SLocationT | Literal[False] | None
) –
horizontal class-attribute
instance-attribute
¶
horizontal: SLocationT | Literal[False] | None = None
boundsCheck classmethod
¶
boundsCheck(
values: list[float],
bounds: tuple[float | None, float | None],
strict: bool = False,
) -> list[float]
Source code
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
from_param classmethod
¶
from_param(location: SLocationT | Literal[False]) -> SLocBoundT
from_param(location: SLocationT | Literal[False] | None) -> SLocBoundT | None
from_param(location: SLocationT | Literal[False] | None) -> SLocBoundT | None
Source code
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
interpolate ¶
interpolate(
method: SInterMode = LINEAR, res: int = 20, digits: int = 3
) -> SLocation
Source code
173 174 175 176 177 178 179 180 181 |
|
SynthesisType ¶
Bases: CustomIntEnum
Synthesis type for spatial processing.
Methods:
-
__call__
–
Attributes:
-
BARLETT
– -
BARLETT_HANN
– -
BLACKMAN
– -
BLACKMAN_HARRIS_4TERM
– -
BLACKMAN_HARRIS_7TERM
– -
BLACKMAN_NUTTALL
– -
FLAT_TOP
– -
HAMMING
– -
HANNING
– -
KAISER_BESSEL
– -
NUTTALL
– -
RECTANGULAR
–
__call__ ¶
__call__(**kwargs: Any) -> SynthesisTypeWithInfo
Source code
339 340 341 342 343 |
|
fft3d ¶
Applies FFT3DFilter, a 3D frequency-domain filter used for strong denoising and mild sharpening.
This filter processes frames using the Fast Fourier Transform (FFT) in the frequency domain. Unlike local filters, FFT3DFilter performs block-based, non-local processing.
Official documentation: https://github.com/myrsloik/VapourSynth-FFT3DFilter/blob/master/doc/fft3dfilter.md
Possibly faster implementation: https://github.com/AmusementClub/VapourSynth-FFT3DFilter/releases
Note: Sigma values are internally scaled according to bit depth, unlike when using the plugin directly.
Parameters:
-
clip
¶VideoNode
) –Input video clip.
-
**kwargs
¶Any
, default:{}
) –Additional parameters passed to the FFT3DFilter plugin.
Returns:
-
ConstantFormatVideoNode
–A heavily degraded version of DFTTest, with added banding and color shifts.
Source code
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
|