Crate rustdct [] [src]

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

  • DCT Type 1
  • DCT Type 2 (Often called "the" DCT - by far the most common algorithm, used by JPEG image compression and others)
  • DCT Type 3 (the inverse of the DCT type 2, also used in JPEG)
  • DCT Type 4
  • MDCT (Used in audio and video compression such as Ogg and MP3)

The recommended way to use RustDCT is to create a DCTplanner instance, then call its plan_dct1 or plan_dct2 or etc methods. Each DCT type has its own method which will choose the best algorithm for the given size.

// 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);

Reexports

pub extern crate rustfft;

Modules

dct1

Algorithms for computing the Discrete Cosine Transform Type 1

dct2

Algorithms for computing the Discrete Cosine Transform Type 2

dct3

Algorithms for computing the Discrete Cosine Transform Type 3

dct4

Algorithms for computing the Discrete Cosine Transform Type 4

mdct

Algorithms for computing the Modified Discrete Cosine Transform

num_complex

Complex numbers.

num_traits

Numeric traits for generic mathematics

Structs

DCTplanner

The DCT planner is used to make new DCT algorithm instances.

Traits

DCTnum

Generic floating point number, implemented for f32 and f64