Avisynth DFTTest

From wiki.selur.net
Revision as of 18:45, 21 November 2026 by Selur (talk | contribs) (Avisynth filter documentation (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

DFTTest is a frequency-domain denoiser. It is slow, but one of the cleanest denoisers: it removes grain and general noise and keeps detail well.

Filtering → Avisynth → DeNoise

DFTTest controls in Hybrid
DFTTest controls in Hybrid

What it does

DFTTest cuts each frame (together with its neighbor frames) into overlapping blocks and transforms them with a discrete Fourier transform. Coefficients that look like noise are reduced, depending on the Typ and Sigma settings. The blocks are then transformed back and blended.

Typical uses:

  • Removing film grain or sensor noise from a clean-looking source.
  • Denoising before encoding, to save bitrate.
  • Denoising only luma or only chroma by switching planes off.

Requirements

  • CPU only, no GPU needed.
  • Needs the single-precision FFTW3 library, which is part of Hybrid's AviSynth package.

Settings

Control Parameter Values / Range Hybrid default Meaning
Typ ftype wiener filter, hard threshold, multiplier, multiplier switched, multiplier modified wiener filter Filter type. wiener filter and hard threshold reduce coefficients depending on how strong they are compared to Sigma. The three multiplier types multiply the coefficients with a factor instead.
Sigma sigma 0–100 16.00 Denoising strength. With the multiplier types it is a factor, so values below 1 are needed to denoise.
Sigma2 sigma2 0–100 16.00 Second strength value. Only available (and only used) with multiplier switched: Sigma applies inside the plugin's power range, Sigma2 outside of it.
Y / U / V Y / U / V on/off all on Planes that are denoised. Planes that are switched off are copied unchanged.
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 function applied to the blocks in the spatial and in the temporal direction.

Example

Default settings on a 10-bit YUV 4:2:0 source. The plugin handles high bit depth itself, so Hybrid adds no conversion:

dfttest()

How Hybrid calls it

  • Hybrid loads dfttest.dll and the FFTW3 library from the AviSynth plugin folder.
  • Only values that differ from the defaults are written. With default settings the call is a plain dfttest(). A plane that is switched off is written as Y=false (or U, V); windows are written as their list index.
  • Accepted formats: planar YUV 4:2:0, 4:2:2 and 4:4:4 with 8–16 bit integer samples. Float, gray and RGB are not offered. The frame size has to be a multiple of 16.
  • DFTTest has no interlaced mode; Hybrid handles interlaced content by splitting it into fields.
  • DFTTest also offers the common options and can be added to the filter queue several times.

Background

This is the dfttest plugin for AviSynth+ (version 1.9.8). It is based on Kevin Stone's original and was extended by DJATOM and pinterf (high bit depth, frame properties, cross-platform build). Since version 1.5 the result is normalized by the power gain of the window, so the strength does not depend on the chosen window.

The plugin has more parameters that Hybrid does not offer: block sizes, overlaps, temporal size, the power range for the switched multiplier types and further window options.

The Vapoursynth DFTTest filter has the same types and windows, but its default Sigma is 8, not 16, so equal numbers do not give equal strength.

Sources

  • dfttest by pinterf (README, parameter descriptions)
  • Hybrid's tooltips
  • The AviSynth+ documentation does not cover DFTTest.