gamut_dsp/lib.rs
1//! Shared digital signal processing routines for the gamut codecs.
2//!
3//! Provides the AV1 1-D transform kernels:
4//! - the lossless 4×4 Walsh–Hadamard pair ([`fwht4x4`] / [`iwht4x4`], AV1 §7.13.2.10),
5//! - the discrete cosine transform pair ([`forward_dct`] / [`inverse_dct`], AV1 §7.13.2.2–.3),
6//! - the asymmetric discrete sine pair ([`forward_adst`] / [`inverse_adst`], AV1 §7.13.2.4–.9 —
7//! DST-VII at size 4, DST-IV at 8/16), with the FLIPADST flip ([`flip_in_place`]), and
8//! - the identity transforms ([`forward_identity`] / [`inverse_identity`], AV1 §7.13.2.11–.15).
9//!
10//! The 2-D assembly that selects per `PlaneTxType` and applies the per-pass normalization shifts
11//! (AV1 §7.13.3) is tracked in `gamut-avif/STATUS.md`.
12//!
13//! Alongside the transforms, [`mod@math`] exposes the small AV1 §4.7 integer arithmetic
14//! primitives ([`round2`], [`round2_signed`], [`clip3`]) and the shared forward-quantize
15//! rounding ([`round_div_nearest`]) that the codec crates build on, and [`mod@mulaw`] adds
16//! µ-law companding/quantization ([`mu_compress`] / [`mu_expand`] / [`mu_quantize`] /
17//! [`mu_dequantize`]).
18#![forbid(unsafe_code)]
19
20mod adst;
21mod butterfly;
22mod dct;
23mod identity;
24mod math;
25mod mulaw;
26mod wht;
27
28pub use adst::{flip_in_place, forward_adst, inverse_adst};
29pub use dct::{forward_dct, inverse_dct};
30pub use identity::{forward_identity, inverse_identity};
31pub use math::{clip3, round_div_nearest, round2, round2_signed};
32pub use mulaw::{mu_compress, mu_dequantize, mu_expand, mu_quantize};
33pub use wht::{fwht4x4, iwht4x4};