X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-indeo%2Fsrc%2Fcodecs%2Fivibr.rs;h=c6609ccaf15c62a97cf76778566ec5b58629e711;hb=ac818eac7671fa8ddfea5aa4fb86fc0b5ab82d2e;hp=8ccd3b0278b078e9a0a9d2845aa5550d49e872da;hpb=ac0bb254830c5f64775a74f139e4390b0dff52b7;p=nihav.git diff --git a/nihav-indeo/src/codecs/ivibr.rs b/nihav-indeo/src/codecs/ivibr.rs index 8ccd3b0..c6609cc 100644 --- a/nihav-indeo/src/codecs/ivibr.rs +++ b/nihav-indeo/src/codecs/ivibr.rs @@ -228,7 +228,8 @@ let tile_end = tile_start + len * 8; 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 { @@ -278,7 +279,8 @@ fn decode_block8x8(br: &mut BitReader, blk_cb: &IVICodebook, rvmap: &RVMap, tabl (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 { @@ -550,7 +552,7 @@ impl IVIDecoder { } 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 }, @@ -620,7 +622,7 @@ impl IVIDecoder { 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 { @@ -663,14 +665,14 @@ br.skip(skip_part as u32)?; } } } - 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]; @@ -825,7 +827,7 @@ br.skip(skip_part as u32)?; unreachable!(); } - fn decode_single_frame<'a>(&mut self, dec: &mut IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult { + fn decode_single_frame<'a>(&mut self, dec: &mut dyn IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult { let pic_hdr = dec.decode_picture_header(br)?; self.ftype = pic_hdr.ftype; if pic_hdr.ftype.is_null() { @@ -912,7 +914,7 @@ br.skip(skip_part as u32)?; Ok(buftype) } - pub fn decode_frame<'a>(&mut self, dec: &mut IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult { + pub fn decode_frame<'a>(&mut self, dec: &mut dyn IndeoXParser, br: &mut BitReader<'a>) -> DecoderResult { let res = self.decode_single_frame(dec, br); if res.is_err() { return res; } if (self.ftype == IVIFrameType::Intra) && (br.left() > 16) {