let slice_h;
if br.read_bool()? {
let idx = br.read(4)? as usize;
- if idx < 15 {
- slice_w = INDEO4_SLICE_SIZE_TAB[idx];
- slice_h = INDEO4_SLICE_SIZE_TAB[idx];
- } else {
- slice_w = width;
- slice_h = height;
- }
+ slice_h = if idx < 15 { INDEO4_SLICE_SIZE_TAB[idx] } else { height };
+ let idx = br.read(4)? as usize;
+ slice_w = if idx < 15 { INDEO4_SLICE_SIZE_TAB[idx] } else { width };
} else {
slice_w = width;
slice_h = height;
txtype = TxType::Transform8(TxParams8x8::new(qintra, qinter, scan));
} else if scan_idx < 10 {
validate!(!tr.is_8x8());
- validate!((qmat_idx >= 15) && (qmat_idx < 22));
+ validate!((15..22).contains(&qmat_idx));
let scan = INDEO4_SCANS_4X4[scan_idx - 5];
let qidx = INDEO4_Q4X4_IDX[qmat_idx - 15];
let qintra = INDEO4_Q4_INTRA[qidx];
if pic_hdr.ftype.is_intra() {
mb.mtype = MBType::Intra;
} else if band.inherit_mv {
- if let Some(ref tileref) = ref_tile {
+ if let Some(tileref) = ref_tile {
mb.mtype = tileref.mb[mb_idx].mtype;
} else {
return Err(DecoderError::MissingReference);
mb.cbp = br.read(4)? as u8;
}
if band.inherit_qd {
- if let Some(ref tileref) = ref_tile {
+ if let Some(tileref) = ref_tile {
mb.qd = tileref.mb[mb_idx].qd;
mb.q = calc_quant(band.quant, mb.qd);
} else {
if mb.mtype != MBType::Intra {
if band.inherit_mv {
- if let Some(ref tileref) = ref_tile {
+ if let Some(tileref) = ref_tile {
let mx = tileref.mb[mb_idx].mv_x;
let my = tileref.mb[mb_idx].mv_y;
if mv_scale == 0 {
mb.q = calc_quant(band.quant, mb.qd);
}
if band.inherit_mv {
- if let Some(ref tileref) = ref_tile {
+ if let Some(tileref) = ref_tile {
let mx = tileref.mb[mb_idx].mv_x;
let my = tileref.mb[mb_idx].mv_y;
if mv_scale == 0 {
fn new() -> Self {
Indeo4Decoder {
info: NACodecInfo::new_dummy(),
- dec: IVIDecoder::new(),
+ dec: IVIDecoder::new(false),
}
}
}