X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-indeo%2Fsrc%2Fcodecs%2Fivibr.rs;h=2169b6956280a30c8d26b18e19910eec90c12cf9;hb=fbf1f900e6e6da46026938f90f1eaba2034aa79a;hp=f11d6dc1a487427414d7b5df5e5cf27dc97c7cf4;hpb=01bdaf242441b98cfa8ae7ea2e585494af89844e;p=nihav.git diff --git a/nihav-indeo/src/codecs/ivibr.rs b/nihav-indeo/src/codecs/ivibr.rs index f11d6dc..2169b69 100644 --- a/nihav-indeo/src/codecs/ivibr.rs +++ b/nihav-indeo/src/codecs/ivibr.rs @@ -171,6 +171,7 @@ fn read_trans_band_header(br: &mut BitReader, w: usize, h: usize, dst: &mut [i16 for i in 0..cb.len { cb.bits[i] = br.read(4)? as u8; } + cb = cb.init(); br.align(); let tile_start = br.tell(); @@ -227,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 { @@ -277,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 { @@ -619,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 { @@ -662,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]; @@ -897,7 +900,7 @@ br.skip(skip_part as u32)?; } match self.ftype { - IVIFrameType::Intra | IVIFrameType::Inter => { + IVIFrameType::Intra | IVIFrameType::Intra1 | IVIFrameType::Inter => { self.iref_1 = self.iref_0; self.iref_0 = self.cur_frame; self.scal_ref = self.cur_frame;