#dct #transform #discrete #cosine #signal-processing #encoding #mdct

rustdct

Compute Discrete Cosine Transforms (DCT) of any size in O(nlogn) time, in pure Rust

12 releases (6 breaking)

0.7.1 Nov 8, 2022
0.7.0 Dec 29, 2021
0.6.0 Jan 5, 2021
0.5.0 Oct 9, 2020
0.1.3 Jun 28, 2017

#504 in Algorithms

Download history 4992/week @ 2023-12-12 3932/week @ 2023-12-19 3139/week @ 2023-12-26 4216/week @ 2024-01-02 5201/week @ 2024-01-09 4578/week @ 2024-01-16 4602/week @ 2024-01-23 4538/week @ 2024-01-30 5150/week @ 2024-02-06 5973/week @ 2024-02-13 7437/week @ 2024-02-20 5421/week @ 2024-02-27 5269/week @ 2024-03-05 5468/week @ 2024-03-12 5503/week @ 2024-03-19 4424/week @ 2024-03-26

21,416 downloads per month
Used in 42 crates (14 directly)

MIT/Apache

205KB
4K SLoC

RustDCT

minimum rustc 1.37

RustDCT is a pure-Rust signal processing library that computes the most common Discrete Cosine Transforms:

  • Discrete Cosine Transform (DCT) Types 1, 2, 3, 4
  • Discrete Sine Transform (DST) Types 1, 2, 3, 4
  • Modified Discrete Cosine Transform (MDCT)

Example

// Compute a DCT Type 2 of size 1234
use rustdct::DctPlanner;

let mut planner = DctPlanner::new();
let mut dct = planner.plan_dct2(1234);

let mut buffer = vec![0f32; 1234];

dct.process_dct2(&mut buffer);

Compatibility

The rustdct crate requires rustc 1.37 or greater.

Releases

Release notes are available in RELEASES.md.

Dependencies

~3MB
~57K SLoC