From: Kostya Shishkov Date: Thu, 17 Jan 2019 11:25:49 +0000 (+0100) Subject: split NihAV into subcrates X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=5641dccfbf2a70d589cf094a0d4ed5a10f919f00;p=nihav.git split NihAV into subcrates --- diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 6bda4bb..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,50 +0,0 @@ -[package] -name = "nihav" -version = "0.1.0" -authors = ["Kostya Shishkov "] -edition = "2018" - -[features] -default = ["all_decoders", "all_demuxers"] -demuxers = [] -all_demuxers = ["demuxer_avi", "demuxer_gdv", "demuxer_real"] -demuxer_avi = ["demuxers"] -demuxer_gdv = ["demuxers"] -demuxer_real = ["demuxers"] - -decoders = [] -h263 = [] - -dsp = [] -fft = ["dsp"] -mdct = ["fft", "dsp"] -dsp_window = ["dsp"] - -all_decoders = ["all_video_decoders", "all_audio_decoders"] - -all_video_decoders = ["decoder_clearvideo", "decoder_gdvvid", "decoder_indeo2", "decoder_indeo3", "decoder_indeo4", "decoder_indeo5", "decoder_intel263", "decoder_realvideo1", "decoder_realvideo2", "decoder_realvideo3", "decoder_realvideo4", "decoder_realvideo6"] -decoder_clearvideo = ["decoders"] -decoder_gdvvid = ["decoders"] -decoder_indeo2 = ["decoders"] -decoder_indeo3 = ["decoders"] -decoder_indeo4 = ["decoders"] -decoder_indeo5 = ["decoders"] -decoder_intel263 = ["h263", "decoders"] -decoder_realvideo1 = ["h263", "decoders"] -decoder_realvideo2 = ["h263", "decoders"] -decoder_realvideo3 = ["decoders"] -decoder_realvideo4 = ["decoders"] -decoder_realvideo6 = ["decoders"] - -all_audio_decoders = ["decoder_pcm", "decoder_imc", "decoders_real"] -decoder_pcm = ["decoders"] -decoder_ts102366 = ["decoders", "fft"] -decoder_imc = ["decoders", "fft", "dsp_window"] -decoders_real = ["decoder_realaudio144", "decoder_realaudio288", "decoder_sipro", "decoder_ts102366", "decoder_cook", "decoder_atrac3", "decoder_aac", "decoder_ralf"] -decoder_realaudio144 = ["decoders"] -decoder_realaudio288 = ["decoders"] -decoder_sipro = ["decoders"] -decoder_cook = ["decoders", "fft", "mdct"] -decoder_atrac3 = ["decoders", "mdct"] -decoder_aac = ["decoders", "mdct", "dsp_window"] -decoder_ralf = ["decoders"] diff --git a/nihav-allstuff/Cargo.toml b/nihav-allstuff/Cargo.toml new file mode 100644 index 0000000..e366f4e --- /dev/null +++ b/nihav-allstuff/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "nihav_allstuff" +version = "0.1.0" +authors = ["Kostya Shishkov "] +edition = "2018" + +[dependencies] +nihav_core = { path = "../nihav-core" } +nihav_game = { path = "../nihav-game" } +nihav_indeo = { path = "../nihav-indeo" } +nihav_realmedia = { path = "../nihav-realmedia" } \ No newline at end of file diff --git a/nihav-allstuff/src/lib.rs b/nihav-allstuff/src/lib.rs new file mode 100644 index 0000000..cb1e713 --- /dev/null +++ b/nihav-allstuff/src/lib.rs @@ -0,0 +1,28 @@ +extern crate nihav_core; +extern crate nihav_game; +extern crate nihav_indeo; +extern crate nihav_realmedia; + +use nihav_core::codecs::{RegisteredDecoders, core_register_all_codecs}; +use nihav_core::demuxers::{RegisteredDemuxers, core_register_all_demuxers}; + +use nihav_game::codecs::game_register_all_codecs; +use nihav_game::demuxers::game_register_all_demuxers; + +use nihav_indeo::codecs::indeo_register_all_codecs; + +use nihav_realmedia::codecs::realmedia_register_all_codecs; +use nihav_realmedia::demuxers::realmedia_register_all_demuxers; + +pub fn nihav_register_all_codecs(rd: &mut RegisteredDecoders) { + core_register_all_codecs(rd); + game_register_all_codecs(rd); + indeo_register_all_codecs(rd); + realmedia_register_all_codecs(rd); +} + +pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) { + core_register_all_demuxers(rd); + game_register_all_demuxers(rd); + realmedia_register_all_demuxers(rd); +} diff --git a/nihav-core/Cargo.toml b/nihav-core/Cargo.toml new file mode 100644 index 0000000..35657bc --- /dev/null +++ b/nihav-core/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "nihav_core" +version = "0.1.0" +authors = ["Kostya Shishkov "] +edition = "2018" + +[features] +default = ["all_decoders", "all_demuxers"] +demuxers = [] +all_demuxers = ["demuxer_avi"] +demuxer_avi = ["demuxers"] + +decoders = [] +h263 = [] + +dsp = [] +fft = ["dsp"] +mdct = ["fft", "dsp"] +dsp_window = ["dsp"] + +all_decoders = ["all_video_decoders", "all_audio_decoders"] + +all_video_decoders = ["decoder_clearvideo"] +decoder_clearvideo = ["decoders"] + +all_audio_decoders = ["decoder_pcm", "decoder_ts102366", "decoder_sipro", "decoder_atrac3", "decoder_aac"] +decoder_pcm = ["decoders"] +decoder_ts102366 = ["decoders", "fft"] +decoder_sipro = ["decoders"] +decoder_atrac3 = ["decoders", "mdct"] +decoder_aac = ["decoders", "mdct", "dsp_window"] diff --git a/src/TODO b/nihav-core/src/TODO similarity index 100% rename from src/TODO rename to nihav-core/src/TODO diff --git a/src/codecs/aac.rs b/nihav-core/src/codecs/aac.rs similarity index 100% rename from src/codecs/aac.rs rename to nihav-core/src/codecs/aac.rs diff --git a/src/codecs/atrac3.rs b/nihav-core/src/codecs/atrac3.rs similarity index 100% rename from src/codecs/atrac3.rs rename to nihav-core/src/codecs/atrac3.rs diff --git a/src/codecs/blockdsp.rs b/nihav-core/src/codecs/blockdsp.rs similarity index 100% rename from src/codecs/blockdsp.rs rename to nihav-core/src/codecs/blockdsp.rs diff --git a/src/codecs/clearvideo.rs b/nihav-core/src/codecs/clearvideo.rs similarity index 100% rename from src/codecs/clearvideo.rs rename to nihav-core/src/codecs/clearvideo.rs diff --git a/src/codecs/h263/code.rs b/nihav-core/src/codecs/h263/code.rs similarity index 100% rename from src/codecs/h263/code.rs rename to nihav-core/src/codecs/h263/code.rs diff --git a/src/codecs/h263/data.rs b/nihav-core/src/codecs/h263/data.rs similarity index 100% rename from src/codecs/h263/data.rs rename to nihav-core/src/codecs/h263/data.rs diff --git a/src/codecs/h263/decoder.rs b/nihav-core/src/codecs/h263/decoder.rs similarity index 100% rename from src/codecs/h263/decoder.rs rename to nihav-core/src/codecs/h263/decoder.rs diff --git a/src/codecs/h263/mod.rs b/nihav-core/src/codecs/h263/mod.rs similarity index 98% rename from src/codecs/h263/mod.rs rename to nihav-core/src/codecs/h263/mod.rs index 8718887..1cd10a2 100644 --- a/src/codecs/h263/mod.rs +++ b/nihav-core/src/codecs/h263/mod.rs @@ -5,13 +5,6 @@ pub mod code; pub mod data; pub mod decoder; -#[cfg(feature="decoder_intel263")] -pub mod intel263; -#[cfg(feature="decoder_realvideo1")] -pub mod rv10; -#[cfg(feature="decoder_realvideo2")] -pub mod rv20; - pub trait BlockDecoder { fn decode_pichdr(&mut self) -> DecoderResult; fn decode_slice_header(&mut self, pinfo: &PicInfo) -> DecoderResult; diff --git a/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs similarity index 61% rename from src/codecs/mod.rs rename to nihav-core/src/codecs/mod.rs index 92aba8e..f3fabf3 100644 --- a/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -50,21 +50,21 @@ macro_rules! validate { } #[allow(dead_code)] -struct HAMShuffler { +pub struct HAMShuffler { lastframe: Option>, } impl HAMShuffler { #[allow(dead_code)] - fn new() -> Self { HAMShuffler { lastframe: None } } + pub fn new() -> Self { HAMShuffler { lastframe: None } } #[allow(dead_code)] - fn clear(&mut self) { self.lastframe = None; } + pub fn clear(&mut self) { self.lastframe = None; } #[allow(dead_code)] - fn add_frame(&mut self, buf: NAVideoBuffer) { + pub fn add_frame(&mut self, buf: NAVideoBuffer) { self.lastframe = Some(buf); } #[allow(dead_code)] - fn clone_ref(&mut self) -> Option> { + pub fn clone_ref(&mut self) -> Option> { if let Some(ref mut frm) = self.lastframe { let newfrm = frm.copy_buffer(); *frm = newfrm.clone(); @@ -74,7 +74,7 @@ impl HAMShuffler { } } #[allow(dead_code)] - fn get_output_frame(&mut self) -> Option> { + pub fn get_output_frame(&mut self) -> Option> { match self.lastframe { Some(ref frm) => Some(frm.clone()), None => None, @@ -83,21 +83,21 @@ impl HAMShuffler { } #[allow(dead_code)] -struct IPShuffler { +pub struct IPShuffler { lastframe: Option>, } impl IPShuffler { #[allow(dead_code)] - fn new() -> Self { IPShuffler { lastframe: None } } + pub fn new() -> Self { IPShuffler { lastframe: None } } #[allow(dead_code)] - fn clear(&mut self) { self.lastframe = None; } + pub fn clear(&mut self) { self.lastframe = None; } #[allow(dead_code)] - fn add_frame(&mut self, buf: NAVideoBuffer) { + pub fn add_frame(&mut self, buf: NAVideoBuffer) { self.lastframe = Some(buf); } #[allow(dead_code)] - fn get_ref(&mut self) -> Option> { + pub fn get_ref(&mut self) -> Option> { if let Some(ref frm) = self.lastframe { Some(frm.clone()) } else { @@ -107,23 +107,23 @@ impl IPShuffler { } #[allow(dead_code)] -struct IPBShuffler { +pub struct IPBShuffler { lastframe: Option>, nextframe: Option>, } impl IPBShuffler { #[allow(dead_code)] - fn new() -> Self { IPBShuffler { lastframe: None, nextframe: None } } + pub fn new() -> Self { IPBShuffler { lastframe: None, nextframe: None } } #[allow(dead_code)] - fn clear(&mut self) { self.lastframe = None; self.nextframe = None; } + pub fn clear(&mut self) { self.lastframe = None; self.nextframe = None; } #[allow(dead_code)] - fn add_frame(&mut self, buf: NAVideoBuffer) { + pub fn add_frame(&mut self, buf: NAVideoBuffer) { mem::swap(&mut self.lastframe, &mut self.nextframe); self.lastframe = Some(buf); } #[allow(dead_code)] - fn get_lastref(&mut self) -> Option> { + pub fn get_lastref(&mut self) -> Option> { if let Some(ref frm) = self.lastframe { Some(frm.clone()) } else { @@ -131,7 +131,7 @@ impl IPBShuffler { } } #[allow(dead_code)] - fn get_nextref(&mut self) -> Option> { + pub fn get_nextref(&mut self) -> Option> { if let Some(ref frm) = self.nextframe { Some(frm.clone()) } else { @@ -139,7 +139,7 @@ impl IPBShuffler { } } #[allow(dead_code)] - fn get_b_fwdref(&mut self) -> Option> { + pub fn get_b_fwdref(&mut self) -> Option> { if let Some(ref frm) = self.nextframe { Some(frm.clone()) } else { @@ -147,7 +147,7 @@ impl IPBShuffler { } } #[allow(dead_code)] - fn get_b_bwdref(&mut self) -> Option> { + pub fn get_b_bwdref(&mut self) -> Option> { if let Some(ref frm) = self.lastframe { Some(frm.clone()) } else { @@ -231,23 +231,19 @@ pub trait NADecoder { #[derive(Clone,Copy)] pub struct DecoderInfo { - name: &'static str, - get_decoder: fn () -> Box, + pub name: &'static str, + pub get_decoder: fn () -> Box, } -#[cfg(any(feature="h263", feature="decoder_realvideo3", feature="decoder_realvideo4"))] -mod blockdsp; +#[cfg(any(feature="h263"))] +pub mod blockdsp; #[cfg(feature="decoder_clearvideo")] mod clearvideo; #[cfg(feature="decoder_gdvvid")] mod gremlinvideo; -#[cfg(any(feature="decoder_indeo2", feature="decoder_indeo3", feature="decoder_indeo4", feature="decoder_indeo5", feature="decoder_imc"))] -mod indeo; #[cfg(feature="h263")] -mod h263; -#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4", feature="decoder_realvideo6", feature="decoder_realaudio144", feature="decoder_realaudio288", feature="decoder_cook", feature="decoder_ralf"))] -mod real; +pub mod h263; #[cfg(feature="decoder_aac")] mod aac; @@ -265,60 +261,42 @@ const DECODERS: &[DecoderInfo] = &[ DecoderInfo { name: "clearvideo", get_decoder: clearvideo::get_decoder }, #[cfg(feature="decoder_clearvideo")] DecoderInfo { name: "clearvideo_rm", get_decoder: clearvideo::get_decoder_rm }, -#[cfg(feature="decoder_gdvvid")] - DecoderInfo { name: "gdv-audio", get_decoder: gremlinvideo::get_decoder_audio }, -#[cfg(feature="decoder_gdvvid")] - DecoderInfo { name: "gdv-video", get_decoder: gremlinvideo::get_decoder_video }, -#[cfg(feature="decoder_indeo2")] - DecoderInfo { name: "indeo2", get_decoder: indeo::indeo2::get_decoder }, -#[cfg(feature="decoder_indeo3")] - DecoderInfo { name: "indeo3", get_decoder: indeo::indeo3::get_decoder }, -#[cfg(feature="decoder_indeo4")] - DecoderInfo { name: "indeo4", get_decoder: indeo::indeo4::get_decoder }, -#[cfg(feature="decoder_indeo5")] - DecoderInfo { name: "indeo5", get_decoder: indeo::indeo5::get_decoder }, -#[cfg(feature="decoder_intel263")] - DecoderInfo { name: "intel263", get_decoder: h263::intel263::get_decoder }, -#[cfg(feature="decoder_realvideo1")] - DecoderInfo { name: "realvideo1", get_decoder: h263::rv10::get_decoder }, -#[cfg(feature="decoder_realvideo2")] - DecoderInfo { name: "realvideo2", get_decoder: h263::rv20::get_decoder }, -#[cfg(feature="decoder_realvideo3")] - DecoderInfo { name: "realvideo3", get_decoder: real::rv30::get_decoder }, -#[cfg(feature="decoder_realvideo4")] - DecoderInfo { name: "realvideo4", get_decoder: real::rv40::get_decoder }, -#[cfg(feature="decoder_realvideo6")] - DecoderInfo { name: "realvideo6", get_decoder: real::rv60::get_decoder }, #[cfg(feature="decoder_pcm")] DecoderInfo { name: "pcm", get_decoder: pcm::get_decoder }, -#[cfg(feature="decoder_imc")] - DecoderInfo { name: "imc", get_decoder: indeo::imc::get_decoder_imc }, -#[cfg(feature="decoder_imc")] - DecoderInfo { name: "iac", get_decoder: indeo::imc::get_decoder_iac }, -#[cfg(feature="decoder_realaudio144")] - DecoderInfo { name: "ra14.4", get_decoder: real::ra144::get_decoder }, -#[cfg(feature="decoder_realaudio288")] - DecoderInfo { name: "ra28.8", get_decoder: real::ra288::get_decoder }, #[cfg(feature="decoder_sipro")] DecoderInfo { name: "sipro", get_decoder: sipro::get_decoder }, #[cfg(feature="decoder_ts102366")] DecoderInfo { name: "ac3", get_decoder: ts102366::get_decoder }, -#[cfg(feature="decoder_cook")] - DecoderInfo { name: "cook", get_decoder: real::cook::get_decoder }, #[cfg(feature="decoder_atrac3")] DecoderInfo { name: "atrac3", get_decoder: atrac3::get_decoder }, #[cfg(feature="decoder_aac")] DecoderInfo { name: "aac", get_decoder: aac::get_decoder }, -#[cfg(feature="decoder_ralf")] - DecoderInfo { name: "ralf", get_decoder: real::ralf::get_decoder }, ]; -pub fn find_decoder(name: &str) -> Option Box> { - for &dec in DECODERS { - if dec.name == name { - return Some(dec.get_decoder); +pub fn core_register_all_codecs(rd: &mut RegisteredDecoders) { + for decoder in DECODERS.into_iter() { + rd.add_decoder(decoder.clone()); + } +} + +pub struct RegisteredDecoders { + decs: Vec, +} + +impl RegisteredDecoders { + pub fn new() -> Self { + Self { decs: Vec::new() } + } + pub fn add_decoder(&mut self, dec: DecoderInfo) { + self.decs.push(dec); + } + pub fn find_decoder(&self, name: &str) -> Option Box> { + for &dec in self.decs.iter() { + if dec.name == name { + return Some(dec.get_decoder); + } } + None } - None } diff --git a/src/codecs/pcm.rs b/nihav-core/src/codecs/pcm.rs similarity index 100% rename from src/codecs/pcm.rs rename to nihav-core/src/codecs/pcm.rs diff --git a/src/codecs/sipro.rs b/nihav-core/src/codecs/sipro.rs similarity index 100% rename from src/codecs/sipro.rs rename to nihav-core/src/codecs/sipro.rs diff --git a/src/codecs/ts102366.rs b/nihav-core/src/codecs/ts102366.rs similarity index 100% rename from src/codecs/ts102366.rs rename to nihav-core/src/codecs/ts102366.rs diff --git a/src/demuxers/avi.rs b/nihav-core/src/demuxers/avi.rs similarity index 100% rename from src/demuxers/avi.rs rename to nihav-core/src/demuxers/avi.rs diff --git a/src/demuxers/mod.rs b/nihav-core/src/demuxers/mod.rs similarity index 90% rename from src/demuxers/mod.rs rename to nihav-core/src/demuxers/mod.rs index adf954a..56e670d 100644 --- a/src/demuxers/mod.rs +++ b/nihav-core/src/demuxers/mod.rs @@ -14,7 +14,7 @@ pub enum DemuxerError { TryAgain, } -type DemuxerResult = Result; +pub type DemuxerResult = Result; pub trait DemuxCore<'a> { fn open(&mut self, strmgr: &mut StreamManager) -> DemuxerResult<()>; @@ -204,39 +204,45 @@ macro_rules! validate { ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } }; } -#[cfg(feature="demuxer_gdv")] -mod gdv; #[cfg(feature="demuxer_avi")] mod avi; -#[cfg(feature="demuxer_real")] -mod realmedia; const DEMUXERS: &[&'static DemuxerCreator] = &[ #[cfg(feature="demuxer_avi")] &avi::AVIDemuxerCreator {}, -#[cfg(feature="demuxer_gdv")] - &gdv::GDVDemuxerCreator {}, -#[cfg(feature="demuxer_real")] - &realmedia::RealMediaDemuxerCreator {}, -#[cfg(feature="demuxer_real")] - &realmedia::RealAudioDemuxerCreator {}, -#[cfg(feature="demuxer_real")] - &realmedia::RealIVRDemuxerCreator {}, ]; -pub fn find_demuxer(name: &str) -> Option<&DemuxerCreator> { - for &dmx in DEMUXERS { - if dmx.get_name() == name { - return Some(dmx); - } - } - None -} - pub fn create_demuxer<'a>(dmxcr: &DemuxerCreator, br: &'a mut ByteReader<'a>) -> DemuxerResult> { let mut dmx = dmxcr.new_demuxer(br); let mut str = StreamManager::new(); dmx.open(&mut str)?; Ok(Demuxer::new(dmx, str)) } + +pub struct RegisteredDemuxers { + dmxs: Vec<&'static DemuxerCreator>, +} + +impl RegisteredDemuxers { + pub fn new() -> Self { + Self { dmxs: Vec::new() } + } + pub fn add_demuxer(&mut self, dmx: &'static DemuxerCreator) { + self.dmxs.push(dmx); + } + pub fn find_demuxer(&self, name: &str) -> Option<&DemuxerCreator> { + for &dmx in self.dmxs.iter() { + if dmx.get_name() == name { + return Some(dmx); + } + } + None + } +} + +pub fn core_register_all_demuxers(rd: &mut RegisteredDemuxers) { + for demuxer in DEMUXERS.into_iter() { + rd.add_demuxer(*demuxer); + } +} diff --git a/src/detect.rs b/nihav-core/src/detect.rs similarity index 100% rename from src/detect.rs rename to nihav-core/src/detect.rs diff --git a/src/dsp/fft.rs b/nihav-core/src/dsp/fft.rs similarity index 100% rename from src/dsp/fft.rs rename to nihav-core/src/dsp/fft.rs diff --git a/src/dsp/mdct.rs b/nihav-core/src/dsp/mdct.rs similarity index 100% rename from src/dsp/mdct.rs rename to nihav-core/src/dsp/mdct.rs diff --git a/src/dsp/mod.rs b/nihav-core/src/dsp/mod.rs similarity index 100% rename from src/dsp/mod.rs rename to nihav-core/src/dsp/mod.rs diff --git a/src/dsp/window.rs b/nihav-core/src/dsp/window.rs similarity index 100% rename from src/dsp/window.rs rename to nihav-core/src/dsp/window.rs diff --git a/src/formats.rs b/nihav-core/src/formats.rs similarity index 100% rename from src/formats.rs rename to nihav-core/src/formats.rs diff --git a/src/frame.rs b/nihav-core/src/frame.rs similarity index 100% rename from src/frame.rs rename to nihav-core/src/frame.rs diff --git a/src/io/bitreader.rs b/nihav-core/src/io/bitreader.rs similarity index 100% rename from src/io/bitreader.rs rename to nihav-core/src/io/bitreader.rs diff --git a/src/io/byteio.rs b/nihav-core/src/io/byteio.rs similarity index 100% rename from src/io/byteio.rs rename to nihav-core/src/io/byteio.rs diff --git a/src/io/codebook.rs b/nihav-core/src/io/codebook.rs similarity index 100% rename from src/io/codebook.rs rename to nihav-core/src/io/codebook.rs diff --git a/src/io/intcode.rs b/nihav-core/src/io/intcode.rs similarity index 100% rename from src/io/intcode.rs rename to nihav-core/src/io/intcode.rs diff --git a/src/io/mod.rs b/nihav-core/src/io/mod.rs similarity index 100% rename from src/io/mod.rs rename to nihav-core/src/io/mod.rs diff --git a/src/lib.rs b/nihav-core/src/lib.rs similarity index 100% rename from src/lib.rs rename to nihav-core/src/lib.rs diff --git a/src/register.rs b/nihav-core/src/register.rs similarity index 98% rename from src/register.rs rename to nihav-core/src/register.rs index b0bce3a..5ab28bb 100644 --- a/src/register.rs +++ b/nihav-core/src/register.rs @@ -30,10 +30,10 @@ const CODEC_CAP_SCALABLE:u32 = 0x000010; #[derive(Clone)] pub struct CodecDescription { - name: &'static str, - fname: &'static str, - ctype: CodecType, - caps: u32, + pub name: &'static str, + pub fname: &'static str, + pub ctype: CodecType, + pub caps: u32, } impl CodecDescription { diff --git a/src/test/dec_video.rs b/nihav-core/src/test/dec_video.rs similarity index 100% rename from src/test/dec_video.rs rename to nihav-core/src/test/dec_video.rs diff --git a/src/test/mod.rs b/nihav-core/src/test/mod.rs similarity index 100% rename from src/test/mod.rs rename to nihav-core/src/test/mod.rs diff --git a/src/test/wavwriter.rs b/nihav-core/src/test/wavwriter.rs similarity index 100% rename from src/test/wavwriter.rs rename to nihav-core/src/test/wavwriter.rs diff --git a/nihav-game/Cargo.toml b/nihav-game/Cargo.toml new file mode 100644 index 0000000..789161d --- /dev/null +++ b/nihav-game/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "nihav_game" +version = "0.1.0" +authors = ["Kostya Shishkov "] +edition = "2018" + +[dependencies.nihav_core] +path = "../nihav-core" +features = [] + +[features] +default = ["all_decoders", "all_demuxers"] +demuxers = [] +all_demuxers = ["demuxer_gdv"] +demuxer_gdv = ["demuxers"] + +all_decoders = ["all_video_decoders", "all_audio_decoders"] +decoders = [] + +all_video_decoders = ["decoder_gdvvid"] +decoder_gdvvid = ["decoders"] + +all_audio_decoders = [] diff --git a/src/codecs/gremlinvideo.rs b/nihav-game/src/codecs/gremlinvideo.rs similarity index 99% rename from src/codecs/gremlinvideo.rs rename to nihav-game/src/codecs/gremlinvideo.rs index 28663a4..b6929d1 100644 --- a/src/codecs/gremlinvideo.rs +++ b/nihav-game/src/codecs/gremlinvideo.rs @@ -1,7 +1,10 @@ -use crate::formats; -use crate::formats::{NAChannelType, NAChannelMap}; -use super::*; -use crate::io::byteio::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::frame::*; +use nihav_core::formats; +use nihav_core::formats::{NAChannelType, NAChannelMap}; +use nihav_core::codecs::*; +use nihav_core::io::byteio::*; struct GremlinVideoDecoder { info: Rc, diff --git a/nihav-game/src/codecs/mod.rs b/nihav-game/src/codecs/mod.rs new file mode 100644 index 0000000..1b6e473 --- /dev/null +++ b/nihav-game/src/codecs/mod.rs @@ -0,0 +1,21 @@ +use nihav_core::codecs::*; + +macro_rules! validate { + ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } }; +} + +#[cfg(feature="decoder_gdvvid")] +pub mod gremlinvideo; + +const GAME_CODECS: &[DecoderInfo] = &[ +#[cfg(feature="decoder_gdvvid")] + DecoderInfo { name: "gdv-audio", get_decoder: gremlinvideo::get_decoder_audio }, +#[cfg(feature="decoder_gdvvid")] + DecoderInfo { name: "gdv-video", get_decoder: gremlinvideo::get_decoder_video }, +]; + +pub fn game_register_all_codecs(rd: &mut RegisteredDecoders) { + for decoder in GAME_CODECS.into_iter() { + rd.add_decoder(decoder.clone()); + } +} diff --git a/src/demuxers/gdv.rs b/nihav-game/src/demuxers/gdv.rs similarity index 98% rename from src/demuxers/gdv.rs rename to nihav-game/src/demuxers/gdv.rs index 63b7364..6acacc1 100644 --- a/src/demuxers/gdv.rs +++ b/nihav-game/src/demuxers/gdv.rs @@ -1,7 +1,7 @@ -use super::*; -//use io::byteio::*; -//use frame::*; -use crate::formats::*; +use nihav_core::frame::*; +use nihav_core::demuxers::*; +use nihav_core::io::byteio::*; +use nihav_core::formats::*; //use std::collections::HashMap; enum GDVState { diff --git a/nihav-game/src/demuxers/mod.rs b/nihav-game/src/demuxers/mod.rs new file mode 100644 index 0000000..f2aeb3b --- /dev/null +++ b/nihav-game/src/demuxers/mod.rs @@ -0,0 +1,19 @@ +use nihav_core::demuxers::*; + +macro_rules! validate { + ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } }; +} + +#[cfg(feature="demuxer_gdv")] +mod gdv; + +const GAME_DEMUXERS: &[&'static DemuxerCreator] = &[ +#[cfg(feature="demuxer_gdv")] + &gdv::GDVDemuxerCreator {}, +]; + +pub fn game_register_all_demuxers(rd: &mut RegisteredDemuxers) { + for demuxer in GAME_DEMUXERS.into_iter() { + rd.add_demuxer(*demuxer); + } +} diff --git a/nihav-game/src/lib.rs b/nihav-game/src/lib.rs new file mode 100644 index 0000000..d7a15d0 --- /dev/null +++ b/nihav-game/src/lib.rs @@ -0,0 +1,4 @@ +extern crate nihav_core; + +pub mod codecs; +pub mod demuxers; \ No newline at end of file diff --git a/nihav-indeo/Cargo.toml b/nihav-indeo/Cargo.toml new file mode 100644 index 0000000..f257862 --- /dev/null +++ b/nihav-indeo/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "nihav_indeo" +version = "0.1.0" +authors = ["Kostya Shishkov "] +edition = "2018" + +[dependencies.nihav_core] +path = "../nihav-core" +features = ["h263", "fft", "dsp_window"] + +[features] +default = ["all_decoders"] + +all_decoders = ["decoder_imc", "decoder_indeo2", "decoder_indeo3", "decoder_indeo4", "decoder_indeo5", "decoder_intel263"] +decoders = [] + +decoder_imc = ["decoders"] +decoder_indeo2 = ["decoders"] +decoder_indeo3 = ["decoders"] +decoder_indeo4 = ["decoders"] +decoder_indeo5 = ["decoders"] +decoder_intel263 = ["decoders"] diff --git a/src/codecs/indeo/imc.rs b/nihav-indeo/src/codecs/imc.rs similarity index 99% rename from src/codecs/indeo/imc.rs rename to nihav-indeo/src/codecs/imc.rs index f11daa9..5840846 100644 --- a/src/codecs/indeo/imc.rs +++ b/nihav-indeo/src/codecs/imc.rs @@ -1,14 +1,16 @@ use std::mem; use std::ptr; use std::f32::consts; - -use crate::formats::*; -use crate::frame::*; -use super::super::*; -use crate::io::bitreader::*; -use crate::io::codebook::*; -use crate::dsp::fft::*; -use crate::dsp::window::*; +use std::rc::Rc; +use std::cell::RefCell; + +use nihav_core::formats::*; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::io::bitreader::*; +use nihav_core::io::codebook::*; +use nihav_core::dsp::fft::*; +use nihav_core::dsp::window::*; const BANDS: usize = 32; const COEFFS: usize = 256; diff --git a/src/codecs/indeo/indeo2.rs b/nihav-indeo/src/codecs/indeo2.rs similarity index 98% rename from src/codecs/indeo/indeo2.rs rename to nihav-indeo/src/codecs/indeo2.rs index 61f1c77..ffd36c6 100644 --- a/src/codecs/indeo/indeo2.rs +++ b/nihav-indeo/src/codecs/indeo2.rs @@ -1,7 +1,10 @@ -use crate::io::bitreader::*; -use crate::io::codebook::*; -use crate::formats; -use super::super::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::io::bitreader::*; +use nihav_core::io::codebook::*; +use nihav_core::formats; +use nihav_core::codecs::*; +use nihav_core::frame::*; static INDEO2_DELTA_TABLE: [[u8; 256]; 4] = [ [ diff --git a/src/codecs/indeo/indeo3.rs b/nihav-indeo/src/codecs/indeo3.rs similarity index 99% rename from src/codecs/indeo/indeo3.rs rename to nihav-indeo/src/codecs/indeo3.rs index 5b4876d..e17c118 100644 --- a/src/codecs/indeo/indeo3.rs +++ b/nihav-indeo/src/codecs/indeo3.rs @@ -1,6 +1,9 @@ -use crate::formats; -use super::super::*; -use crate::io::byteio::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::formats; +use nihav_core::codecs::*; +use nihav_core::frame::*; +use nihav_core::io::byteio::*; use std::io::SeekFrom; use std::mem; diff --git a/src/codecs/indeo/indeo4.rs b/nihav-indeo/src/codecs/indeo4.rs similarity index 99% rename from src/codecs/indeo/indeo4.rs rename to nihav-indeo/src/codecs/indeo4.rs index 773b177..58c246e 100644 --- a/src/codecs/indeo/indeo4.rs +++ b/nihav-indeo/src/codecs/indeo4.rs @@ -1,7 +1,9 @@ -use std::cell::Ref; -use crate::io::bitreader::*; -use crate::formats; -use super::super::*; +use std::rc::Rc; +use std::cell::{Ref, RefCell}; +use nihav_core::io::bitreader::*; +use nihav_core::formats; +use nihav_core::frame::*; +use nihav_core::codecs::*; use super::ivi::*; use super::ivibr::*; diff --git a/src/codecs/indeo/indeo5.rs b/nihav-indeo/src/codecs/indeo5.rs similarity index 99% rename from src/codecs/indeo/indeo5.rs rename to nihav-indeo/src/codecs/indeo5.rs index c761a8e..5256fa4 100644 --- a/src/codecs/indeo/indeo5.rs +++ b/nihav-indeo/src/codecs/indeo5.rs @@ -1,7 +1,9 @@ -use std::cell::Ref; -use crate::io::bitreader::*; -use crate::formats; -use super::super::*; +use std::rc::Rc; +use std::cell::{Ref, RefCell}; +use nihav_core::io::bitreader::*; +use nihav_core::formats; +use nihav_core::frame::*; +use nihav_core::codecs::*; use super::ivi::*; use super::ivibr::*; diff --git a/src/codecs/h263/intel263.rs b/nihav-indeo/src/codecs/intel263.rs similarity index 97% rename from src/codecs/h263/intel263.rs rename to nihav-indeo/src/codecs/intel263.rs index 9e36a49..df9b852 100644 --- a/src/codecs/h263/intel263.rs +++ b/nihav-indeo/src/codecs/intel263.rs @@ -1,11 +1,14 @@ -use crate::io::bitreader::*; -use crate::io::codebook::*; -use crate::formats; -use super::super::*; -use super::*; -use super::decoder::*; -use super::data::*; -use super::code::H263BlockDSP; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::io::bitreader::*; +use nihav_core::io::codebook::*; +use nihav_core::formats; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::codecs::h263::*; +use nihav_core::codecs::h263::decoder::*; +use nihav_core::codecs::h263::data::*; +use nihav_core::codecs::h263::code::H263BlockDSP; #[allow(dead_code)] struct Tables { diff --git a/src/codecs/indeo/ivi.rs b/nihav-indeo/src/codecs/ivi.rs similarity index 100% rename from src/codecs/indeo/ivi.rs rename to nihav-indeo/src/codecs/ivi.rs diff --git a/src/codecs/indeo/ivibr.rs b/nihav-indeo/src/codecs/ivibr.rs similarity index 99% rename from src/codecs/indeo/ivibr.rs rename to nihav-indeo/src/codecs/ivibr.rs index 3011e1a..10581c8 100644 --- a/src/codecs/indeo/ivibr.rs +++ b/nihav-indeo/src/codecs/ivibr.rs @@ -1,10 +1,11 @@ use std::mem; use std::rc::Rc; use std::cell::{Ref,RefCell}; -use crate::io::bitreader::*; +use nihav_core::io::bitreader::*; //use io::intcode::*; -use super::super::*; -use crate::formats::*; +use nihav_core::codecs::*; +use nihav_core::formats::*; +use nihav_core::frame::*; use super::ivi::*; use super::ividsp::*; diff --git a/src/codecs/indeo/ividsp.rs b/nihav-indeo/src/codecs/ividsp.rs similarity index 100% rename from src/codecs/indeo/ividsp.rs rename to nihav-indeo/src/codecs/ividsp.rs diff --git a/nihav-indeo/src/codecs/mod.rs b/nihav-indeo/src/codecs/mod.rs new file mode 100644 index 0000000..63bad83 --- /dev/null +++ b/nihav-indeo/src/codecs/mod.rs @@ -0,0 +1,50 @@ +use nihav_core::codecs::*; + +macro_rules! validate { + ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } }; +} + +#[cfg(feature="decoder_intel263")] +mod intel263; +#[cfg(feature="decoder_indeo2")] +mod indeo2; +#[cfg(feature="decoder_indeo3")] +mod indeo3; +#[cfg(feature="decoder_indeo4")] +mod indeo4; +#[cfg(feature="decoder_indeo5")] +mod indeo5; + +#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))] +mod ivi; +#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))] +mod ivibr; +#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))] +mod ividsp; + +#[cfg(feature="decoder_imc")] +mod imc; + +const INDEO_CODECS: &[DecoderInfo] = &[ +#[cfg(feature="decoder_indeo2")] + DecoderInfo { name: "indeo2", get_decoder: indeo2::get_decoder }, +#[cfg(feature="decoder_indeo3")] + DecoderInfo { name: "indeo3", get_decoder: indeo3::get_decoder }, +#[cfg(feature="decoder_indeo4")] + DecoderInfo { name: "indeo4", get_decoder: indeo4::get_decoder }, +#[cfg(feature="decoder_indeo5")] + DecoderInfo { name: "indeo5", get_decoder: indeo5::get_decoder }, +#[cfg(feature="decoder_intel263")] + DecoderInfo { name: "intel263", get_decoder: intel263::get_decoder }, + +#[cfg(feature="decoder_imc")] + DecoderInfo { name: "imc", get_decoder: imc::get_decoder_imc }, +#[cfg(feature="decoder_imc")] + DecoderInfo { name: "iac", get_decoder: imc::get_decoder_iac }, +]; + +pub fn indeo_register_all_codecs(rd: &mut RegisteredDecoders) { + for decoder in INDEO_CODECS.into_iter() { + rd.add_decoder(decoder.clone()); + } +} diff --git a/nihav-indeo/src/lib.rs b/nihav-indeo/src/lib.rs new file mode 100644 index 0000000..adda3bf --- /dev/null +++ b/nihav-indeo/src/lib.rs @@ -0,0 +1,3 @@ +extern crate nihav_core; + +pub mod codecs; diff --git a/nihav-realmedia/Cargo.toml b/nihav-realmedia/Cargo.toml new file mode 100644 index 0000000..cfaf2ac --- /dev/null +++ b/nihav-realmedia/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "nihav_realmedia" +version = "0.1.0" +authors = ["Kostya Shishkov "] +edition = "2018" + +[dependencies.nihav_core] +path = "../nihav-core" +features = ["h263", "mdct"] + +[features] +default = ["all_decoders", "all_demuxers"] +demuxers = [] +all_demuxers = ["demuxer_real"] +demuxer_real = ["demuxers"] + +all_decoders = ["all_video_decoders", "all_audio_decoders"] +decoders = [] +h263 = [] + +all_video_decoders = ["decoder_realvideo1", "decoder_realvideo2", "decoder_realvideo3", "decoder_realvideo4", "decoder_realvideo6"] +decoder_realvideo1 = ["h263", "decoders"] +decoder_realvideo2 = ["h263", "decoders"] +decoder_realvideo3 = ["decoders"] +decoder_realvideo4 = ["decoders"] +decoder_realvideo6 = ["decoders"] + +all_audio_decoders = ["decoder_realaudio144", "decoder_realaudio288", "decoder_cook", "decoder_ralf"] +decoder_realaudio144 = ["decoders"] +decoder_realaudio288 = ["decoders"] +decoder_cook = ["decoders"] +decoder_ralf = ["decoders"] diff --git a/src/codecs/real/cook.rs b/nihav-realmedia/src/codecs/cook.rs similarity index 99% rename from src/codecs/real/cook.rs rename to nihav-realmedia/src/codecs/cook.rs index 2fcff98..de7ac54 100644 --- a/src/codecs/real/cook.rs +++ b/nihav-realmedia/src/codecs/cook.rs @@ -1,12 +1,14 @@ -use crate::formats::*; -use crate::frame::*; -use super::super::*; -use crate::dsp::fft::FFTMode; -use crate::dsp::mdct::IMDCT; -use crate::io::bitreader::*; -use crate::io::byteio::{ByteReader, MemoryReader}; -use crate::io::codebook::*; -use crate::io::intcode::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::formats::*; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::dsp::fft::FFTMode; +use nihav_core::dsp::mdct::IMDCT; +use nihav_core::io::bitreader::*; +use nihav_core::io::byteio::{ByteReader, MemoryReader}; +use nihav_core::io::codebook::*; +use nihav_core::io::intcode::*; use std::f32::consts; use std::mem::swap; diff --git a/nihav-realmedia/src/codecs/mod.rs b/nihav-realmedia/src/codecs/mod.rs new file mode 100644 index 0000000..1fe37e0 --- /dev/null +++ b/nihav-realmedia/src/codecs/mod.rs @@ -0,0 +1,68 @@ +use nihav_core::codecs::*; + +macro_rules! validate { + ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } }; +} + +#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))] +mod rv3040; +#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))] +mod rv34codes; +#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))] +mod rv34dsp; + +#[cfg(feature="decoder_realvideo1")] +pub mod rv10; +#[cfg(feature="decoder_realvideo2")] +pub mod rv20; +#[cfg(feature="decoder_realvideo3")] +pub mod rv30; +#[cfg(feature="decoder_realvideo3")] +pub mod rv30dsp; +#[cfg(feature="decoder_realvideo4")] +pub mod rv40; +#[cfg(feature="decoder_realvideo4")] +pub mod rv40dsp; +#[cfg(feature="decoder_realvideo6")] +pub mod rv60; +#[cfg(feature="decoder_realvideo6")] +pub mod rv60codes; +#[cfg(feature="decoder_realvideo6")] +pub mod rv60dsp; + +#[cfg(feature="decoder_realaudio144")] +pub mod ra144; +#[cfg(feature="decoder_realaudio288")] +pub mod ra288; +#[cfg(feature="decoder_cook")] +pub mod cook; +#[cfg(feature="decoder_ralf")] +pub mod ralf; + +const RM_CODECS: &[DecoderInfo] = &[ +#[cfg(feature="decoder_realvideo1")] + DecoderInfo { name: "realvideo1", get_decoder: rv10::get_decoder }, +#[cfg(feature="decoder_realvideo2")] + DecoderInfo { name: "realvideo2", get_decoder: rv20::get_decoder }, +#[cfg(feature="decoder_realvideo3")] + DecoderInfo { name: "realvideo3", get_decoder: rv30::get_decoder }, +#[cfg(feature="decoder_realvideo4")] + DecoderInfo { name: "realvideo4", get_decoder: rv40::get_decoder }, +#[cfg(feature="decoder_realvideo6")] + DecoderInfo { name: "realvideo6", get_decoder: rv60::get_decoder }, + +#[cfg(feature="decoder_realaudio144")] + DecoderInfo { name: "ra14.4", get_decoder: ra144::get_decoder }, +#[cfg(feature="decoder_realaudio288")] + DecoderInfo { name: "ra28.8", get_decoder: ra288::get_decoder }, +#[cfg(feature="decoder_cook")] + DecoderInfo { name: "cook", get_decoder: cook::get_decoder }, +#[cfg(feature="decoder_ralf")] + DecoderInfo { name: "ralf", get_decoder: ralf::get_decoder }, +]; + +pub fn realmedia_register_all_codecs(rd: &mut RegisteredDecoders) { + for decoder in RM_CODECS.into_iter() { + rd.add_decoder(decoder.clone()); + } +} diff --git a/src/codecs/real/ra144.rs b/nihav-realmedia/src/codecs/ra144.rs similarity index 99% rename from src/codecs/real/ra144.rs rename to nihav-realmedia/src/codecs/ra144.rs index 1fdace0..45e98eb 100644 --- a/src/codecs/real/ra144.rs +++ b/nihav-realmedia/src/codecs/ra144.rs @@ -1,7 +1,9 @@ -use crate::formats::*; -use crate::frame::*; -use super::super::*; -use crate::io::bitreader::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::formats::*; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::io::bitreader::*; const NBLOCKS: usize = 4; const BLOCKSIZE: usize = 40; diff --git a/src/codecs/real/ra288.rs b/nihav-realmedia/src/codecs/ra288.rs similarity index 98% rename from src/codecs/real/ra288.rs rename to nihav-realmedia/src/codecs/ra288.rs index 6a5a352..3d9b51b 100644 --- a/src/codecs/real/ra288.rs +++ b/nihav-realmedia/src/codecs/ra288.rs @@ -1,7 +1,9 @@ -use crate::formats::*; -use crate::frame::*; -use super::super::*; -use crate::io::bitreader::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::formats::*; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::io::bitreader::*; const CHMAP_MONO: [NAChannelType; 1] = [NAChannelType::C]; const NBLOCKS: usize = 32; const BLOCKSIZE: usize = 5; diff --git a/src/codecs/real/ralf.rs b/nihav-realmedia/src/codecs/ralf.rs similarity index 99% rename from src/codecs/real/ralf.rs rename to nihav-realmedia/src/codecs/ralf.rs index 3b5d88f..f65eaea 100644 --- a/src/codecs/real/ralf.rs +++ b/nihav-realmedia/src/codecs/ralf.rs @@ -1,10 +1,12 @@ -use crate::formats::*; -use crate::frame::*; -use crate::codecs::*; -use crate::io::byteio::*; -use crate::io::bitreader::*; -use crate::io::codebook::*; -use crate::io::intcode::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::formats::*; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::io::byteio::*; +use nihav_core::io::bitreader::*; +use nihav_core::io::codebook::*; +use nihav_core::io::intcode::*; struct CodebookSet { filter_params_cb: Codebook, diff --git a/src/codecs/h263/rv10.rs b/nihav-realmedia/src/codecs/rv10.rs similarity index 98% rename from src/codecs/h263/rv10.rs rename to nihav-realmedia/src/codecs/rv10.rs index 7e41b7a..3e21315 100644 --- a/src/codecs/h263/rv10.rs +++ b/nihav-realmedia/src/codecs/rv10.rs @@ -1,11 +1,14 @@ -use crate::io::bitreader::*; -use crate::io::codebook::*; -use crate::formats; -use super::super::*; -use super::*; -use super::code::H263BlockDSP; -use super::decoder::*; -use super::data::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::io::bitreader::*; +use nihav_core::io::codebook::*; +use nihav_core::formats; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::codecs::h263::*; +use nihav_core::codecs::h263::code::H263BlockDSP; +use nihav_core::codecs::h263::decoder::*; +use nihav_core::codecs::h263::data::*; #[allow(dead_code)] struct Tables { diff --git a/src/codecs/h263/rv20.rs b/nihav-realmedia/src/codecs/rv20.rs similarity index 98% rename from src/codecs/h263/rv20.rs rename to nihav-realmedia/src/codecs/rv20.rs index 11dbe2e..d839840 100644 --- a/src/codecs/h263/rv20.rs +++ b/nihav-realmedia/src/codecs/rv20.rs @@ -1,11 +1,15 @@ -use crate::io::bitreader::*; -use crate::io::codebook::*; -use crate::formats; -use super::super::*; -use super::*; -use super::code::H263BlockDSP; -use super::decoder::*; -use super::data::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::io::bitreader::*; +use nihav_core::io::codebook::*; +use nihav_core::formats; +use nihav_core::frame::*; +use nihav_core::codecs::*; +use nihav_core::codecs::h263::*; +use nihav_core::codecs::h263::code::H263BlockDSP; +use nihav_core::codecs::h263::decoder::*; +use nihav_core::codecs::h263::data::*; + #[allow(dead_code)] struct Tables { diff --git a/src/codecs/real/rv30.rs b/nihav-realmedia/src/codecs/rv30.rs similarity index 98% rename from src/codecs/real/rv30.rs rename to nihav-realmedia/src/codecs/rv30.rs index cf7e313..3482090 100644 --- a/src/codecs/real/rv30.rs +++ b/nihav-realmedia/src/codecs/rv30.rs @@ -1,7 +1,10 @@ -use crate::formats; -use crate::io::bitreader::*; -use crate::io::intcode::*; -use crate::codecs::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::formats; +use nihav_core::io::bitreader::*; +use nihav_core::io::intcode::*; +use nihav_core::frame::*; +use nihav_core::codecs::*; use super::rv3040::*; use super::rv30dsp::*; diff --git a/src/codecs/real/rv3040.rs b/nihav-realmedia/src/codecs/rv3040.rs similarity index 99% rename from src/codecs/real/rv3040.rs rename to nihav-realmedia/src/codecs/rv3040.rs index d1107ba..2d76eaa 100644 --- a/src/codecs/real/rv3040.rs +++ b/nihav-realmedia/src/codecs/rv3040.rs @@ -1,8 +1,8 @@ -use crate::formats::YUV420_FORMAT; -use crate::frame::{NABufferType, NAVideoInfo, NAVideoBuffer, FrameType, alloc_video_buffer}; -use crate::codecs::{MV, ZERO_MV, DecoderError, DecoderResult, IPBShuffler}; -use crate::io::bitreader::{BitReader,BitReaderMode}; -use crate::io::intcode::*; +use nihav_core::formats::YUV420_FORMAT; +use nihav_core::frame::{NABufferType, NAVideoInfo, NAVideoBuffer, FrameType, alloc_video_buffer}; +use nihav_core::codecs::{MV, ZERO_MV, DecoderError, DecoderResult, IPBShuffler}; +use nihav_core::io::bitreader::{BitReader,BitReaderMode}; +use nihav_core::io::intcode::*; use std::mem; use super::rv34codes::*; diff --git a/src/codecs/real/rv30dsp.rs b/nihav-realmedia/src/codecs/rv30dsp.rs similarity index 99% rename from src/codecs/real/rv30dsp.rs rename to nihav-realmedia/src/codecs/rv30dsp.rs index b1365db..dc7ed09 100644 --- a/src/codecs/real/rv30dsp.rs +++ b/nihav-realmedia/src/codecs/rv30dsp.rs @@ -1,6 +1,6 @@ -use crate::frame::{FrameType, NAVideoBuffer}; -use crate::codecs::MV; -use crate::codecs::blockdsp::edge_emu; +use nihav_core::frame::{FrameType, NAVideoBuffer}; +use nihav_core::codecs::MV; +use nihav_core::codecs::blockdsp::edge_emu; use super::rv3040::{RV34DSP, RV34MBInfo}; fn clip8(a: i16) -> u8 { diff --git a/src/codecs/real/rv34codes.rs b/nihav-realmedia/src/codecs/rv34codes.rs similarity index 99% rename from src/codecs/real/rv34codes.rs rename to nihav-realmedia/src/codecs/rv34codes.rs index 370f288..290d503 100644 --- a/src/codecs/real/rv34codes.rs +++ b/nihav-realmedia/src/codecs/rv34codes.rs @@ -1,6 +1,6 @@ -use crate::codecs::DecoderResult; -use crate::io::bitreader::BitReader; -use crate::io::codebook::*; +use nihav_core::codecs::DecoderResult; +use nihav_core::io::bitreader::BitReader; +use nihav_core::io::codebook::*; struct CBPSet { cbp_pattern: Codebook, diff --git a/src/codecs/real/rv34dsp.rs b/nihav-realmedia/src/codecs/rv34dsp.rs similarity index 100% rename from src/codecs/real/rv34dsp.rs rename to nihav-realmedia/src/codecs/rv34dsp.rs diff --git a/src/codecs/real/rv40.rs b/nihav-realmedia/src/codecs/rv40.rs similarity index 99% rename from src/codecs/real/rv40.rs rename to nihav-realmedia/src/codecs/rv40.rs index c664598..542b644 100644 --- a/src/codecs/real/rv40.rs +++ b/nihav-realmedia/src/codecs/rv40.rs @@ -1,8 +1,11 @@ -use crate::formats; -use crate::io::bitreader::*; -use crate::io::codebook::*; -use crate::io::intcode::*; -use crate::codecs::*; +use std::rc::Rc; +use std::cell::RefCell; +use nihav_core::formats; +use nihav_core::frame::*; +use nihav_core::io::bitreader::*; +use nihav_core::io::codebook::*; +use nihav_core::io::intcode::*; +use nihav_core::codecs::*; use super::rv3040::*; use super::rv40dsp::*; diff --git a/nihav-realmedia/src/codecs/rv40dsp-trait.rs b/nihav-realmedia/src/codecs/rv40dsp-trait.rs new file mode 100644 index 0000000..f00fd9c --- /dev/null +++ b/nihav-realmedia/src/codecs/rv40dsp-trait.rs @@ -0,0 +1,302 @@ +use frame::NAVideoBuffer; +use codecs::MV; +use codecs::blockdsp::edge_emu; +use super::rv3040::{RV34DSP, RV34MBInfo}; + +fn clip8(a: i16) -> u8 { + if a < 0 { 0 } + else if a > 255 { 255 } + else { a as u8 } +} + +macro_rules! el { + ($s: ident, $o: expr) => ( $s[$o] as i16 ) +} + +macro_rules! filter { + (01; $s: ident, $o: expr, $step: expr) => ( + clip8((( el!($s, $o - 2 * $step) + -5 * el!($s, $o - 1 * $step) + +52 * el!($s, $o - 0 * $step) + +20 * el!($s, $o + 1 * $step) + -5 * el!($s, $o + 2 * $step) + + el!($s, $o + 3 * $step) + 32) >> 6) as i16) + ); + (02; $s: ident, $o: expr, $step: expr) => ( + clip8((( el!($s, $o - 2 * $step) + -5 * el!($s, $o - 1 * $step) + +20 * el!($s, $o - 0 * $step) + +20 * el!($s, $o + 1 * $step) + -5 * el!($s, $o + 2 * $step) + + el!($s, $o + 3 * $step) + 16) >> 5) as i16) + ); + (03; $s: ident, $o: expr, $step: expr) => ( + clip8((( el!($s, $o - 2 * $step) + -5 * el!($s, $o - 1 * $step) + +20 * el!($s, $o - 0 * $step) + +52 * el!($s, $o + 1 * $step) + -5 * el!($s, $o + 2 * $step) + + el!($s, $o + 3 * $step) + 32) >> 6) as i16) + ); +} + +trait HFilt { + const HMODE: usize; + fn filter_h(src: &[u8], idx: usize) -> u8 { + match Self::HMODE { + 1 => filter!(01; src, idx, 1), + 2 => filter!(02; src, idx, 1), + 3 => filter!(03; src, idx, 1), + _ => src[idx], + } + } +} +trait VFilt { + const VMODE: usize; + fn filter_v(src: &[u8], idx: usize, stride: usize) -> u8 { + match Self::VMODE { + 1 => filter!(01; src, idx, stride), + 2 => filter!(02; src, idx, stride), + 3 => filter!(03; src, idx, stride), + _ => src[idx], + } + } +} +trait MC: HFilt+VFilt { + const SIZE: usize; + fn mc(dst: &mut [u8], mut didx: usize, dstride: usize, src: &[u8], mut sidx: usize, sstride: usize) { + if (Self::HMODE != 0) && (Self::VMODE != 0) { + let mut buf: [u8; (16 + 5) * 16] = [0; (16 + 5) * 16]; + let mut bidx = 0; + let bstride = Self::SIZE; + sidx -= sstride * 2; + for _ in 0..Self::SIZE+5 { + for x in 0..Self::SIZE { buf[bidx + x] = Self::filter_h(src, sidx + x); } + bidx += bstride; + sidx += sstride; + } + bidx = bstride * 2; + for _ in 0..Self::SIZE { + for x in 0..Self::SIZE { dst[didx + x] = Self::filter_v(&buf, bidx + x, bstride); } + didx += dstride; + bidx += bstride; + } + } else if Self::HMODE != 0 { + for _ in 0..Self::SIZE { + for x in 0..Self::SIZE { + dst[didx + x] = Self::filter_h(src, sidx + x); + } + didx += dstride; + sidx += sstride; + } + } else if Self::VMODE != 0 { + for _ in 0..Self::SIZE { + for x in 0..Self::SIZE { + dst[didx + x] = Self::filter_v(src, sidx + x, sstride); + } + didx += dstride; + sidx += sstride; + } + } else { + for _ in 0..Self::SIZE { + for x in 0..Self::SIZE { + dst[didx + x] = src[sidx + x]; + } + didx += dstride; + sidx += sstride; + } + } + } +} + +macro_rules! mc { + ($name: ident, $size: expr, $vf: expr, $hf: expr) => { + struct $name; + impl HFilt for $name { const HMODE: usize = $hf; } + impl VFilt for $name { const VMODE: usize = $vf; } + impl MC for $name { const SIZE: usize = $size; } + }; +} + +mc!(MC00_16, 16, 0, 0); +mc!(MC01_16, 16, 0, 1); +mc!(MC02_16, 16, 0, 2); +mc!(MC03_16, 16, 0, 3); +mc!(MC10_16, 16, 1, 0); +mc!(MC11_16, 16, 1, 1); +mc!(MC12_16, 16, 1, 2); +mc!(MC13_16, 16, 1, 3); +mc!(MC20_16, 16, 2, 0); +mc!(MC21_16, 16, 2, 1); +mc!(MC22_16, 16, 2, 2); +mc!(MC23_16, 16, 2, 3); +mc!(MC30_16, 16, 3, 1); +mc!(MC31_16, 16, 3, 1); +mc!(MC32_16, 16, 3, 2); +mc!(MC33_16, 16, 3, 3); + +mc!(MC00_8, 8, 0, 0); +mc!(MC01_8, 8, 0, 1); +mc!(MC02_8, 8, 0, 2); +mc!(MC03_8, 8, 0, 3); +mc!(MC10_8, 8, 1, 0); +mc!(MC11_8, 8, 1, 1); +mc!(MC12_8, 8, 1, 2); +mc!(MC13_8, 8, 1, 3); +mc!(MC20_8, 8, 2, 0); +mc!(MC21_8, 8, 2, 1); +mc!(MC22_8, 8, 2, 2); +mc!(MC23_8, 8, 2, 3); +mc!(MC30_8, 8, 3, 1); +mc!(MC31_8, 8, 3, 1); +mc!(MC32_8, 8, 3, 2); +mc!(MC33_8, 8, 3, 3); + + +const RV40_CHROMA_BIAS: [[u16; 4]; 4] = [ + [ 0, 4, 8, 4 ], + [ 8, 7, 8, 7 ], + [ 0, 8, 4, 8 ], + [ 8, 7, 8, 7 ] +]; + +fn rv40_chroma_mc(dst: &mut [u8], mut didx: usize, dstride: usize, src: &[u8], mut sidx: usize, sstride: usize, size: usize, x: usize, y: usize) { + if (x == 0) && (y == 0) { + for _ in 0..size { + for x in 0..size { dst[didx + x] = src[sidx + x]; } + didx += dstride; + sidx += sstride; + } + return; + } + let bias = RV40_CHROMA_BIAS[y >> 1][x >> 1]; + if (x > 0) && (y > 0) { + let a = ((4 - x) * (4 - y)) as u16; + let b = (( x) * (4 - y)) as u16; + let c = ((4 - x) * ( y)) as u16; + let d = (( x) * ( y)) as u16; + for _ in 0..size { + for x in 0..size { + dst[didx + x] = ((a * (src[sidx + x] as u16) + + b * (src[sidx + x + 1] as u16) + + c * (src[sidx + x + sstride] as u16) + + d * (src[sidx + x + 1 + sstride] as u16) + bias) >> 4) as u8; + } + didx += dstride; + sidx += sstride; + } + } else { + let a = ((4 - x) * (4 - y)) as u16; + let e = (( x) * (4 - y) + (4 - x) * ( y)) as u16; + let step = if y > 0 { sstride } else { 1 }; + for _ in 0..size { + for x in 0..size { + dst[didx + x] = ((a * (src[sidx + x] as u16) + + e * (src[sidx + x + step] as u16) + bias) >> 4) as u8; + } + didx += dstride; + sidx += sstride; + } + } +} + +pub struct RV40DSP { + luma_mc: [[fn (&mut [u8], usize, usize, &[u8], usize, usize); 16]; 2], +} + +impl RV40DSP { + pub fn new() -> Self { + RV40DSP { + luma_mc: [ + [ MC00_16::mc, MC01_16::mc, MC02_16::mc, MC03_16::mc, + MC10_16::mc, MC11_16::mc, MC12_16::mc, MC13_16::mc, + MC20_16::mc, MC21_16::mc, MC22_16::mc, MC23_16::mc, + MC30_16::mc, MC31_16::mc, MC32_16::mc, MC33_16::mc ], + [ MC00_8::mc, MC01_8::mc, MC02_8::mc, MC03_8::mc, + MC10_8::mc, MC11_8::mc, MC12_8::mc, MC13_8::mc, + MC20_8::mc, MC21_8::mc, MC22_8::mc, MC23_8::mc, + MC30_8::mc, MC31_8::mc, MC32_8::mc, MC33_8::mc ] ], + } + } +} + +fn check_pos(x: usize, y: usize, size: usize, w: usize, h: usize, dx: i16, dy: i16, e0: isize, e1: isize, e2: isize, e3: isize) -> bool { + let xn = (x as isize) + (dx as isize); + let yn = (y as isize) + (dy as isize); + + (xn - e0 >= 0) && (xn + (size as isize) + e1 <= (w as isize)) && (yn - e2 >= 0) && (yn + (size as isize) + e3 <= (h as isize)) +} + +const RV40_EDGE1: [isize; 4] = [ 0, 2, 2, 2 ]; +const RV40_EDGE2: [isize; 4] = [ 0, 3, 3, 3 ]; + +impl RV34DSP for RV40DSP { + fn loop_filter(&self, _frame: &mut NAVideoBuffer, _mbinfo: &[RV34MBInfo], _mb_w: usize, _mb_h: usize) { + } + fn do_luma_mc(&self, frame: &mut NAVideoBuffer, prev_frame: &NAVideoBuffer, x: usize, y: usize, mv: MV, use16: bool, avg: bool) { + let size: usize = if use16 { 16 } else { 8 }; + let dstride = frame.get_stride(0); + let doffset = frame.get_offset(0) + (if !avg { x + y * dstride } else { 0 }); + let mut data = frame.get_data_mut(); + let dst: &mut [u8] = data.as_mut_slice(); + + let (w_, h_) = prev_frame.get_dimensions(0); + let w = (w_ + 15) & !15; + let h = (h_ + 15) & !15; + + let dx = mv.x >> 2; + let cx = (mv.x & 3) as usize; + let dy = mv.y >> 2; + let cy = (mv.y & 3) as usize; + let mode = cx + cy * 4; + + if check_pos(x, y, size, w, h, dx, dy, RV40_EDGE1[cx], RV40_EDGE2[cx], RV40_EDGE1[cy], RV40_EDGE2[cy]) { + let sstride = prev_frame.get_stride(0); + let mut soffset = prev_frame.get_offset(0) + x + y * sstride; + let data = prev_frame.get_data(); + let src: &[u8] = data.as_slice(); + soffset = ((soffset as isize) + (dx as isize) + (dy as isize) * (sstride as isize)) as usize; + self.luma_mc[if use16 { 0 } else { 1 }][mode](dst, doffset, dstride, src, soffset, sstride); + } else { + let mut ebuf: [u8; 32*22] = [0; 32*22]; + edge_emu(prev_frame, (x as isize) + (dx as isize) - 2, (y as isize) + (dy as isize) - 2, 16+5, 16+5, &mut ebuf, 32, 0); + self.luma_mc[if use16 { 0 } else { 1 }][mode](dst, doffset, dstride, &ebuf, 32*2 + 2, 32); + } + } + fn do_chroma_mc(&self, frame: &mut NAVideoBuffer, prev_frame: &NAVideoBuffer, x: usize, y: usize, comp: usize, mv: MV, use8: bool, avg: bool) { + let size: usize = if use8 { 8 } else { 4 }; + let dstride = frame.get_stride(comp); + let doffset = frame.get_offset(comp) + (if !avg { x + y * dstride } else { 0 }); + let mut data = frame.get_data_mut(); + let dst: &mut [u8] = data.as_mut_slice(); + + let (w_, h_) = prev_frame.get_dimensions(comp); + let w = (w_ + 7) & !7; + let h = (h_ + 7) & !7; + + let mvx = mv.x / 2; + let mvy = mv.y / 2; + let dx = mvx >> 2; + let mut cx = (mvx & 3) as usize; + let dy = mvy >> 2; + let mut cy = (mvy & 3) as usize; + + if (cx == 3) && (cy == 3) { + cx = 2; + cy = 2; + } + + if check_pos(x, y, size, w, h, dx, dy, 0, 0, 1, 1) { + let sstride = prev_frame.get_stride(comp); + let mut soffset = prev_frame.get_offset(comp) + x + y * sstride; + let data = prev_frame.get_data(); + let src: &[u8] = data.as_slice(); + soffset = ((soffset as isize) + (dx as isize) + (dy as isize) * (sstride as isize)) as usize; + rv40_chroma_mc(dst, doffset, dstride, src, soffset, sstride, size, cx, cy); + } else { + let mut ebuf: [u8; 16*10] = [0; 16*10]; + edge_emu(prev_frame, (x as isize) + (dx as isize), (y as isize) + (dy as isize), 8+1, 8+1, &mut ebuf, 16, comp); + rv40_chroma_mc(dst, doffset, dstride, &ebuf, 0, 16, size, cx, cy); + } + } +} diff --git a/src/codecs/real/rv40dsp.rs b/nihav-realmedia/src/codecs/rv40dsp.rs similarity index 99% rename from src/codecs/real/rv40dsp.rs rename to nihav-realmedia/src/codecs/rv40dsp.rs index a6ee607..030321c 100644 --- a/src/codecs/real/rv40dsp.rs +++ b/nihav-realmedia/src/codecs/rv40dsp.rs @@ -1,6 +1,6 @@ -use crate::frame::{FrameType, NAVideoBuffer}; -use crate::codecs::MV; -use crate::codecs::blockdsp::edge_emu; +use nihav_core::frame::{FrameType, NAVideoBuffer}; +use nihav_core::codecs::MV; +use nihav_core::codecs::blockdsp::edge_emu; use super::rv3040::{RV34DSP, RV34MBInfo}; fn clip8(a: i16) -> u8 { diff --git a/src/codecs/real/rv60.rs b/nihav-realmedia/src/codecs/rv60.rs similarity index 99% rename from src/codecs/real/rv60.rs rename to nihav-realmedia/src/codecs/rv60.rs index 2d1262b..20a0f7a 100644 --- a/src/codecs/real/rv60.rs +++ b/nihav-realmedia/src/codecs/rv60.rs @@ -1,11 +1,11 @@ use std::rc::Rc; use std::cell::RefCell; -use crate::formats::YUV420_FORMAT; -use crate::frame::*; -use crate::codecs::{NADecoder, MV, ZERO_MV, DecoderError, DecoderResult, IPBShuffler}; -use crate::io::byteio::{MemoryReader,ByteReader}; -use crate::io::bitreader::{BitReader,BitReaderMode}; -use crate::io::intcode::*; +use nihav_core::formats::YUV420_FORMAT; +use nihav_core::frame::*; +use nihav_core::codecs::{NADecoder, MV, ZERO_MV, DecoderError, DecoderResult, IPBShuffler}; +use nihav_core::io::byteio::{MemoryReader,ByteReader}; +use nihav_core::io::bitreader::{BitReader,BitReaderMode}; +use nihav_core::io::intcode::*; use super::rv60codes::*; use super::rv60dsp::*; diff --git a/src/codecs/real/rv60codes.rs b/nihav-realmedia/src/codecs/rv60codes.rs similarity index 99% rename from src/codecs/real/rv60codes.rs rename to nihav-realmedia/src/codecs/rv60codes.rs index 3b85a80..43bdce7 100644 --- a/src/codecs/real/rv60codes.rs +++ b/nihav-realmedia/src/codecs/rv60codes.rs @@ -1,6 +1,6 @@ -use crate::codecs::*; -use crate::io::bitreader::BitReader; -use crate::io::codebook::*; +use nihav_core::codecs::*; +use nihav_core::io::bitreader::BitReader; +use nihav_core::io::codebook::*; use std::mem; use std::ptr; diff --git a/src/codecs/real/rv60dsp.rs b/nihav-realmedia/src/codecs/rv60dsp.rs similarity index 99% rename from src/codecs/real/rv60dsp.rs rename to nihav-realmedia/src/codecs/rv60dsp.rs index 3850acc..14e3fdb 100644 --- a/src/codecs/real/rv60dsp.rs +++ b/nihav-realmedia/src/codecs/rv60dsp.rs @@ -1,6 +1,6 @@ -use crate::frame::NAVideoBuffer; -use crate::codecs::MV; -use crate::codecs::blockdsp::edge_emu; +use nihav_core::frame::NAVideoBuffer; +use nihav_core::codecs::MV; +use nihav_core::codecs::blockdsp::edge_emu; fn clip8(val: i16) -> u8 { val.min(255).max(0) as u8 } diff --git a/nihav-realmedia/src/demuxers/mod.rs b/nihav-realmedia/src/demuxers/mod.rs new file mode 100644 index 0000000..5acf1f4 --- /dev/null +++ b/nihav-realmedia/src/demuxers/mod.rs @@ -0,0 +1,24 @@ +use std::rc::Rc; +use nihav_core::demuxers::*; + +macro_rules! validate { + ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } }; +} + +#[cfg(feature="demuxer_real")] +mod realmedia; + +const RM_DEMUXERS: &[&'static DemuxerCreator] = &[ +#[cfg(feature="demuxer_real")] + &realmedia::RealMediaDemuxerCreator {}, +#[cfg(feature="demuxer_real")] + &realmedia::RealAudioDemuxerCreator {}, +#[cfg(feature="demuxer_real")] + &realmedia::RealIVRDemuxerCreator {}, +]; + +pub fn realmedia_register_all_demuxers(rd: &mut RegisteredDemuxers) { + for demuxer in RM_DEMUXERS.into_iter() { + rd.add_demuxer(*demuxer); + } +} diff --git a/src/demuxers/realmedia.rs b/nihav-realmedia/src/demuxers/realmedia.rs similarity index 99% rename from src/demuxers/realmedia.rs rename to nihav-realmedia/src/demuxers/realmedia.rs index 9026384..22d964e 100644 --- a/src/demuxers/realmedia.rs +++ b/nihav-realmedia/src/demuxers/realmedia.rs @@ -1,8 +1,8 @@ use super::*; -use super::DemuxerError::*; -//use io::byteio::*; -//use frame::*; -use crate::formats::*; +use nihav_core::demuxers::DemuxerError::*; +use nihav_core::io::byteio::*; +use nihav_core::frame::*; +use nihav_core::formats::*; use std::io::SeekFrom; use std::mem; use std::fmt; diff --git a/nihav-realmedia/src/lib.rs b/nihav-realmedia/src/lib.rs new file mode 100644 index 0000000..d7a15d0 --- /dev/null +++ b/nihav-realmedia/src/lib.rs @@ -0,0 +1,4 @@ +extern crate nihav_core; + +pub mod codecs; +pub mod demuxers; \ No newline at end of file diff --git a/src/codecs/indeo/mod.rs b/src/codecs/indeo/mod.rs deleted file mode 100644 index e1fcdcd..0000000 --- a/src/codecs/indeo/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -#[cfg(feature="decoder_indeo2")] -pub mod indeo2; -#[cfg(feature="decoder_indeo3")] -pub mod indeo3; -#[cfg(feature="decoder_indeo4")] -pub mod indeo4; -#[cfg(feature="decoder_indeo5")] -pub mod indeo5; - -#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))] -mod ivi; -#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))] -mod ivibr; -#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))] -mod ividsp; - -#[cfg(feature="decoder_imc")] -pub mod imc; diff --git a/src/codecs/real/mod.rs b/src/codecs/real/mod.rs deleted file mode 100644 index 244b901..0000000 --- a/src/codecs/real/mod.rs +++ /dev/null @@ -1,31 +0,0 @@ -#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))] -mod rv3040; -#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))] -mod rv34codes; -#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))] -mod rv34dsp; - -#[cfg(feature="decoder_realvideo3")] -pub mod rv30; -#[cfg(feature="decoder_realvideo3")] -pub mod rv30dsp; -#[cfg(feature="decoder_realvideo4")] -pub mod rv40; -#[cfg(feature="decoder_realvideo4")] -pub mod rv40dsp; -#[cfg(feature="decoder_realvideo6")] -pub mod rv60; -#[cfg(feature="decoder_realvideo6")] -pub mod rv60codes; -#[cfg(feature="decoder_realvideo6")] -pub mod rv60dsp; - -#[cfg(feature="decoder_realaudio144")] -pub mod ra144; -#[cfg(feature="decoder_realaudio288")] -pub mod ra288; -#[cfg(feature="decoder_cook")] -pub mod cook; -#[cfg(feature="decoder_ralf")] -pub mod ralf; -