]> git.nihav.org Git - nihav.git/blame - nihav-realmedia/src/codecs/mod.rs
rv20: fix coefficient quantisation
[nihav.git] / nihav-realmedia / src / codecs / mod.rs
CommitLineData
5641dccf
KS
1use nihav_core::codecs::*;
2
3macro_rules! validate {
4 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
5}
6
7#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
8mod rv3040;
9#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
61d3e294 10#[allow(clippy::erasing_op)]
5641dccf
KS
11mod rv34codes;
12#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
61d3e294 13#[allow(clippy::erasing_op)]
e07387c7 14#[allow(clippy::many_single_char_names)]
5641dccf
KS
15mod rv34dsp;
16
17#[cfg(feature="decoder_realvideo1")]
18pub mod rv10;
19#[cfg(feature="decoder_realvideo2")]
20pub mod rv20;
21#[cfg(feature="decoder_realvideo3")]
22pub mod rv30;
23#[cfg(feature="decoder_realvideo3")]
61d3e294 24#[allow(clippy::erasing_op)]
e07387c7
KS
25#[allow(clippy::many_single_char_names)]
26#[allow(clippy::neg_multiply)]
5641dccf
KS
27pub mod rv30dsp;
28#[cfg(feature="decoder_realvideo4")]
29pub mod rv40;
30#[cfg(feature="decoder_realvideo4")]
61d3e294 31#[allow(clippy::erasing_op)]
e07387c7 32#[allow(clippy::many_single_char_names)]
5641dccf
KS
33pub mod rv40dsp;
34#[cfg(feature="decoder_realvideo6")]
35pub mod rv60;
36#[cfg(feature="decoder_realvideo6")]
37pub mod rv60codes;
38#[cfg(feature="decoder_realvideo6")]
61d3e294 39#[allow(clippy::erasing_op)]
e07387c7 40#[allow(clippy::many_single_char_names)]
5641dccf
KS
41pub mod rv60dsp;
42
43#[cfg(feature="decoder_realaudio144")]
44pub mod ra144;
45#[cfg(feature="decoder_realaudio288")]
46pub mod ra288;
47#[cfg(feature="decoder_cook")]
48pub mod cook;
49#[cfg(feature="decoder_ralf")]
50pub mod ralf;
51
52const RM_CODECS: &[DecoderInfo] = &[
53#[cfg(feature="decoder_realvideo1")]
54 DecoderInfo { name: "realvideo1", get_decoder: rv10::get_decoder },
55#[cfg(feature="decoder_realvideo2")]
56 DecoderInfo { name: "realvideo2", get_decoder: rv20::get_decoder },
57#[cfg(feature="decoder_realvideo3")]
58 DecoderInfo { name: "realvideo3", get_decoder: rv30::get_decoder },
59#[cfg(feature="decoder_realvideo4")]
60 DecoderInfo { name: "realvideo4", get_decoder: rv40::get_decoder },
61#[cfg(feature="decoder_realvideo6")]
62 DecoderInfo { name: "realvideo6", get_decoder: rv60::get_decoder },
63
64#[cfg(feature="decoder_realaudio144")]
65 DecoderInfo { name: "ra14.4", get_decoder: ra144::get_decoder },
66#[cfg(feature="decoder_realaudio288")]
67 DecoderInfo { name: "ra28.8", get_decoder: ra288::get_decoder },
68#[cfg(feature="decoder_cook")]
69 DecoderInfo { name: "cook", get_decoder: cook::get_decoder },
70#[cfg(feature="decoder_ralf")]
71 DecoderInfo { name: "ralf", get_decoder: ralf::get_decoder },
72];
73
e64739f8 74/// Registers all available codecs provided by this crate.
5641dccf 75pub fn realmedia_register_all_codecs(rd: &mut RegisteredDecoders) {
61d3e294 76 for decoder in RM_CODECS.iter() {
5641dccf
KS
77 rd.add_decoder(decoder.clone());
78 }
79}