Vapoursynth DFTTest: Difference between revisions

From wiki.selur.net
Jump to navigation Jump to search
New filter page (via create-page on MediaWiki MCP Server)
 
Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server)
 
Line 27: Line 27:
== Example ==
== Example ==
Default settings on a 10-bit YUV 4:2:0 source:
Default settings on a 10-bit YUV 4:2:0 source:
<syntaxhighlight lang="python">
<pre>
# denoising using DFTTest
# denoising using DFTTest
clip = core.neo_fft.DFTTest(clip)
clip = core.neo_fft.DFTTest(clip)
</syntaxhighlight>
</pre>


== How Hybrid calls it ==
== How Hybrid calls it ==

Latest revision as of 09:48, 16 November 2026

DFTTest is a frequency-domain denoiser. It works in overlapping blocks across a few neighbor frames and removes the frequency components that look like noise; it keeps detail well and is a common choice for film grain and general noise.

Filtering → Vapoursynth → DeNoise

DFTTest controls in Hybrid
DFTTest controls in Hybrid

What it does

Each frame (together with its neighbor frames) is cut into overlapping blocks. Every block is transformed with a discrete Fourier transform, the coefficients that look like noise are reduced according to the filter type and Sigma, and the blocks are transformed back and blended. The window functions shape the blocks so that no blocking appears.

Settings

Control Parameter Range / values Hybrid default Meaning
Typ ftype wiener filter, hard threshold, multiplier, multiplier switched, multiplier modified wiener filter How coefficients are reduced: Wiener filtering, removal below the threshold, or multiplication by sigma (switched/modified variants depend on the coefficient's power).
Sigma / Sigma2 sigma, sigma2 0 – 100 8 / 8 Strength. With multiplier sigma is a factor, so values below 1 are needed to denoise; Sigma2 is only used by multiplier switched.
Window (spatial / temporal) swin, twin hanning, hamming, blackman, 4 term blackman-harris, kaiser-bessel, 7 term blackman-harris, flat top, rectangular, Bartlett, Bartlett-Hann, Nuttall, Blackman-Nuttall hanning / rectangular Window functions of the spatial and temporal analysis.
Planes planes all, chroma only, luma only all Planes that are filtered.
Tools: DFTTest – neo_fft, dfttest2cpu, dfttest2, vszipcu, vsfeel neo_fft Implementation: neo_fft (CPU, all systems), dfttest2cpu (CPU with AVX2), dfttest2 and vszipcu (NVIDIA CUDA), vsfeel (Vulkan, VapourSynth R80+).

The other DFTTest parameters (block sizes, overlaps, temporal size of 3 frames, power range) keep the defaults of the implementation.

Example

Default settings on a 10-bit YUV 4:2:0 source:

# denoising using DFTTest
clip = core.neo_fft.DFTTest(clip)

How Hybrid calls it

  • DFTTest takes 8–16-bit integer and 32-bit float GRAY, YUV and RGB clips; with vsfeel the clip is converted to 16 bit or float first.
  • Only values that differ from the defaults are written; sigma is passed unchanged.
  • With vsfeel, Hybrid downloads the frames from the GPU after the filter.
  • DFTTest also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

VapourSynth-DFTTest

The original plugin describes five filter types – Wiener, hard threshold, a constant multiplier, a multiplier that switches between sigma and sigma2 depending on whether a coefficient's power lies inside a range (pmin–pmax, default 0–500), and a multiplier modified by the power – and twelve window functions. Its defaults are 16×16 spatial blocks and 3 frames.

neo-fft and the ports

neo-fft is a new implementation of FFT3DFilter and DFTTest in one plugin for VapourSynth and AviSynth+. vs-dfttest2 offers DFTTest with CPU, CUDA and HIP backends; vszipcu and vsfeel are GPU versions in other plugin collections. The GPU versions need an odd temporal size and 16×16 blocks, which are the defaults.

Sources