for i in 0..cb.len {
cb.bits[i] = br.read(4)? as u8;
}
+ cb = cb.init();
br.align();
let tile_start = br.tell();
Ok(())
}
-fn decode_block8x8(br: &mut BitReader, blk_cb: &IVICodebook, rvmap: &RVMap, tables: &TxParams8x8, is_intra: bool, is_2d: bool, prev_dc: &mut i32, quant: u8, coeffs: &mut [i32; 64], transform: &TrFunc) -> DecoderResult<()> {
+#[allow(clippy::cast_lossless)]
+fn decode_block8x8(br: &mut BitReader, blk_cb: &IVICodebook, rvmap: &RVMap, tables: &TxParams8x8, is_intra: bool, is_2d: bool, prev_dc: &mut i32, quant: u8, coeffs: &mut [i32; 64], transform: TrFunc) -> DecoderResult<()> {
let mut idx: isize = -1;
let quant_mat = if is_intra { tables.quant_intra } else { tables.quant_inter };
while idx <= 64 {
(transform)(coeffs);
Ok(())
}
-fn decode_block4x4(br: &mut BitReader, blk_cb: &IVICodebook, rvmap: &RVMap, tables: &TxParams4x4, is_intra: bool, is_2d: bool, prev_dc: &mut i32, quant: u8, coeffs: &mut [i32; 64], transform: &TrFunc) -> DecoderResult<()> {
+#[allow(clippy::cast_lossless)]
+fn decode_block4x4(br: &mut BitReader, blk_cb: &IVICodebook, rvmap: &RVMap, tables: &TxParams4x4, is_intra: bool, is_2d: bool, prev_dc: &mut i32, quant: u8, coeffs: &mut [i32; 64], transform: TrFunc) -> DecoderResult<()> {
let mut idx: isize = -1;
let quant_mat = if is_intra { tables.quant_intra } else { tables.quant_inter };
while idx <= 64 {
}
Ok(())
}
- fn decode_band(&mut self, pic_hdr: &PictureHeader, dec: &mut IndeoXParser, br: &mut BitReader, plane_no: usize, band_no: usize) -> DecoderResult<()> {
+ fn decode_band(&mut self, pic_hdr: &PictureHeader, dec: &mut dyn IndeoXParser, br: &mut BitReader, plane_no: usize, band_no: usize) -> DecoderResult<()> {
let bidx = match plane_no {
0 => { band_no },
_ => { pic_hdr.luma_bands + plane_no - 1 },
dec.decode_mb_info(br, pic_hdr, &band, tile, ref_tile, mv_scale)?;
}
- self.decode_tile(br, &band, tile_no, &tr, &tr_dc)?;
+ self.decode_tile(br, &band, tile_no, tr, tr_dc)?;
let skip_part = tile_end - br.tell();
br.skip(skip_part as u32)?;
} else {
}
}
}
- self.decode_tile(br, &band, tile_no, &tr, &tr_dc)?;
+ self.decode_tile(br, &band, tile_no, tr, tr_dc)?;
}
}
self.bands[bidx] = band;
br.align();
Ok(())
}
- fn decode_tile(&mut self, br: &mut BitReader, band: &BandHeader, tile_no: usize, tr: &TrFunc, transform_dc: &TrFuncDC) -> DecoderResult<()> {
+ fn decode_tile(&mut self, br: &mut BitReader, band: &BandHeader, tile_no: usize, tr: TrFunc, transform_dc: TrFuncDC) -> DecoderResult<()> {
let mut mb_idx = 0;
let mut prev_dc: i32 = 0;
let tile = &mut self.tiles[tile_no];
unreachable!();
}
- fn decode_single_frame<'a>(&mut self, dec: &mut IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult<NABufferType> {
+ fn decode_single_frame<'a>(&mut self, dec: &mut dyn IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult<NABufferType> {
let pic_hdr = dec.decode_picture_header(br)?;
self.ftype = pic_hdr.ftype;
if pic_hdr.ftype.is_null() {
self.iref_0 = self.cur_frame;
self.scal_ref = self.cur_frame;
},
+ IVIFrameType::InterScal => {
+ self.scal_ref = self.cur_frame;
+ },
_ => {},
};
Ok(buftype)
}
- pub fn decode_frame<'a>(&mut self, dec: &mut IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult<NABufferType> {
+ pub fn decode_frame<'a>(&mut self, dec: &mut dyn IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult<NABufferType> {
let res = self.decode_single_frame(dec, br);
if res.is_err() { return res; }
if (self.ftype == IVIFrameType::Intra) && (br.left() > 16) {
let seq = br.peek(21);
if seq == 0xBFFF8 {
let res2 = self.decode_single_frame(dec, br);
- if res2.is_ok() {
- self.bref = Some(res2.unwrap());
+ if let Ok(res) = res2 {
+ self.bref = Some(res);
}
}
self.ftype = IVIFrameType::Intra;