Skip to main content

Module wavelet

Module wavelet 

Source
Expand description

Separable multi-level 3D wavelet transforms by lifting.

  • CDF 9/7 (f64 lifting, the JPEG 2000 irreversible filter): the lossy path. Float, but plain IEEE +/* in a fixed order with no fused ops, so the CPU decoder is deterministic.
  • LeGall 5/3 (integer lifting, the JPEG 2000 reversible filter): the lossless path, exact on i32.

Both use whole-sample symmetric extension and work on any length ≥ 1 (odd lengths keep the extra sample in the low band). The pyramid is dyadic on the LL region; at each level every axis whose current length is ≥ MIN_LEN is split, so a 64×128×128 block gets 4 levels on its short axis and 5 on the others (anisotropic bands where axes stop early). Arrays are always handled as 3D, with leading unit axes for 1D/2D input.

Structs§

Band
A subband: level level (0 = finest), orientation mask (bit a set = highpass along axis a; mask == 0 is the final LL), half-open region.
Pyramid
The dyadic pyramid for a shape.

Constants§

MAX_LEVELS
Level cap for 2D/3D arrays.
MAX_LEVELS_1D
Level cap for 1D signals (and the size of the basis-norm table).
MIN_LEN
An axis is split at a level only while its LL length is at least this.

Functions§

as3
Pad an n-D shape (n ≤ 3) to 3D with leading unit axes.
forward_53
Forward multi-level integer 5/3 in place.
forward_97
Forward multi-level CDF 9/7 in place.
fwd53
One level of forward integer 5/3 (reversible) on x.
fwd97
One level of forward CDF 9/7 on x (in place: low half first).
inv53
Inverse of fwd53.
inv97
Inverse of fwd97.
inverse_53
Inverse multi-level integer 5/3 in place.
inverse_97
Inverse multi-level CDF 9/7 in place.
norms_97
1D synthesis-basis norms (lo[k], hi[k]) after k splits (lo[0] = 1).