#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

#7 in Encoding

Download history 35/week @ 2018-11-28 9/week @ 2018-12-05 10/week @ 2018-12-12 53/week @ 2018-12-19 12/week @ 2018-12-26 9/week @ 2019-01-02 11/week @ 2019-01-09 17/week @ 2019-01-16 5/week @ 2019-01-23 7/week @ 2019-01-30 2/week @ 2019-02-13 3/week @ 2019-02-20 20/week @ 2019-02-27 4/week @ 2019-03-06

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

~405KB