},*/
_ => { tab = Vec::new(); },
};
-
+
Self { tmp, tab, mode, size, swaps, perms, is_pow2, perm_tab }
}
fn can_do_fast(&mut self) -> bool {
let t2 = t1 * self.table[n];
buf[n + 1] = crossadd(t0, t2);
- buf[self.size - n - 1] = FFTComplex { re: t0.re - t2.re, im: -(t0.im + t2.im) };
+ buf[self.size - n - 1] = FFTComplex { re: t0.re - t2.re, im: -(t0.im + t2.im) };
}
let a = buf[0].re;
let b = buf[0].im;
desc!(audio; "atrac3", "Sony Atrac3"),
desc!(audio; "sipro", "Sipro Labs ADPCM"),
- desc!(video; "truemotion1", "TrueMotion 1"),
- desc!(video-im; "truemotionrt", "TrueMotion RT"),
- desc!(video; "truemotion2", "TrueMotion 2"),
+ desc!(video; "truemotion1", "TrueMotion 1"),
+ desc!(video-im; "truemotionrt", "TrueMotion RT"),
+ desc!(video; "truemotion2", "TrueMotion 2"),
desc!(video; "truemotion2x", "TrueMotion 2X"),
desc!(video; "vp3", "VP3"),
desc!(video; "vp4", "VP4"),
if let Some(ref mut head) = stages {
head.drop_last_tmp();
}
-
+
Ok(stages)
}
}
}
-pub fn convert_audio_frame(src: &NABufferType, dst_info: &NAAudioInfo, dst_chmap: &NAChannelMap) ->
+pub fn convert_audio_frame(src: &NABufferType, dst_info: &NAAudioInfo, dst_chmap: &NAChannelMap) ->
Result<NABufferType, SoundConvertError> {
let mut nsamples = src.get_audio_length();
if nsamples == 0 {
}
}
drop(sw);
-
+
Ok(dst_buf)
}
fn is_stereo(chmap: &NAChannelMap) -> bool {
(chmap.num_channels() == 2) &&
- (chmap.get_channel(0) == NAChannelType::L) &&
+ (chmap.get_channel(0) == NAChannelType::L) &&
(chmap.get_channel(1) == NAChannelType::R)
}
}
}
- if let Some(audio_pfx) = audio_pfx {
+ if let Some(audio_pfx) = audio_pfx {
let name = format!("{}/{}out.wav", OUTPUT_PREFIX, audio_pfx);
let file = File::create(name).unwrap();
let mut fw = FileWriter::new_write(file);
};
}
-pub fn test_decoding(demuxer: &str, dec_name: &str, filename: &str, limit: Option<u64>,
+pub fn test_decoding(demuxer: &str, dec_name: &str, filename: &str, limit: Option<u64>,
dmx_reg: &RegisteredDemuxers, dec_reg: &RegisteredDecoders,
test: ExpectedTestResult) {
let dmx_f = dmx_reg.find_demuxer(demuxer).unwrap();
validate!(pos <= endpos);
let toskip = endpos - pos;
br.read_skip(toskip as usize)?;
-
+
Ok(())
}
fn read_deltas(&mut self, src: &[u8]) -> DecoderResult<usize> {
self.deltas[i] = val as i32;
}
}
-
+
Ok(((br.tell() + 31) >> 5) << 2)
}
fn read_huff_tree(&mut self, src: &[u8], htree: &mut HuffTree) -> DecoderResult<usize> {
let mut cr = FullCodebookDescReader::new(codes);
htree.cb = Some(Codebook::new(&mut cr, CodebookMode::MSB)?);
}
-
+
Ok(((br.tell() + 31) >> 5) << 2)
}
fn read_tokens(&mut self, src: &[u8], htree: &HuffTree, ntoks: usize) -> DecoderResult<usize> {
self.tokens.push(tok);
}
}
-
+
Ok(((br.tell() + 31) >> 5) << 2)
}
br.read_skip(len)?;
let _smth = br.read_u32be()?;
}
-
+
Ok(())
}
fn parse_tabs(&mut self) -> DecoderResult<()> {
self.run = (self.read_run)(br)?;
}
self.run -= 1;
- Ok(self.value)
+ Ok(self.value)
}
}
cur_blk += 1;
}
}
- }
+ }
}
Ok(())
} else {
validate!((hdr.disp_w <= hdr.mb_w) && (hdr.disp_h <= hdr.mb_h));
hdr.scale = bc.read_bits(2) as u8;
}
-
+
Ok(hdr)
}
fn decode_mv(&self, bc: &mut BoolCoder, model: &VP56MVModel) -> i16 {
if idx > 0 {
coeffs[ZIGZAG[idx]] *= fstate.ac_quant;
}
-
+
idx += 1;
if idx >= 64 {
break;
let mut dec_reg = RegisteredDecoders::new();
duck_register_all_codecs(&mut dec_reg);
- test_decoding("avi", "vp7", "assets/Duck/interlaced_blit_pitch.avi", Some(12), &dmx_reg,
+ test_decoding("avi", "vp7", "assets/Duck/interlaced_blit_pitch.avi", Some(12), &dmx_reg,
&dec_reg, ExpectedTestResult::MD5Frames(vec![
[0xb79fb6f8, 0xed51ac9e, 0x9e423456, 0xc0918e7f],
[0xbf8d1274, 0x83515e15, 0x8c0887de, 0xfbfd05d3],
const DCT_COEFFS: [i32; 16] = [
23170, 23170, 23170, 23170,
30274, 12540, -12540, -30274,
- 23170, -23170, -23170, 23170,
+ 23170, -23170, -23170, 23170,
12540, -30274, 30274, -12540
];
}
validate!(val >= 2);
let len = (val >> 1) - 1;
-
+
match mode {
1 => bw.copy(len),
2 => for _ in 0..len { bw.put_byte(br.get_byte()); },
idx_br.read_byte()? as usize
} else {
if bits == 0 {
- hi9 = idx9_br.read_byte()?;
+ hi9 = idx9_br.read_byte()?;
bits = 8;
}
bits -= 1;
}
}
}
-
+
Ok(is_intra)
}
let nframes = read_u16le(&header[6..])? as usize;
let fpb = read_u16le(&header[18..])? as usize;
validate!(nframes > 0 && fpb > 0);
-
+
let mut edata: Vec<u8> = Vec::with_capacity(HEADER_SIZE);
edata.extend_from_slice(&header);
let vhdr = NAVideoInfo::new(width, height, false, PAL8_FORMAT);
}
fn map_ac(idx: usize) -> u8 { idx as u8 }
-fn map_mv(idx: usize) -> i8 { BINK2_MV_SYMS[idx] }
+fn map_mv(idx: usize) -> i8 { BINK2_MV_SYMS[idx] }
impl Default for Bink2Codes {
fn default() -> Self {
}
mask >>= 1;
}
-
+
Ok(())
}
seek_idx.seek_info[0].filled = true;
self.cur_frame = 0;
-
+
Ok(())
}
fn get_frame(&mut self, strmgr: &mut StreamManager) -> DemuxerResult<NAPacket> {
self.start = src.tell();
self.cur_frame = 0;
self.reset_state();
-
+
Ok(())
}
fn get_frame(&mut self, strmgr: &mut StreamManager) -> DemuxerResult<NAPacket> {
const RV60_PU_TYPES: [PUType; 8] = [
PUType::Full, PUType::N2Hor, PUType::N2Ver, PUType::Quarters,
- PUType::N4Hor, PUType::N34Hor, PUType::N4Ver, PUType::N34Ver,
+ PUType::N4Hor, PUType::N34Hor, PUType::N4Ver, PUType::N34Ver,
];
impl PUType {
} else {
b_mv = ZERO_MV;
}
-
+
MVInfo { f_mv: mvi.f_mv + f_mv, b_mv: mvi.b_mv + b_mv, mvref: mvi.mvref }
}
fn fill_skip_cand(&mut self, hdr: &FrameHeader, skip_cand: &mut UniqueList<MVInfo>, size: usize) {
let str_q = strength!(diff_p1p0[0] + diff_p1p0[1] + diff_p1p0[2] + diff_p1p0[3], lim2);
if str_p + str_q > 2 {
let msum = ((mode1 + mode2 + str_q + str_p) >> 1) as i16;
- let (maxprod, weak) = if (str_q == 1) || (str_p == 1) { (512, true) } else { (384, false) };
+ let (maxprod, weak) = if (str_q == 1) || (str_p == 1) { (512, true) } else { (384, false) };
for y in 0..4 {
let diff_p0q0 = diff!(dst, offset, offset - step);
if (diff_p0q0 != 0) && (lim1 * diff_p0q0.abs() < maxprod) {
let _next_idx = self.src.read_u32be()?;
validate!(chunk_size == num_entries * 14 + 10);
if num_entries == 0 { return Ok(()); }
-
+
seek_idx.add_stream(str_id);
let idx = seek_idx.get_stream_index(str_id).unwrap();
for _ in 0..num_entries {