window[i] = w;
window[512 - 1 - i] = w;
}
-
+
Self {
imdct: IMDCT::new(FFTMode::SplitRadix, 512),
tmp: [0.0; ATRAC3_FRAME_SIZE + 64],
let bh_ = if comp > 0 { bh/2 } else { bh };
(interp[mode])(&mut dbuf[doff + x + y * dstride..], dstride, ebuf.as_slice(), ebuf_stride, bw_, bh_);
}
-
} else {
for comp in 0..3 {
let sstride = src.get_stride(comp);
let off = -((b >> 2) as isize) - 1;
validate!(len <= size);
size -= len;
- self.lz_copy(idx, off, len)?;
+ self.lz_copy(idx, off, len)?;
idx += len;
}
}
let len = if (b & 0x80) == 0 { 2 } else { 3 };
validate!(len <= size);
size -= len;
- self.lz_copy(idx, -(off as isize), len)?;
+ self.lz_copy(idx, -(off as isize), len)?;
idx += len;
}
} else {
}
validate!(len <= size);
size -= len;
- self.lz_copy(idx, off, len)?;
+ self.lz_copy(idx, off, len)?;
idx += len;
}
}
_ => {},
};
}
-
+
new_mv
}
fn set_zero_mv(&mut self, mb_x: usize) {
let luma_dc_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap();
let mut coderead = CodeReader::new(RV10_CHROMA_DC_CODES, RV10_CHROMA_DC_BITS);
let chroma_dc_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap();
-
+
let tables = Tables {
intra_mcbpc_cb: intra_mcbpc_cb,
inter_mcbpc_cb: inter_mcbpc_cb,
if !is_intra { cbpy ^= 0xF; }
(cbpy << 2) | (cbpc & 3)
} else { 0 };
-
+
if dquant {
let idx = br.read(2)? as usize;
q = ((q as i16) + (H263_DQUANT_TAB[idx] as i16)) as u8;
let aic_rl_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap();
let mut coderead = H263ShortCodeReader::new(H263_MV);
let mv_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap();
-
+
let tables = Tables {
intra_mcbpc_cb: intra_mcbpc_cb,
inter_mcbpc_cb: inter_mcbpc_cb,
self.ba.band_width[i] = 0;
}
}
-
+
for i in 0..BANDS-1 {
if self.ba.band_width[i] > 0 {
self.ba.band_present[i] = br.read_bool()?;
ch_data.cw[i] = quant[val - 1] * ch_data.adj_floor[band];
} else {
ch_data.cw[i] = -quant[max - val - 1] * ch_data.adj_floor[band];
- }
+ }
}
}
}
let blk_cb;
if br.read_bool()? {
-
blk_cb = br.read_ivi_codebook_desc(false, true)?;
} else {
blk_cb = self.blk_cb;
},
_ => { unreachable!(); }
};
-
+
Ok(BandHeader::new(plane_no, band_no, self.mb_size[band_id], self.blk_size[band_id], self.is_hpel[band_id], inherit_mv, has_qdelta, inherit_qd, band_q, rvmap_idx, num_corr, corr_map, blk_cb, tr, txtype))
}
let g = br.read(8)?;
let b = br.read(8)?;
}
-
+
br.skip(1)?;
let mut cb = IVI_CB_ZERO;
let mut c1 = blk[i + 1*8] << 1;
let mut c2 = blk[i + 2*8] << 1;
let mut c3 = blk[i + 3*8] << 1;
- haar_transform!(c0, c1, c2, c3,
+ haar_transform!(c0, c1, c2, c3,
blk[i + 4*8], blk[i + 5*8], blk[i + 6*8], blk[i + 7*8]);
blk[i + 0*8] = c0;
blk[i + 1*8] = c1;
}
fn clip_out(sample: i16) -> i16 {
- sample.max(-16384 >> 2).min(16383 >> 2)
+ sample.max(-16384 >> 2).min(16383 >> 2)
}
impl NADecoder for RA144Decoder {
_ => unreachable!(),
}
self.sample_offset += length;
-
+
Ok(())
}
}
MBType::MBSkip | MBType::MBDirect => {
if let (Some(ref fwdbuf), Some(ref bwdbuf)) = (self.ipbs.get_b_fwdref(), self.ipbs.get_b_bwdref()) {
for y in 0..2 {
- for x in 0..2 {
+ for x in 0..2 {
let (mv_f, mv_b) = self.ref_mvi.get_mv(mb_x, mb_y, x, y, true).scale(sstate.trd, sstate.trb);
do_mc_8x8(&self.dsp, buf, fwdbuf, mb_x, x, mb_y, y, mv_f, false);
do_mc_8x8(&self.dsp, &mut self.avg_buf, bwdbuf, mb_x, x, mb_y, y, mv_b, true);
pub fn new() -> Self {
RV40DSP {
luma_mc: [
- [ copy_16, luma_mc_10_16, luma_mc_20_16, luma_mc_30_16,
+ [ copy_16, luma_mc_10_16, luma_mc_20_16, luma_mc_30_16,
luma_mc_01_16, luma_mc_11_16, luma_mc_21_16, luma_mc_31_16,
luma_mc_02_16, luma_mc_12_16, luma_mc_22_16, luma_mc_32_16,
luma_mc_03_16, luma_mc_13_16, luma_mc_23_16, luma_mc_33_16 ],
sum += self.excitation[estart + j] * SIPRO_SINC_LBR[idx0 as usize];
sum += self.excitation[estart - j - 1] * SIPRO_SINC_LBR[idx1 as usize];
}
- self.excitation[EXCITATION_OFFSET + sf * 48 + i] = sum;
+ self.excitation[EXCITATION_OFFSET + sf * 48 + i] = sum;
}
}
fn unpack_pulses_16k(&mut self, sf: usize) {
let gain0 = SIPRO_GAIN_CB_LBR[self.gc_index[sf]][0];
let gain1 = SIPRO_GAIN_CB_LBR[self.gc_index[sf]][1];
self.prev_pitch_gain = gain0;
-
+
self.avg_energy = 0.01;
for el in self.fix_vec.iter().take(48) {
self.avg_energy += *el * *el;
fn read(&mut self, br: &mut BitReader, bsi: &BSI, fscod: usize, blk_no: usize) -> DecoderResult<bool> {
let channels = bsi.acmod.get_num_channels();
let is_stereo = bsi.acmod == ACMode::Stereo;
-
+
for ch in 0..channels {
self.chdata[ch].blksw = br.read_bool()?;
}
let (tb_num, tb_den) = stream.get_timebase();
let ts = NATimeInfo::new(Some(self.cur_frame[stream_no as usize]), None, None, tb_num, tb_den);
let pkt = self.src.read_packet(stream, ts, false, size)?;
- self.cur_frame[stream_no as usize] += 1;
+ self.cur_frame[stream_no as usize] += 1;
self.movi_size -= size + 8;
return Ok(pkt);
pub fn create_demuxer<'a>(dmxcr: &DemuxerCreator, br: &'a mut ByteReader<'a>) -> DemuxerResult<Demuxer<'a>> {
let mut dmx = dmxcr.new_demuxer(br);
let mut str = StreamManager::new();
- dmx.open(&mut str)?;
+ dmx.open(&mut str)?;
Ok(Demuxer::new(dmx, str))
}
if packet_num == 1 {
vstr.start_slice(num_pkts, frame_size as usize, self.slice_buf.as_slice());
} else {
- vstr.add_slice(packet_num as usize, self.slice_buf.as_slice());
+ vstr.add_slice(packet_num as usize, self.slice_buf.as_slice());
}
if (packet_num as usize) < num_pkts {
continue;
if packet_num == 1 && frame_size == tail_size {
vstr.start_slice(num_pkts, frame_size as usize, self.slice_buf.as_slice());
} else {
- vstr.add_slice(packet_num as usize, self.slice_buf.as_slice());
+ vstr.add_slice(packet_num as usize, self.slice_buf.as_slice());
}
while self.src.tell() < pos + (payload_size as u64) {
}
return;
}
-
+
let hsize = (1 << (bits - 1)) as usize;
self.do_fft_inplace_ct(&mut data[0..hsize], bits - 1, forward);
self.do_fft_inplace_ct(&mut data[hsize..], bits - 1, forward);
"Lo" => Ok(NAChannelType::Lo),
"Ro" => Ok(NAChannelType::Ro),
_ => Err(ChannelParseError{}),
- }
+ }
}
}
let mut data: Vec<u8> = Vec::with_capacity(length);
data.resize(length, 0);
let buf: NAAudioBuffer<u8> = NAAudioBuffer { data: Rc::new(RefCell::new(data)), info: ainfo, offs: offs, chmap: chmap, len: nsamples };
- Ok(NABufferType::AudioPacked(buf))
+ Ok(NABufferType::AudioPacked(buf))
}
}
for (_, sec_bucket) in &escape_list {
build_esc_lut(table, mode, sec_bucket)?;
}
-
+
Ok(())
}