let mut idxv = buf.get_offset(2) + xpos * 8 + ypos * 8 * stridev;
let mut data = buf.get_data_mut();
- let mut framebuf: &mut [u8] = data.as_mut_slice();
+ let framebuf: &mut [u8] = data.as_mut_slice();
for j in 0..8 {
for k in 0..8 {
let mut idxv = buf.get_offset(2) + xpos * 8 + ypos * 8 * stridev;
let mut data = buf.get_data_mut();
- let mut framebuf: &mut [u8] = data.as_mut_slice();
+ let framebuf: &mut [u8] = data.as_mut_slice();
for j in 0..8 {
for k in 0..8 {
let paloff = buf.get_offset(1);
let stride = buf.get_stride(0);
let mut data = buf.get_data_mut();
- let mut dst = data.as_mut_slice();
+ let dst = data.as_mut_slice();
let mut sidx = PREAMBLE_SIZE;
let mut didx = 0;
fn deblock_hor(buf: &mut NAVideoBuffer<u8>, comp: usize, q: u8, off: usize) {
let stride = buf.get_stride(comp);
let mut dptr = buf.get_data_mut();
- let mut buf = dptr.as_mut_slice();
+ let buf = dptr.as_mut_slice();
for x in 0..8 {
let a = buf[off - 2 * stride + x] as i16;
let b = buf[off - 1 * stride + x] as i16;
fn deblock_ver(buf: &mut NAVideoBuffer<u8>, comp: usize, q: u8, off: usize) {
let stride = buf.get_stride(comp);
let mut dptr = buf.get_data_mut();
- let mut buf = dptr.as_mut_slice();
+ let buf = dptr.as_mut_slice();
for y in 0..8 {
let a = buf[off - 2 + y * stride] as i16;
let b = buf[off - 1 + y * stride] as i16;
}
fn decode_block(&mut self, quant: u8, intra: bool, coded: bool, blk: &mut [i16; 64]) -> DecoderResult<()> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let mut idx = 0;
if intra {
let mut dc = br.read(8)?;
#[allow(unused_variables)]
fn decode_pichdr(&mut self) -> DecoderResult<PicInfo> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let syncw = br.read(22)?;
validate!(syncw == 0x000020);
let tr = (br.read(8)? << 8) as u16;
#[allow(unused_variables)]
fn decode_slice_header(&mut self, info: &PicInfo) -> DecoderResult<SliceInfo> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let gbsc = br.read(17)?;
validate!(gbsc == 1);
let gn = br.read(5)?;
#[allow(unused_variables)]
fn decode_block_header(&mut self, info: &PicInfo, slice: &SliceInfo, sstate: &SliceState) -> DecoderResult<BlockInfo> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let mut q = slice.get_quant();
match info.get_mode() {
Type::I => {
#[allow(unused_variables)]
fn decode_block(&mut self, sstate: &SliceState, quant: u8, intra: bool, coded: bool, blk: &mut [i16; 64], plane_no: usize) -> DecoderResult<()> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let mut idx = 0;
if intra {
let mut dc;
}
fn decode_block_header(&mut self, info: &PicInfo, slice: &SliceInfo, sstate: &SliceState) -> DecoderResult<BlockInfo> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let mut q = slice.get_quant();
match info.get_mode() {
Type::I => {
fn read_slice_header(&mut self) -> DecoderResult<RV10SliceInfo> {
validate!(self.slice_no < self.num_slices);
- let mut br = &mut self.br;
+ let br = &mut self.br;
br.seek(self.slice_off[self.slice_no] * 8)?;
let marker = br.read(1)?;
#[allow(unused_variables)]
fn decode_block(&mut self, sstate: &SliceState, quant: u8, intra: bool, coded: bool, blk: &mut [i16; 64], plane_no: usize, acpred: ACPredMode) -> DecoderResult<()> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let mut idx = 0;
if !sstate.is_iframe && intra {
let mut dc = br.read(8)? as i16;
}
fn decode_block_header(&mut self, info: &PicInfo, slice: &SliceInfo, sstate: &SliceState) -> DecoderResult<BlockInfo> {
- let mut br = &mut self.br;
+ let br = &mut self.br;
let mut q = slice.get_quant();
match info.get_mode() {
Type::I => {
fn read_slice_header(&mut self) -> DecoderResult<RV20SliceInfo> {
validate!(self.slice_no < self.num_slices);
- let mut br = &mut self.br;
+ let br = &mut self.br;
br.seek(self.slice_off[self.slice_no] * 8)?;
//println!(" slice at off {}", br.tell());
}
fn read_level_coeffs_raw(&mut self, br: &mut BitReader, ch: usize) -> DecoderResult<()> {
- let mut ch_data = &mut self.ch_data[ch];
+ let ch_data = &mut self.ch_data[ch];
let maxc_pos = br.read(5)? as usize;
let max_coef = br.read(7)? as u8;
}
fn calculate_channel_values(&mut self, ch: usize) {
- let mut ch_data = &mut self.ch_data[ch];
+ let ch_data = &mut self.ch_data[ch];
let mut tmp2: [f32; BANDS+1] = [0.0; BANDS+1];
let mut tmp3: [f32; BANDS] = [0.0; BANDS];
self.ba.keep_flag[i] = level[i] == 16;
}
if reset {
- let mut ch_data = &mut self.ch_data[ch];
+ let ch_data = &mut self.ch_data[ch];
let (mut c1, mut c2) = calc_maxcoef(level[0] as f32);
ch_data.new_floor[0] = c1;
ch_data.log_floor[0] = c2;
}
}
} else {
- let mut ch_data = &mut self.ch_data[ch];
+ let ch_data = &mut self.ch_data[ch];
for i in 0..BANDS {
if level[i] < 16 {
let lval = level[i] - 7;
}
fn read_skip_flags(&mut self, br: &mut BitReader) -> DecoderResult<()> {
- let mut ba = &mut self.ba;
+ let ba = &mut self.ba;
for band in 0..BANDS {
if !ba.band_present[band] || ba.band_width[band] == 0 { continue; }
fn inv_quant(&mut self, ch: usize, raw_coeffs: bool) {
let qidx: usize = if raw_coeffs { 1 } else { 0 };
- let mut ch_data = &mut self.ch_data[ch];
+ let ch_data = &mut self.ch_data[ch];
for band in 0..BANDS {
for i in IMC_BANDS[band]..IMC_BANDS[band + 1] {
ch_data.cw[i] = 0.0;
let cb = &self.cb;
let mut data = buf.get_data_mut();
- let mut framebuf: &mut [u8] = data.as_mut_slice();
+ let framebuf: &mut [u8] = data.as_mut_slice();
let table = &INDEO2_DELTA_TABLE[tableno];
let cb = &self.cb;
let mut data = buf.get_data_mut();
- let mut framebuf: &mut [u8] = data.as_mut_slice();
+ let framebuf: &mut [u8] = data.as_mut_slice();
let table = &INDEO2_DELTA_TABLE[tableno];
#[allow(unused_variables)]
fn apply_delta4x4(bufs: &mut Buffers, off: usize, stride: usize,
deltas: &[u8], topline: bool, first_line: bool) {
- let mut dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 4)] }
- else { &mut bufs.buf2[off..(off + 4)] };
+ let dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 4)] }
+ else { &mut bufs.buf2[off..(off + 4)] };
for i in 0..4 { dst[i] = dst[i].wrapping_add(deltas[i]) & 0x7F; }
}
#[allow(unused_variables)]
fn apply_delta4x8(bufs: &mut Buffers, off: usize, stride: usize,
deltas: &[u8], topline: bool, first_line: bool) {
- let mut dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 4 + stride)] }
- else { &mut bufs.buf2[off..(off + 4 + stride)] };
+ let dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 4 + stride)] }
+ else { &mut bufs.buf2[off..(off + 4 + stride)] };
for i in 0..4 { dst[i + stride] = dst[i].wrapping_add(deltas[i]) & 0x7F; }
if !topline {
for i in 0..4 { dst[i] = (dst[i + stride] + dst[i]) >> 1; }
#[allow(unused_variables)]
fn apply_delta4x8m11(bufs: &mut Buffers, off: usize, stride: usize,
deltas: &[u8], topline: bool, first_line: bool) {
- let mut dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 4 + stride)] }
- else { &mut bufs.buf2[off..(off + 4 + stride)] };
+ let dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 4 + stride)] }
+ else { &mut bufs.buf2[off..(off + 4 + stride)] };
for i in 0..4 { dst[i] = dst[i] .wrapping_add(deltas[i]) & 0x7F; }
for i in 0..4 { dst[i + stride] = dst[i + stride].wrapping_add(deltas[i]) & 0x7F; }
}
#[allow(unused_variables)]
fn apply_delta8x8p(bufs: &mut Buffers, off: usize, stride: usize,
deltas: &[u8], topline: bool, first_line: bool) {
- let mut dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 8 + stride)] }
- else { &mut bufs.buf2[off..(off + 8 + stride)] };
+ let dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 8 + stride)] }
+ else { &mut bufs.buf2[off..(off + 8 + stride)] };
for i in 0..8 { dst[i] = dst[i] .wrapping_add(deltas[i >> 1]) & 0x7F; }
for i in 0..8 { dst[i + stride] = dst[i + stride].wrapping_add(deltas[i >> 1]) & 0x7F; }
}
fn apply_delta8x8i(bufs: &mut Buffers, off: usize, stride: usize,
deltas: &[u8], topline: bool, firstline: bool) {
- let mut dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 8 + stride)] }
- else { &mut bufs.buf2[off..(off + 8 + stride)] };
+ let dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 8 + stride)] }
+ else { &mut bufs.buf2[off..(off + 8 + stride)] };
if !firstline {
for i in 0..8 { dst[i + stride] = dst[i ].wrapping_add(deltas[i >> 1]) & 0x7F; }
} else {
} else {
for i in 0..bw { buf[i] = DEFAULT_PIXEL; }
}
- let mut dst = if bufs.fbuf { &mut bufs.buf1[off..(off + bw)] }
- else { &mut bufs.buf2[off..(off + bw)] };
+ let dst = if bufs.fbuf { &mut bufs.buf1[off..(off + bw)] }
+ else { &mut bufs.buf2[off..(off + bw)] };
for i in 0..bw { dst[i] = buf[i]; }
}
} else {
for i in 0..8 { buf[i] = DEFAULT_PIXEL; }
}
- let mut dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 8)] }
- else { &mut bufs.buf2[off..(off + 8)] };
+ let dst = if bufs.fbuf { &mut bufs.buf1[off..(off + 8)] }
+ else { &mut bufs.buf2[off..(off + 8)] };
for i in 0..8 {dst[i] = buf[i]; }
}
fn read_vchunk(&mut self, strmgr: &mut StreamManager) -> DemuxerResult<NAPacket> {
let str = strmgr.get_stream(self.v_id.unwrap()).unwrap();
- let mut src = &mut self.src;
+ let src = &mut self.src;
let magic = src.read_u16be()?;
if magic != 0x0513 { return Err(DemuxerError::InvalidData); }
let size = (src.read_u16le()? as usize) + 4;
}
fn fill_packet(&mut self, pkt: &mut NAPacket) -> DemuxerResult<()> {
let mut refbuf = pkt.get_buffer();
- let mut buf = Rc::make_mut(&mut refbuf);
+ let buf = Rc::make_mut(&mut refbuf);
let res = self.read_buf(buf.as_mut_slice());
if let Err(_) = res { return Err(DemuxerError::IOError); }
Ok(())
}
fn add_slice(&mut self, slice_no: usize, data: &[u8]) {
self.write_slice_info(slice_no);
- let mut dslice = &mut self.frame[self.hdr_size + self.frame_pos..][..data.len()];
+ let dslice = &mut self.frame[self.hdr_size + self.frame_pos..][..data.len()];
dslice.copy_from_slice(data);
self.frame_pos += data.len();
}
} else {
let mut ssize = len;
let mut buf : [u8; 16] = [0; 16];
- let mut bref = &mut buf;
+ let bref = &mut buf;
while ssize > bref.len() {
self.io.read_buf(bref)?;
ssize -= bref.len();