9 releases
Uses new Rust 2024
| new 0.3.0 | Feb 15, 2026 |
|---|---|
| 0.2.4 | Feb 1, 2026 |
| 0.2.3 | Jan 23, 2026 |
| 0.2.1 | Dec 5, 2025 |
| 0.1.2 | Nov 9, 2025 |
#1663 in Algorithms
5MB
95K
SLoC
Pxdct — Discrete Cosine and Sine Transform Factory
Pxdct is the main entry point for creating optimized DCT (Discrete Cosine Transform) and DST (Discrete Sine
Transform) executors.
It provides a unified API for constructing fast, in-place transform executors using either single (f32) or *
double (f64)* precision.
All executors implement the PxdctExecutor trait and can be used to perform forward or inverse transforms directly on
a mutable data slice.
Features
- Supports DCT-II, DCT-III, DST-II, DST-III, and DCT-IV
- Works with both
f32andf64
Example
use pxdct::Pxdct;
use pxdct::PxdctExecutor;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut data = vec![1.0f32, 2.0, 3.0, 4.0];
// Create a DCT-II executor for f32
let dct2 = Pxdct::make_dct2_f32(data.len())?;
dct2.execute(&mut data)?;
println!("Transformed data: {:?}", data);
Ok(())
}
This project is licensed under either of
at your option.
Dependencies
~9.5MB
~185K SLoC