name = "nihav"
version = "0.1.0"
authors = ["Kostya Shishkov <kostya.shishkov@gmail.com>"]
+edition = "2018"
[features]
default = ["all_decoders", "all_demuxers"]
-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;
#[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";
-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)]
#[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";
-use frame::*;
+use crate::frame::*;
pub fn put_blocks(buf: &mut NAVideoBuffer<u8>, xpos: usize, ypos: usize, blk: &[[i16;64]; 6]) {
let stridey = buf.get_stride(0);
-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};
#[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")*/);
-use formats;
+use crate::formats;
use super::*;
-use io::byteio::*;
+use crate::io::byteio::*;
struct GremlinVideoDecoder {
info: Rc<NACodecInfo>,
#[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);
-use frame::NAVideoBuffer;
+use crate::frame::NAVideoBuffer;
use super::{BlockDSP, CBPInfo, MV};
use super::super::blockdsp;
//use super::h263data::*;
-use io::codebook::CodebookDescReader;
+use crate::io::codebook::CodebookDescReader;
#[allow(dead_code)]
pub const H263_SCALES: &[u8] = &[
//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 {
-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::*;
#[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")*/);
use super::{DecoderResult, MV, ZERO_MV};
-use frame::NAVideoBuffer;
+use crate::frame::NAVideoBuffer;
pub mod code;
pub mod data;
-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;
#[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")*/);
-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;
#[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")*/);
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;
#[cfg(test)]
mod test {
- use test::dec_video::*;
+ use crate::test::dec_video::*;
#[test]
fn test_imc() {
// let file = "assets/neal73_saber.avi";
-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] = [
#[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);
-use formats;
+use crate::formats;
use super::super::*;
-use io::byteio::*;
+use crate::io::byteio::*;
use std::io::SeekFrom;
use std::mem;
#[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);
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::*;
#[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")*/);
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::*;
#[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);
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::*;
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)]
-use formats::*;
+use crate::formats::*;
use super::*;
struct PCMDecoder { chmap: NAChannelMap }
-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;
#[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";
-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;
#[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";
-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;
#[cfg(test)]
mod test {
- use test::dec_video::*;
+ use crate::test::dec_video::*;
#[test]
fn test_ra288() {
let file = "assets/RV/A0000044.rm";
-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<u16>,
#[cfg(test)]
mod test {
- use test::dec_video::*;
+ use crate::test::dec_video::*;
#[test]
fn test_ralf() {
let file = "assets/RV/rv40_ralf.rmvb";
-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::*;
#[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"));
-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::*;
-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 {
-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<u16>,
-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::*;
#[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"));
-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 {
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::*;
#[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")*/);
-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;
-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 }
-use formats::*;
-use frame::*;
+use crate::formats::*;
+use crate::frame::*;
use super::*;
-use io::bitreader::*;
+use crate::io::bitreader::*;
use std::f32::consts::PI;
#[cfg(test)]
mod test {
- use test::dec_video::*;
+ use crate::test::dec_video::*;
#[test]
fn test_sipro() {
let file = "assets/RV/autahi-vox.rm";
-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;
#[cfg(test)]
mod test {
- use test::dec_video::*;
+ use crate::test::dec_video::*;
#[test]
fn test_ts102366() {
let file = "assets/RV/sp_sample1.rm";
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) => ({
use super::*;
//use io::byteio::*;
//use frame::*;
-use formats::*;
+use crate::formats::*;
//use std::collections::HashMap;
enum GDVState {
use std::rc::Rc;
-use frame::*;
-use io::byteio::*;
+use crate::frame::*;
+use crate::io::byteio::*;
#[derive(Debug,Clone,Copy,PartialEq)]
#[allow(dead_code)]
use super::DemuxerError::*;
//use io::byteio::*;
//use frame::*;
-use formats::*;
+use crate::formats::*;
use std::io::SeekFrom;
use std::mem;
use std::fmt;
use std::io::SeekFrom;
-use io::byteio::ByteReader;
+use crate::io::byteio::ByteReader;
#[derive(Debug,Clone,Copy,PartialEq)]
pub enum DetectionScore {
mod test {
use super::*;
use std::fs::File;
- use io::byteio::*;
+ use crate::io::byteio::*;
#[test]
fn test_avi_detect() {
use std::fmt;
use std::rc::Rc;
use std::cell::*;
-use formats::*;
+use crate::formats::*;
#[allow(dead_code)]
#[derive(Clone,Copy,PartialEq)]
use std::collections::HashMap;
use std::cmp::{max, min};
-use io::bitreader::BitReader;
+use super::bitreader::BitReader;
#[derive(Debug)]
pub enum CodebookError {
#[cfg(test)]
mod test {
use super::*;
- use io::bitreader::*;
+ use crate::io::bitreader::*;
#[test]
fn test_cb() {
-use io::bitreader::{BitReader, BitReaderError, BitReaderResult};
+use crate::io::bitreader::{BitReader, BitReaderError, BitReaderResult};
#[derive(Debug)]
pub enum UintCodeType {
#[cfg(test)]
mod test {
use super::*;
- use io::bitreader::*;
+ use crate::io::bitreader::*;
#[test]
fn int_codes() {
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) {
-use io::byteio::*;
-use frame::*;
+use crate::io::byteio::*;
+use crate::frame::*;
use std::io::SeekFrom;
pub struct WavWriter<'a> {