let ainfo = self.info.get_properties().get_audio_info().unwrap();
- let mut abuf = alloc_audio_buffer(ainfo, ATRAC3_FRAME_SIZE, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(ainfo, ATRAC3_FRAME_SIZE, self.chmap.clone())?;
let mut adata = abuf.get_abuf_f32().unwrap();
let mut output = adata.get_data_mut();
let vinfo = self.info.get_properties().get_video_info().unwrap();
let bufret = alloc_video_buffer(vinfo, self.tsize);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
if is_intra {
let duration = out_frm_size * nframes;
- let mut abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
let mut adata = abuf.get_abuf_f32().unwrap();
let mut dst = adata.get_data_mut();
let ainfo = NAAudioInfo::new(sinfo.samplerate >> bsi.shift, channels as u8,
SND_F32P_FORMAT, BLOCK_LEN);
- let mut abuf = alloc_audio_buffer(ainfo, duration, bsi.acmod.get_channel_map(bsi.lfeon))?;
+ let abuf = alloc_audio_buffer(ainfo, duration, bsi.acmod.get_channel_map(bsi.lfeon))?;
let mut adata = abuf.get_abuf_f32().unwrap();
let mut output = adata.get_data_mut();
let vinfo = NAVideoInfo::new(self.w, self.h, false, fmt);
let bufret = alloc_video_buffer(vinfo, 4);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
let mut slice = if self.is_gob {
let vinfo = NAVideoInfo::new(self.w, self.h, false, fmt);
let bufret = alloc_video_buffer(vinfo, 4);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut b_buf = bufinfo.get_vbuf().unwrap();
if let (Some(ref bck_buf), Some(ref fwd_buf)) = (self.ipbs.get_nextref(), self.ipbs.get_lastref()) {
let nblocks = pktbuf.len() / self.block_len;
let out_block_len = self.ainfo.get_block_len();
let duration = out_block_len * nblocks;
- let mut abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
let mut adata = abuf.get_abuf_i16().unwrap();
let mut off0 = adata.get_offset(0);
let mut off1 = adata.get_offset(1);
let myinfo = NAVideoInfo::new(out_width, height, false, fmt);
let bufret = alloc_video_buffer(myinfo, 2);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
self.lastframe.reset();
if !is_24bit {
self.lastframe.set16(bufinfo.get_vbuf16().unwrap());
let myinfo = NAVideoInfo::new(self.width, self.height, false, RGB24_FORMAT);
let bufret = alloc_video_buffer(myinfo, 2);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
let is_intra = self.decode_blocks()?;
let myinfo = NAVideoInfo::new(width, height, false, YUV410_FORMAT);
let bufret = alloc_video_buffer(myinfo, 2);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
let mut br = BitReader::new(&src[hdr_size..], src.len() - hdr_size, BitReaderMode::LE);
let nblocks = pktbuf[0] as usize;
validate!(pktbuf.len() == 1 + 65 * nblocks);
let samples = nblocks * 32;
- let mut abuf = alloc_audio_buffer(self.ainfo, samples, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, samples, self.chmap.clone())?;
let mut adata = abuf.get_abuf_i16().unwrap();
let off1 = adata.get_offset(1);
let mut dst = adata.get_data_mut();
if let NACodecTypeInfo::Audio(_) = info.get_properties() {
let pktbuf = pkt.get_buffer();
let samples = pktbuf.len() / self.chmap.num_channels();
- let mut abuf = alloc_audio_buffer(self.ainfo, samples, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, samples, self.chmap.clone())?;
let mut adata = abuf.get_abuf_i16().unwrap();
let off1 = adata.get_offset(1);
let mut buf = adata.get_data_mut();
let nblocks = pktbuf.len() / BLOCK_SIZE / (self.ainfo.get_channels() as usize);
let duration = COEFFS * nblocks;
- let mut abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
let mut adata = abuf.get_abuf_f32().unwrap();
let mut dst = adata.get_data_mut();
let vinfo = self.info.get_properties().get_video_info().unwrap();
let bufret = alloc_video_buffer(vinfo, 2);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
for plane in 0..3 {
let tabidx = (if plane == 0 { luma_tab } else { chroma_tab }) as usize;
let vinfo = self.info.get_properties().get_video_info().unwrap();
let bufret = alloc_video_buffer(vinfo, 2);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
let ystart = data_start + (yoff as u64);
let ustart = data_start + (uoff as u64);
let nsamples = br.read(32)? as usize;
// validate!(nsamples % self.duration == 0);
- let mut abuf = alloc_audio_buffer(self.ainfo, nsamples / self.chmap.num_channels() / 2, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, nsamples / self.chmap.num_channels() / 2, self.chmap.clone())?;
let mut adata = abuf.get_abuf_f32().unwrap();
let mut off0 = adata.get_offset(0);
let mut off1 = adata.get_offset(1);
} else {
let bufret = alloc_video_buffer(self.info.get_properties().get_video_info().unwrap(), 4);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
buf = bufinfo.get_vbuf().unwrap();
self.key_frame = true;
self.hams.add_frame(buf);
} else {
let bufret = alloc_video_buffer(self.info.get_properties().get_video_info().unwrap(), 4);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
buf = bufinfo.get_vbuf().unwrap();
}
self.decode_plane(&mut br, plane_idx, &mut buf)?;
}
}
- let mut bufinfo = NABufferType::Video(buf);
+ let bufinfo = NABufferType::Video(buf);
if !self.is_ver_b {
self.ips.add_frame(bufinfo.get_vbuf().unwrap());
}
let is_intra;
let ftype;
- let mut bufinfo;
+ let bufinfo;
if src.len() > PAL_SIZE {
let mut br = BitReader::new(&src[PAL_SIZE..], src.len() - PAL_SIZE, BitReaderMode::LE);
validate!(!(stereo ^ (self.chans == 2)));
validate!(!(bits16 ^ (self.bits == 16)));
- let mut abuf;
+ let abuf;
let samples;
let nch = if stereo { 2 } else { 1 };
if bits16 {
let duration = NBLOCKS * BLOCKSIZE * nframes;
- let mut abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
let mut adata = abuf.get_abuf_i16().unwrap();
let mut dst = adata.get_data_mut();
let nframes = pktbuf.len() / FRAME_SIZE;
let duration = NBLOCKS * BLOCKSIZE * nframes;
- let mut abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
let mut adata = abuf.get_abuf_f32().unwrap();
let mut dst = adata.get_data_mut();
impl RV34Decoder {
pub fn new(is_rv30: bool, dsp: Box<RV34DSP>) -> Self {
let tmp_vinfo = NAVideoInfo::new(16, 16, false, YUV420_FORMAT);
- let mut vt = alloc_video_buffer(tmp_vinfo, 4).unwrap();
+ let vt = alloc_video_buffer(tmp_vinfo, 4).unwrap();
let vb = vt.get_vbuf();
let avg_buf = vb.unwrap();
RV34Decoder {
let vinfo = NAVideoInfo::new(hdr0.width, hdr0.height, false, YUV420_FORMAT);
let bufret = alloc_video_buffer(vinfo, 4);
if let Err(_) = bufret { return Err(DecoderError::InvalidData); }
- let mut bufinfo = bufret.unwrap();
+ let bufinfo = bufret.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
sstate.q = q;
impl RealVideo60Decoder {
fn new() -> Self {
let tmp_vinfo = NAVideoInfo::new(64, 64, false, YUV420_FORMAT);
- let mut vt = alloc_video_buffer(tmp_vinfo, 4).unwrap();
+ let vt = alloc_video_buffer(tmp_vinfo, 4).unwrap();
let vb = vt.get_vbuf();
let avg_buf = vb.unwrap();
RealVideo60Decoder{
let tmp_vinfo = NAVideoInfo::new(hdr.width, hdr.height, false, YUV420_FORMAT);
let res = alloc_video_buffer(tmp_vinfo, 6);
if !res.is_ok() { return Err(DecoderError::InvalidData); }
- let mut bufinfo = res.unwrap();
+ let bufinfo = res.unwrap();
let mut buf = bufinfo.get_vbuf().unwrap();
let cu_w = hdr.get_width_cu();