Avisynth FFT3DGPU
FFT3DGPU is the graphics-card version of FFT3DFilter, a frequency-domain denoiser with optional sharpening. It uses DirectX 9 pixel shaders.
Filtering → Avisynth → DeNoise

What it does
The frame is cut into overlapping blocks. Each block is transformed into frequencies by an FFT on the GPU. Frequencies that are weak compared to the Sigma noise level are reduced by a Wiener filter (in 2D, or in 3D with neighbouring frames) or by a Kalman filter that accumulates all previous frames. After the inverse transform the picture can be sharpened. Block size, overlap and precision trade speed against artifacts like visible block grids.
Requirements
- A DirectX 9 class graphics card (pixel shader 2.0 or higher) and the D3DX9 runtime.
- Windows only. The shader file fft3dgpu.hlsl has to be next to the plugin; Hybrid ships it.
Settings
| Control | Parameter | Range | Hybrid default | Meaning |
|---|---|---|---|---|
| Sigma | sigma | 0–10 | 2 | Noise level at all or the highest frequencies. |
| Beta | beta | 1–100 | 1 | Noise margin; the maximum attenuation is (beta − 1) / beta. |
| Sigma2 / Sigma3 / Sigma4 | sigma2 / sigma3 / sigma4 | 0–10 | off (value 2) | Noise level for the other frequency bands. The value is only used when its check box is ticked; otherwise it follows Sigma. |
| Block width / height | bw / bh | 4, 8, 16, 32, 64, 128, 256, 512 | 32 / 32 | Size of the FFT blocks. |
| Block temporal | bt | −1–4 | 3 | −1 = sharpen only, 0 = Kalman, 1 = spatial 2D, 2 = previous and current frame, 3 = previous, current and next frame, 4 = two previous, current and next frame. |
| Mode | mode | 0–2 | 1 | 0 = overlap 1:1 (fast, artifacts at high sigma), 1 = overlap 2:1 (slower, fewer artifacts), 2 = overlap 1:1 plus an extra border (in between). Kalman works well with 0. |
| Border | bordersize | 0–10 | 1 | Size of the extra border; only with Mode 2. |
| Overlap width / height | ow / oh | 2, 4, 8, 16, 32, 64, 128, 256 | 16 / 16 | Overlap of the blocks; only with Mode 1. Must be even and at most half the block size. |
| Precision | precision | 0–2 | 0 | 0 = 16-bit floats, 1 = 32-bit FFT with 16-bit Wiener/Kalman/sharpen, 2 = 32 bit everywhere. |
| Bit depth | – | no change, 8, 10, 16 bit | no change | Converts the clip to this bit depth before the filter. |
| Plane | plane | 0–4 | 0 | 0 = luma, 1 = U, 2 = V, 3 = U and V, 4 = luma and chroma. |
| Sharpen | sharpen | −100–100 | 0 | 0 = off; useful values are about 0.3–1.0; negative values blur. |
| Sharpen (vertical) | svr | 0–10 | 1 | Strength of the vertical sharpening relative to the horizontal; 0 = none. |
| Sharpen (cutoff) | scutoff | 0–1 | 0.3 | Frequency cutoff of the sharpening. |
| Sharpen (min/max) | smin / smax | −100–100 | 4 / 20 | Limits of the sharpening for weak and strong details. |
| DeGrid | degrid | off / 0–10 | off (value 1) | Reduces the block grid. The value is only used when the box is ticked. The plugin's own default is 1.0 in Mode 1 and 0.0 in Modes 0 and 2, and the greyed-out value shows it for the selected mode. |
| Window type | wintype | half-cosine, mixed, flat | half-cosine | Window applied to the blocks. Half-cosine can show the strongest grid; flat avoids the grid but can ring. |
Example
Default settings on a 10-bit YUV 4:2:0 source (no conversions are added):
FFT3DGPU(ow=16,oh=16,mode=1,precision=0)
How Hybrid calls it
- Hybrid loads FFT3dGPU.dll and calls
FFT3DGPU. - Values are only written when they differ from the defaults. Exceptions: Overlap in Mode 1, Mode and Precision are always written. Border is only written in Mode 2, DeGrid only when ticked.
- Sigma2 to Sigma4 are only written when ticked and not equal to 2.
- Interlaced sources are passed unsplit with
interlaced=true. - Bit depth converts the clip before the filter; with no change the clip keeps its depth.
- FFT3DGPU also offers the common options and can be added to the filter queue several times.
Background
- The plugin was written by Tonny Petersen (tsp) and is based on Fizick's FFT3DFilter. Later builds reach version 0.8.x.
- In the Doom9 thread Mode 1 with Precision 2 is reported to come close to the CPU FFT3DFilter. With high bit depth input newer builds force Precision 2.
- The plugin has a kratio parameter (Kalman ratio, default 2) that Hybrid does not offer.
See also: FFT3DFilter
Sources
- FFT3DGPU documentation (avisynth.org.ru)
- Doom9: FFT3DGPU thread
- Hybrid's tooltips
- The AviSynth+ documentation does not cover FFT3DGPU.