#discrete #transform #dct #mdct #cosine

rustdct

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

7 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

#10 in Encoding

Download history 124/week @ 2019-11-30 86/week @ 2019-12-07 35/week @ 2019-12-14 6/week @ 2019-12-21 33/week @ 2019-12-28 28/week @ 2020-01-04 36/week @ 2020-01-11 1164/week @ 2020-01-18 342/week @ 2020-01-25 203/week @ 2020-02-01 89/week @ 2020-02-08 269/week @ 2020-02-15 86/week @ 2020-02-22 132/week @ 2020-02-29 413/week @ 2020-03-07 84/week @ 2020-03-14

190 downloads per month
Used in img_hash

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

~460KB