Vapoursynth FFT3DFilter

From wiki.selur.net
Jump to navigation Jump to search

FFT3DFilter is a frequency-domain denoiser: it works in overlapping blocks of the current and the neighbor frames and reduces the frequencies that look like noise. Even strong settings give few artifacts, and the result compresses better. It can also sharpen mildly without boosting the noise.

Filtering → Vapoursynth → DeNoise

FFT3DFilter controls in Hybrid
FFT3DFilter controls in Hybrid

What it does

Each frame is cut into overlapping blocks that are transformed with an FFT. Weak frequency components are reduced with a Wiener filter – 2D with the current frame only, 3D when neighbor frames are included. The Kalman mode instead accumulates all previous frames.

Settings

Control Parameter Range / values Hybrid default Meaning
Sigma sigma 0 – 40 2 Noise level for the highest frequencies, on the 8-bit scale.
Sigma2 / Sigma3 / Sigma4 sigma2, sigma3, sigma4 0 – 40 = Sigma Noise levels at the second and third scale and for the lowest frequencies; used only when their check box is ticked.
Beta beta 1 – 100 1 Noise margin: how much noise is left (largest attenuation (beta-1)/beta).
Block (width / height) bw, bh 4, 8, 16, 32, 48, 64, 128, 256, 512 32 / 32 Block size.
Block (temporal) bt -1 – 5 3 -1 = sharpen only, 0 = Kalman (all previous frames), 1 = spatial only, 2 = previous and current, 3 = previous, current and next, 4 = two previous, current and next, 5 = two previous, current and two next.
Sharpen sharpen 0 – 1 0 Sharpening after denoising; 0 = off.
Plane planes all, chroma only, luma only, only U, only V, only Y,U, only Y,V all Planes that are filtered.

Example

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

# denoising using neo-fft
clip = core.neo_fft.FFT3D(clip)

How Hybrid calls it

  • FFT3DFilter takes 8–16-bit integer and 32-bit float GRAY, YUV and RGB clips; other formats are converted first.
  • Values are only written when they differ from the defaults; Sigma2–4 only while their check box is ticked. The plugin scales sigma to the bit depth.
  • FFT3DFilter also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

neo-fft

Hybrid uses neo-fft, a new implementation of FFT3DFilter and DFTTest in one plugin for VapourSynth and AviSynth+. Its output is not guaranteed to be pixel-identical to the classic FFT3DFilter. It also offers parameters Hybrid does not expose, for example block overlap, dehaloing and degrid.

FFT3DFilter

The classic FFT3DFilter by Fizick introduced the combination of a 3D Wiener filter, the Kalman mode and the frequency-based sharpening; its original block size was 48.

Sources