From aca8904163fb0a2bed0f5939097ddec3654d0551 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 17 Dec 2018 12:25:25 +0100 Subject: [PATCH] Rust2018: use new addressing scheme --- Cargo.toml | 1 + src/codecs/aac.rs | 20 ++++++++++---------- src/codecs/atrac3.rs | 16 ++++++++-------- src/codecs/blockdsp.rs | 2 +- src/codecs/clearvideo.rs | 10 +++++----- src/codecs/gremlinvideo.rs | 6 +++--- src/codecs/h263/code.rs | 2 +- src/codecs/h263/data.rs | 2 +- src/codecs/h263/decoder.rs | 4 ++-- src/codecs/h263/intel263.rs | 8 ++++---- src/codecs/h263/mod.rs | 2 +- src/codecs/h263/rv10.rs | 8 ++++---- src/codecs/h263/rv20.rs | 8 ++++---- src/codecs/indeo/imc.rs | 14 +++++++------- src/codecs/indeo/indeo2.rs | 8 ++++---- src/codecs/indeo/indeo3.rs | 6 +++--- src/codecs/indeo/indeo4.rs | 6 +++--- src/codecs/indeo/indeo5.rs | 6 +++--- src/codecs/indeo/ivibr.rs | 4 ++-- src/codecs/mod.rs | 8 ++++---- src/codecs/pcm.rs | 2 +- src/codecs/real/cook.rs | 18 +++++++++--------- src/codecs/real/ra144.rs | 8 ++++---- src/codecs/real/ra288.rs | 8 ++++---- src/codecs/real/ralf.rs | 16 ++++++++-------- src/codecs/real/rv30.rs | 10 +++++----- src/codecs/real/rv3040.rs | 10 +++++----- src/codecs/real/rv30dsp.rs | 6 +++--- src/codecs/real/rv34codes.rs | 6 +++--- src/codecs/real/rv40.rs | 12 ++++++------ src/codecs/real/rv40dsp.rs | 6 +++--- src/codecs/real/rv60.rs | 14 +++++++------- src/codecs/real/rv60codes.rs | 6 +++--- src/codecs/real/rv60dsp.rs | 6 +++--- src/codecs/sipro.rs | 8 ++++---- src/codecs/ts102366.rs | 10 +++++----- src/demuxers/avi.rs | 4 ++-- src/demuxers/gdv.rs | 2 +- src/demuxers/mod.rs | 4 ++-- src/demuxers/realmedia.rs | 2 +- src/detect.rs | 4 ++-- src/frame.rs | 2 +- src/io/codebook.rs | 4 ++-- src/io/intcode.rs | 4 ++-- src/test/dec_video.rs | 8 ++++---- src/test/wavwriter.rs | 4 ++-- 46 files changed, 163 insertions(+), 162 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index df405a4..6bda4bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "nihav" version = "0.1.0" authors = ["Kostya Shishkov "] +edition = "2018" [features] default = ["all_decoders", "all_demuxers"] diff --git a/src/codecs/aac.rs b/src/codecs/aac.rs index b533e9a..23d6689 100644 --- a/src/codecs/aac.rs +++ b/src/codecs/aac.rs @@ -1,13 +1,13 @@ -use formats::*; -use frame::*; -use codecs::*; -use dsp::fft::FFTMode; -use dsp::mdct::IMDCT; -use dsp::window::*; -use io::bitreader::*; -use io::codebook::*; +use crate::formats::*; +use crate::frame::*; +use crate::codecs::*; +use crate::dsp::fft::FFTMode; +use crate::dsp::mdct::IMDCT; +use crate::dsp::window::*; +use crate::io::bitreader::*; +use crate::io::codebook::*; use std::fmt; -use io::intcode::*; +use crate::io::intcode::*; use std::mem; use std::ptr; use std::str::FromStr; @@ -1261,7 +1261,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_aac() { // let file = "assets/RV/rv40_weighted_mc.rmvb"; diff --git a/src/codecs/atrac3.rs b/src/codecs/atrac3.rs index c61a262..5281892 100644 --- a/src/codecs/atrac3.rs +++ b/src/codecs/atrac3.rs @@ -1,11 +1,11 @@ -use formats::*; -use frame::*; +use crate::formats::*; +use crate::frame::*; use super::*; -use io::bitreader::*; -use io::byteio::*; -use io::codebook::*; -use dsp::fft::FFTMode; -use dsp::mdct::IMDCT; +use crate::io::bitreader::*; +use crate::io::byteio::*; +use crate::io::codebook::*; +use crate::dsp::fft::FFTMode; +use crate::dsp::mdct::IMDCT; use std::f32::consts; #[derive(Clone,Copy,PartialEq)] @@ -698,7 +698,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_atrac3() { let file = "assets/RV/rv30_atrc_384x208_realproducer_plus_8.51.rm"; diff --git a/src/codecs/blockdsp.rs b/src/codecs/blockdsp.rs index ab0773e..4c0fea6 100644 --- a/src/codecs/blockdsp.rs +++ b/src/codecs/blockdsp.rs @@ -1,4 +1,4 @@ -use frame::*; +use crate::frame::*; pub fn put_blocks(buf: &mut NAVideoBuffer, xpos: usize, ypos: usize, blk: &[[i16;64]; 6]) { let stridey = buf.get_stride(0); diff --git a/src/codecs/clearvideo.rs b/src/codecs/clearvideo.rs index 0c2de9b..8a27006 100644 --- a/src/codecs/clearvideo.rs +++ b/src/codecs/clearvideo.rs @@ -1,7 +1,7 @@ -use io::byteio::{ByteReader,MemoryReader}; -use io::bitreader::*; -use io::codebook::*; -use formats; +use crate::io::byteio::{ByteReader,MemoryReader}; +use crate::io::bitreader::*; +use crate::io::codebook::*; +use crate::formats; use super::*; use std::fmt; use std::ops::{Add, Sub}; @@ -771,7 +771,7 @@ pub fn get_decoder_rm() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_clv() { test_file_decoding("avi", "assets/TalkingHead_352x288.avi", Some(10), true, false, None/*Some("clv")*/); diff --git a/src/codecs/gremlinvideo.rs b/src/codecs/gremlinvideo.rs index f7e19c6..e6015fe 100644 --- a/src/codecs/gremlinvideo.rs +++ b/src/codecs/gremlinvideo.rs @@ -1,6 +1,6 @@ -use formats; +use crate::formats; use super::*; -use io::byteio::*; +use crate::io::byteio::*; struct GremlinVideoDecoder { info: Rc, @@ -465,7 +465,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_gdv() { test_file_decoding("gdv", "assets/intro1.gdv", Some(10), true, false, None); diff --git a/src/codecs/h263/code.rs b/src/codecs/h263/code.rs index 1a29373..dd1279e 100644 --- a/src/codecs/h263/code.rs +++ b/src/codecs/h263/code.rs @@ -1,4 +1,4 @@ -use frame::NAVideoBuffer; +use crate::frame::NAVideoBuffer; use super::{BlockDSP, CBPInfo, MV}; use super::super::blockdsp; //use super::h263data::*; diff --git a/src/codecs/h263/data.rs b/src/codecs/h263/data.rs index b5d3cb1..029c5bb 100644 --- a/src/codecs/h263/data.rs +++ b/src/codecs/h263/data.rs @@ -1,4 +1,4 @@ -use io::codebook::CodebookDescReader; +use crate::io::codebook::CodebookDescReader; #[allow(dead_code)] pub const H263_SCALES: &[u8] = &[ diff --git a/src/codecs/h263/decoder.rs b/src/codecs/h263/decoder.rs index 08b4751..fd828fe 100644 --- a/src/codecs/h263/decoder.rs +++ b/src/codecs/h263/decoder.rs @@ -1,10 +1,10 @@ //use std::mem; -use frame::*; +use crate::frame::*; use super::super::*; use super::super::blockdsp; use super::*; //use super::code::*; -use formats; +use crate::formats; #[allow(dead_code)] struct MVInfo { diff --git a/src/codecs/h263/intel263.rs b/src/codecs/h263/intel263.rs index 0c5652a..9e36a49 100644 --- a/src/codecs/h263/intel263.rs +++ b/src/codecs/h263/intel263.rs @@ -1,6 +1,6 @@ -use io::bitreader::*; -use io::codebook::*; -use formats; +use crate::io::bitreader::*; +use crate::io::codebook::*; +use crate::formats; use super::super::*; use super::*; use super::decoder::*; @@ -412,7 +412,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_intel263() { test_file_decoding("avi", "assets/neal73_saber.avi", Some(16), true, false, None/*Some("i263")*/); diff --git a/src/codecs/h263/mod.rs b/src/codecs/h263/mod.rs index aa274e7..8718887 100644 --- a/src/codecs/h263/mod.rs +++ b/src/codecs/h263/mod.rs @@ -1,5 +1,5 @@ use super::{DecoderResult, MV, ZERO_MV}; -use frame::NAVideoBuffer; +use crate::frame::NAVideoBuffer; pub mod code; pub mod data; diff --git a/src/codecs/h263/rv10.rs b/src/codecs/h263/rv10.rs index f72c342..7e41b7a 100644 --- a/src/codecs/h263/rv10.rs +++ b/src/codecs/h263/rv10.rs @@ -1,6 +1,6 @@ -use io::bitreader::*; -use io::codebook::*; -use formats; +use crate::io::bitreader::*; +use crate::io::codebook::*; +use crate::formats; use super::super::*; use super::*; use super::code::H263BlockDSP; @@ -457,7 +457,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_rv10() { test_file_decoding("realmedia", "assets/RV/rv10_dnet_640x352_realvideo_encoder_4.0.rm", Some(1000), true, false, None/*Some("rv10")*/); diff --git a/src/codecs/h263/rv20.rs b/src/codecs/h263/rv20.rs index 3b9fa1b..11dbe2e 100644 --- a/src/codecs/h263/rv20.rs +++ b/src/codecs/h263/rv20.rs @@ -1,6 +1,6 @@ -use io::bitreader::*; -use io::codebook::*; -use formats; +use crate::io::bitreader::*; +use crate::io::codebook::*; +use crate::formats; use super::super::*; use super::*; use super::code::H263BlockDSP; @@ -520,7 +520,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_rv20() { test_file_decoding("realmedia", "assets/RV/rv20_svt_atrc_640x352_realproducer_plus_8.51.rm", /*None*/Some(3000), true, false, None/*Some("rv20")*/); diff --git a/src/codecs/indeo/imc.rs b/src/codecs/indeo/imc.rs index 9a2ba21..f11daa9 100644 --- a/src/codecs/indeo/imc.rs +++ b/src/codecs/indeo/imc.rs @@ -2,13 +2,13 @@ use std::mem; use std::ptr; use std::f32::consts; -use formats::*; -use frame::*; +use crate::formats::*; +use crate::frame::*; use super::super::*; -use io::bitreader::*; -use io::codebook::*; -use dsp::fft::*; -use dsp::window::*; +use crate::io::bitreader::*; +use crate::io::codebook::*; +use crate::dsp::fft::*; +use crate::dsp::window::*; const BANDS: usize = 32; const COEFFS: usize = 256; @@ -1107,7 +1107,7 @@ const IMC_CB_SELECTOR: [[usize; BANDS]; 4] = [ #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_imc() { // let file = "assets/neal73_saber.avi"; diff --git a/src/codecs/indeo/indeo2.rs b/src/codecs/indeo/indeo2.rs index 4f7abdd..61f1c77 100644 --- a/src/codecs/indeo/indeo2.rs +++ b/src/codecs/indeo/indeo2.rs @@ -1,6 +1,6 @@ -use io::bitreader::*; -use io::codebook::*; -use formats; +use crate::io::bitreader::*; +use crate::io::codebook::*; +use crate::formats; use super::super::*; static INDEO2_DELTA_TABLE: [[u8; 256]; 4] = [ @@ -367,7 +367,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_indeo2() { test_file_decoding("avi", "assets/laser05.avi", Some(10), true, false, None); diff --git a/src/codecs/indeo/indeo3.rs b/src/codecs/indeo/indeo3.rs index 9a3d617..5b4876d 100644 --- a/src/codecs/indeo/indeo3.rs +++ b/src/codecs/indeo/indeo3.rs @@ -1,6 +1,6 @@ -use formats; +use crate::formats; use super::super::*; -use io::byteio::*; +use crate::io::byteio::*; use std::io::SeekFrom; use std::mem; @@ -783,7 +783,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_indeo3() { test_file_decoding("avi", "assets/iv32_example.avi", Some(10), true, false, None); diff --git a/src/codecs/indeo/indeo4.rs b/src/codecs/indeo/indeo4.rs index 36ec86b..773b177 100644 --- a/src/codecs/indeo/indeo4.rs +++ b/src/codecs/indeo/indeo4.rs @@ -1,6 +1,6 @@ use std::cell::Ref; -use io::bitreader::*; -use formats; +use crate::io::bitreader::*; +use crate::formats; use super::super::*; use super::ivi::*; use super::ivibr::*; @@ -764,7 +764,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_indeo4() { test_file_decoding("avi", "assets/IV4/volcano.avi", /*None*/Some(16), true, false, None/*Some("iv4")*/); diff --git a/src/codecs/indeo/indeo5.rs b/src/codecs/indeo/indeo5.rs index bf3b974..c761a8e 100644 --- a/src/codecs/indeo/indeo5.rs +++ b/src/codecs/indeo/indeo5.rs @@ -1,6 +1,6 @@ use std::cell::Ref; -use io::bitreader::*; -use formats; +use crate::io::bitreader::*; +use crate::formats; use super::super::*; use super::ivi::*; use super::ivibr::*; @@ -717,7 +717,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_indeo5() { test_file_decoding("avi", "assets/IV5/sample.avi", /*None*/Some(2), true, false, None); diff --git a/src/codecs/indeo/ivibr.rs b/src/codecs/indeo/ivibr.rs index 2e1dd9a..3011e1a 100644 --- a/src/codecs/indeo/ivibr.rs +++ b/src/codecs/indeo/ivibr.rs @@ -1,10 +1,10 @@ use std::mem; use std::rc::Rc; use std::cell::{Ref,RefCell}; -use io::bitreader::*; +use crate::io::bitreader::*; //use io::intcode::*; use super::super::*; -use formats::*; +use crate::formats::*; use super::ivi::*; use super::ividsp::*; diff --git a/src/codecs/mod.rs b/src/codecs/mod.rs index 5f6009a..b6df370 100644 --- a/src/codecs/mod.rs +++ b/src/codecs/mod.rs @@ -1,13 +1,13 @@ use std::fmt; use std::ops::{Add, AddAssign, Sub, SubAssign}; -use frame::*; +use crate::frame::*; use std::rc::Rc; use std::cell::RefCell; use std::mem; -use io::byteio::ByteIOError; -use io::bitreader::BitReaderError; -use io::codebook::CodebookError; +use crate::io::byteio::ByteIOError; +use crate::io::bitreader::BitReaderError; +use crate::io::codebook::CodebookError; #[derive(Debug,Clone,Copy,PartialEq)] #[allow(dead_code)] diff --git a/src/codecs/pcm.rs b/src/codecs/pcm.rs index 288930b..2a0e510 100644 --- a/src/codecs/pcm.rs +++ b/src/codecs/pcm.rs @@ -1,4 +1,4 @@ -use formats::*; +use crate::formats::*; use super::*; struct PCMDecoder { chmap: NAChannelMap } diff --git a/src/codecs/real/cook.rs b/src/codecs/real/cook.rs index 9c93293..2fcff98 100644 --- a/src/codecs/real/cook.rs +++ b/src/codecs/real/cook.rs @@ -1,12 +1,12 @@ -use formats::*; -use frame::*; +use crate::formats::*; +use crate::frame::*; use super::super::*; -use dsp::fft::FFTMode; -use dsp::mdct::IMDCT; -use io::bitreader::*; -use io::byteio::{ByteReader, MemoryReader}; -use io::codebook::*; -use io::intcode::*; +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::f32::consts; use std::mem::swap; @@ -678,7 +678,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_cook() { // let file = "assets/RV/rv30_weighted_mc.rm"; diff --git a/src/codecs/real/ra144.rs b/src/codecs/real/ra144.rs index 97577d6..1fdace0 100644 --- a/src/codecs/real/ra144.rs +++ b/src/codecs/real/ra144.rs @@ -1,7 +1,7 @@ -use formats::*; -use frame::*; +use crate::formats::*; +use crate::frame::*; use super::super::*; -use io::bitreader::*; +use crate::io::bitreader::*; const NBLOCKS: usize = 4; const BLOCKSIZE: usize = 40; @@ -315,7 +315,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_ra144() { let file = "assets/RV/ra3_in_rm_file.rm"; diff --git a/src/codecs/real/ra288.rs b/src/codecs/real/ra288.rs index 3de1821..6a5a352 100644 --- a/src/codecs/real/ra288.rs +++ b/src/codecs/real/ra288.rs @@ -1,7 +1,7 @@ -use formats::*; -use frame::*; +use crate::formats::*; +use crate::frame::*; use super::super::*; -use io::bitreader::*; +use crate::io::bitreader::*; const CHMAP_MONO: [NAChannelType; 1] = [NAChannelType::C]; const NBLOCKS: usize = 32; const BLOCKSIZE: usize = 5; @@ -205,7 +205,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_ra288() { let file = "assets/RV/A0000044.rm"; diff --git a/src/codecs/real/ralf.rs b/src/codecs/real/ralf.rs index 74eefe3..3b5d88f 100644 --- a/src/codecs/real/ralf.rs +++ b/src/codecs/real/ralf.rs @@ -1,10 +1,10 @@ -use formats::*; -use frame::*; -use codecs::*; -use io::byteio::*; -use io::bitreader::*; -use io::codebook::*; -use io::intcode::*; +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::*; struct CodebookSet { filter_params_cb: Codebook, @@ -475,7 +475,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_ralf() { let file = "assets/RV/rv40_ralf.rmvb"; diff --git a/src/codecs/real/rv30.rs b/src/codecs/real/rv30.rs index f75b769..cf7e313 100644 --- a/src/codecs/real/rv30.rs +++ b/src/codecs/real/rv30.rs @@ -1,7 +1,7 @@ -use formats; -use io::bitreader::*; -use io::intcode::*; -use codecs::*; +use crate::formats; +use crate::io::bitreader::*; +use crate::io::intcode::*; +use crate::codecs::*; use super::rv3040::*; use super::rv30dsp::*; @@ -162,7 +162,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_rv30() { // test_file_decoding("realmedia", "assets/RV/rv30_chroma_drift.rm", Some(1000), true, false, /*None*/Some("rv30")); diff --git a/src/codecs/real/rv3040.rs b/src/codecs/real/rv3040.rs index 078de45..d1107ba 100644 --- a/src/codecs/real/rv3040.rs +++ b/src/codecs/real/rv3040.rs @@ -1,8 +1,8 @@ -use formats::YUV420_FORMAT; -use frame::{NABufferType, NAVideoInfo, NAVideoBuffer, FrameType, alloc_video_buffer}; -use codecs::{MV, ZERO_MV, DecoderError, DecoderResult, IPBShuffler}; -use io::bitreader::{BitReader,BitReaderMode}; -use io::intcode::*; +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 std::mem; use super::rv34codes::*; diff --git a/src/codecs/real/rv30dsp.rs b/src/codecs/real/rv30dsp.rs index 049e002..b1365db 100644 --- a/src/codecs/real/rv30dsp.rs +++ b/src/codecs/real/rv30dsp.rs @@ -1,6 +1,6 @@ -use frame::{FrameType, NAVideoBuffer}; -use codecs::MV; -use codecs::blockdsp::edge_emu; +use crate::frame::{FrameType, NAVideoBuffer}; +use crate::codecs::MV; +use crate::codecs::blockdsp::edge_emu; use super::rv3040::{RV34DSP, RV34MBInfo}; fn clip8(a: i16) -> u8 { diff --git a/src/codecs/real/rv34codes.rs b/src/codecs/real/rv34codes.rs index a617535..370f288 100644 --- a/src/codecs/real/rv34codes.rs +++ b/src/codecs/real/rv34codes.rs @@ -1,6 +1,6 @@ -use codecs::DecoderResult; -use io::bitreader::BitReader; -use io::codebook::*; +use crate::codecs::DecoderResult; +use crate::io::bitreader::BitReader; +use crate::io::codebook::*; struct CBPSet { cbp_pattern: Codebook, diff --git a/src/codecs/real/rv40.rs b/src/codecs/real/rv40.rs index 2639c23..c664598 100644 --- a/src/codecs/real/rv40.rs +++ b/src/codecs/real/rv40.rs @@ -1,8 +1,8 @@ -use formats; -use io::bitreader::*; -use io::codebook::*; -use io::intcode::*; -use codecs::*; +use crate::formats; +use crate::io::bitreader::*; +use crate::io::codebook::*; +use crate::io::intcode::*; +use crate::codecs::*; use super::rv3040::*; use super::rv40dsp::*; @@ -355,7 +355,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_rv40() { // test_file_decoding("realmedia", "assets/RV/rv40_ralf.rmvb", Some(1000), true, false, /*None*/Some("rv40")); diff --git a/src/codecs/real/rv40dsp.rs b/src/codecs/real/rv40dsp.rs index 4230715..a6ee607 100644 --- a/src/codecs/real/rv40dsp.rs +++ b/src/codecs/real/rv40dsp.rs @@ -1,6 +1,6 @@ -use frame::{FrameType, NAVideoBuffer}; -use codecs::MV; -use codecs::blockdsp::edge_emu; +use crate::frame::{FrameType, NAVideoBuffer}; +use crate::codecs::MV; +use crate::codecs::blockdsp::edge_emu; use super::rv3040::{RV34DSP, RV34MBInfo}; fn clip8(a: i16) -> u8 { diff --git a/src/codecs/real/rv60.rs b/src/codecs/real/rv60.rs index f277391..a1ad055 100644 --- a/src/codecs/real/rv60.rs +++ b/src/codecs/real/rv60.rs @@ -1,11 +1,11 @@ use std::rc::Rc; use std::cell::RefCell; -use formats::YUV420_FORMAT; -use frame::*; -use codecs::{NADecoder, MV, ZERO_MV, DecoderError, DecoderResult, IPBShuffler}; -use io::byteio::{MemoryReader,ByteReader}; -use io::bitreader::{BitReader,BitReaderMode}; -use io::intcode::*; +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 super::rv60codes::*; use super::rv60dsp::*; @@ -1481,7 +1481,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::test_file_decoding; + use crate::test::dec_video::test_file_decoding; #[test] fn test_rv60() { test_file_decoding("realmedia", "assets/RV/RV60.rmhd", Some(4000), true, false, None/*Some("rv60")*/); diff --git a/src/codecs/real/rv60codes.rs b/src/codecs/real/rv60codes.rs index be949ab..3b85a80 100644 --- a/src/codecs/real/rv60codes.rs +++ b/src/codecs/real/rv60codes.rs @@ -1,6 +1,6 @@ -use codecs::*; -use io::bitreader::BitReader; -use io::codebook::*; +use crate::codecs::*; +use crate::io::bitreader::BitReader; +use crate::io::codebook::*; use std::mem; use std::ptr; diff --git a/src/codecs/real/rv60dsp.rs b/src/codecs/real/rv60dsp.rs index 64c32c6..3850acc 100644 --- a/src/codecs/real/rv60dsp.rs +++ b/src/codecs/real/rv60dsp.rs @@ -1,6 +1,6 @@ -use frame::NAVideoBuffer; -use codecs::MV; -use codecs::blockdsp::edge_emu; +use crate::frame::NAVideoBuffer; +use crate::codecs::MV; +use crate::codecs::blockdsp::edge_emu; fn clip8(val: i16) -> u8 { val.min(255).max(0) as u8 } diff --git a/src/codecs/sipro.rs b/src/codecs/sipro.rs index d3511aa..882d90c 100644 --- a/src/codecs/sipro.rs +++ b/src/codecs/sipro.rs @@ -1,7 +1,7 @@ -use formats::*; -use frame::*; +use crate::formats::*; +use crate::frame::*; use super::*; -use io::bitreader::*; +use crate::io::bitreader::*; use std::f32::consts::PI; @@ -739,7 +739,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_sipro() { let file = "assets/RV/autahi-vox.rm"; diff --git a/src/codecs/ts102366.rs b/src/codecs/ts102366.rs index 3ee68ee..fb452c5 100644 --- a/src/codecs/ts102366.rs +++ b/src/codecs/ts102366.rs @@ -1,8 +1,8 @@ -use formats::*; -use frame::*; +use crate::formats::*; +use crate::frame::*; use super::*; -use io::bitreader::*; -use dsp::fft::*; +use crate::io::bitreader::*; +use crate::dsp::fft::*; use std::str::FromStr; use std::f32::consts; @@ -1245,7 +1245,7 @@ pub fn get_decoder() -> Box { #[cfg(test)] mod test { - use test::dec_video::*; + use crate::test::dec_video::*; #[test] fn test_ts102366() { let file = "assets/RV/sp_sample1.rm"; diff --git a/src/demuxers/avi.rs b/src/demuxers/avi.rs index fa83557..a326561 100644 --- a/src/demuxers/avi.rs +++ b/src/demuxers/avi.rs @@ -1,9 +1,9 @@ use super::*; -use register; +use crate::register; use super::DemuxerError::*; //use io::byteio::*; //use frame::*; -use formats::*; +use crate::formats::*; macro_rules! mktag { ($a:expr, $b:expr, $c:expr, $d:expr) => ({ diff --git a/src/demuxers/gdv.rs b/src/demuxers/gdv.rs index 16eae33..63b7364 100644 --- a/src/demuxers/gdv.rs +++ b/src/demuxers/gdv.rs @@ -1,7 +1,7 @@ use super::*; //use io::byteio::*; //use frame::*; -use formats::*; +use crate::formats::*; //use std::collections::HashMap; enum GDVState { diff --git a/src/demuxers/mod.rs b/src/demuxers/mod.rs index 347b7e3..adf954a 100644 --- a/src/demuxers/mod.rs +++ b/src/demuxers/mod.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use frame::*; -use io::byteio::*; +use crate::frame::*; +use crate::io::byteio::*; #[derive(Debug,Clone,Copy,PartialEq)] #[allow(dead_code)] diff --git a/src/demuxers/realmedia.rs b/src/demuxers/realmedia.rs index dbb8564..9026384 100644 --- a/src/demuxers/realmedia.rs +++ b/src/demuxers/realmedia.rs @@ -2,7 +2,7 @@ use super::*; use super::DemuxerError::*; //use io::byteio::*; //use frame::*; -use formats::*; +use crate::formats::*; use std::io::SeekFrom; use std::mem; use std::fmt; diff --git a/src/detect.rs b/src/detect.rs index 7dad842..0b60641 100644 --- a/src/detect.rs +++ b/src/detect.rs @@ -1,5 +1,5 @@ use std::io::SeekFrom; -use io::byteio::ByteReader; +use crate::io::byteio::ByteReader; #[derive(Debug,Clone,Copy,PartialEq)] pub enum DetectionScore { @@ -242,7 +242,7 @@ pub fn detect_format(name: &str, src: &mut ByteReader) -> Option<(&'static str, mod test { use super::*; use std::fs::File; - use io::byteio::*; + use crate::io::byteio::*; #[test] fn test_avi_detect() { diff --git a/src/frame.rs b/src/frame.rs index 4aaf272..2bfbe61 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use std::fmt; use std::rc::Rc; use std::cell::*; -use formats::*; +use crate::formats::*; #[allow(dead_code)] #[derive(Clone,Copy,PartialEq)] diff --git a/src/io/codebook.rs b/src/io/codebook.rs index 3d1e8d0..78ef5ae 100644 --- a/src/io/codebook.rs +++ b/src/io/codebook.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; use std::cmp::{max, min}; -use io::bitreader::BitReader; +use super::bitreader::BitReader; #[derive(Debug)] pub enum CodebookError { @@ -336,7 +336,7 @@ impl, IndexType> CodebookDescReader for Tabl #[cfg(test)] mod test { use super::*; - use io::bitreader::*; + use crate::io::bitreader::*; #[test] fn test_cb() { diff --git a/src/io/intcode.rs b/src/io/intcode.rs index a898a10..8d87920 100644 --- a/src/io/intcode.rs +++ b/src/io/intcode.rs @@ -1,4 +1,4 @@ -use io::bitreader::{BitReader, BitReaderError, BitReaderResult}; +use crate::io::bitreader::{BitReader, BitReaderError, BitReaderResult}; #[derive(Debug)] pub enum UintCodeType { @@ -131,7 +131,7 @@ impl<'a> IntCodeReader for BitReader<'a> { #[cfg(test)] mod test { use super::*; - use io::bitreader::*; + use crate::io::bitreader::*; #[test] fn int_codes() { diff --git a/src/test/dec_video.rs b/src/test/dec_video.rs index a2cf6e7..4a18191 100644 --- a/src/test/dec_video.rs +++ b/src/test/dec_video.rs @@ -1,9 +1,9 @@ use std::fs::File; use std::io::prelude::*; -use frame::*; -use codecs::*; -use demuxers::*; -use io::byteio::*; +use crate::frame::*; +use crate::codecs::*; +use crate::demuxers::*; +use crate::io::byteio::*; use super::wavwriter::WavWriter; fn write_pgmyuv(pfx: &str, strno: usize, num: u64, frmref: NAFrameRef) { diff --git a/src/test/wavwriter.rs b/src/test/wavwriter.rs index a68075e..1cd9541 100644 --- a/src/test/wavwriter.rs +++ b/src/test/wavwriter.rs @@ -1,5 +1,5 @@ -use io::byteio::*; -use frame::*; +use crate::io::byteio::*; +use crate::frame::*; use std::io::SeekFrom; pub struct WavWriter<'a> { -- 2.39.5