#discrete #transform #dct #mdct #cosine

rustdct

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

8 unstable releases (3 breaking)

0.4.0 Jan 22, 2019
0.3.0 Aug 6, 2018
0.2.1 Mar 19, 2018
0.1.3 Jun 28, 2017
0.1.1 May 24, 2017

#33 in Encoding

Download history 10/week @ 2019-01-15 14/week @ 2019-01-22 7/week @ 2019-01-29 2/week @ 2019-02-12 3/week @ 2019-02-19 20/week @ 2019-02-26 2/week @ 2019-03-05 2/week @ 2019-03-12 16/week @ 2019-03-19 61/week @ 2019-03-26 10/week @ 2019-04-02 6/week @ 2019-04-09 5/week @ 2019-04-16 19/week @ 2019-04-23

80 downloads per month

MIT/Apache

155KB
3K SLoC

RustDCT

minimum rustc 1.26

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 input:  Vec<f32> = vec![0f32; 1234];
let mut output: Vec<f32> = vec![0f32; 1234];

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

dct.process(&mut input, &mut output);

Compatibility

The rustdct crate requires rustc 1.26 or greater.

Releases

Release notes are available in RELEASES.md.

Dependencies

~403KB