diff --git a/src/decode.rs b/src/decode.rs index bbe389b72..56e14ae5d 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -3408,7 +3408,7 @@ unsafe fn decode_b( by4, bx4, ); - *b.comp_type_mut() = COMP_INTER_WEIGHTED_AVG as u8 + *b.comp_type_mut() = COMP_INTER_WEIGHTED_AVG + dav1d_msac_decode_bool_adapt( &mut ts.msac, &mut ts.cdf.m.jnt_comp[jnt_ctx as usize], @@ -3416,7 +3416,7 @@ unsafe fn decode_b( if DEBUG_BLOCK_INFO(f, t) { println!( "Post-jnt_comp[{},ctx={}[ac:{},ar:{},lc:{},lr:{}]]: r={}", - b.comp_type() == COMP_INTER_AVG as u8, + b.comp_type() == COMP_INTER_AVG, jnt_ctx, (*t.a).comp_type[bx4 as usize], (*t.a).r#ref[0][bx4 as usize], @@ -3426,15 +3426,15 @@ unsafe fn decode_b( ); } } else { - *b.comp_type_mut() = COMP_INTER_AVG as u8; + *b.comp_type_mut() = COMP_INTER_AVG; } } else { if wedge_allowed_mask & (1 << bs) != 0 { let ctx = dav1d_wedge_ctx_lut[bs as usize] as usize; - *b.comp_type_mut() = COMP_INTER_WEDGE as u8 + *b.comp_type_mut() = COMP_INTER_WEDGE - dav1d_msac_decode_bool_adapt(&mut ts.msac, &mut ts.cdf.m.wedge_comp[ctx]) as u8; - if b.comp_type() == COMP_INTER_WEDGE as u8 { + if b.comp_type() == COMP_INTER_WEDGE { *b.wedge_idx_mut() = dav1d_msac_decode_symbol_adapt16( &mut ts.msac, &mut ts.cdf.m.wedge_idx[ctx], @@ -3442,13 +3442,13 @@ unsafe fn decode_b( ) as u8; } } else { - *b.comp_type_mut() = COMP_INTER_SEG as u8; + *b.comp_type_mut() = COMP_INTER_SEG; } *b.mask_sign_mut() = dav1d_msac_decode_bool_equi(&mut ts.msac) as u8; if DEBUG_BLOCK_INFO(f, t) { println!( "Post-seg/wedge[{},wedge_idx={},sign={}]: r={}", - b.comp_type() == COMP_INTER_WEDGE as u8, + b.comp_type() == COMP_INTER_WEDGE, b.wedge_idx(), b.mask_sign(), ts.msac.rng, @@ -3456,7 +3456,7 @@ unsafe fn decode_b( } } } else { - *b.comp_type_mut() = COMP_INTER_NONE as u8; + *b.comp_type_mut() = COMP_INTER_NONE; // ref if let Some(seg) = seg.filter(|seg| seg.r#ref > 0) { @@ -3791,7 +3791,7 @@ unsafe fn decode_b( // subpel filter let filter = if frame_hdr.subpel_filter_mode == DAV1D_FILTER_SWITCHABLE { if has_subpel_filter { - let comp = b.comp_type() != COMP_INTER_NONE as u8; + let comp = b.comp_type() != COMP_INTER_NONE; let ctx1 = get_filter_ctx(&*t.a, &t.l, comp, false, b.r#ref()[0], by4, bx4); let filter0 = dav1d_msac_decode_symbol_adapt4( &mut ts.msac, @@ -3968,7 +3968,7 @@ unsafe fn decode_b( let sby = t.by - ts.tiling.row_start >> f.sb_shift; let lowest_px = &mut *ts.lowest_pixel.offset(sby as isize); // keep track of motion vectors for each reference - if b.comp_type() == COMP_INTER_NONE as u8 { + if b.comp_type() == COMP_INTER_NONE { // y if std::cmp::min(bw4, bh4) > 1 && (b.inter_mode() == GLOBALMV && f.gmv_warp_allowed[b.r#ref()[0] as usize] != 0 diff --git a/src/env.rs b/src/env.rs index 57778faa1..65f656274 100644 --- a/src/env.rs +++ b/src/env.rs @@ -247,14 +247,14 @@ pub fn get_comp_dir_ctx( let edge = if a_intra { l } else { a }; let off = if a_intra { yb4 } else { xb4 }; - if edge.comp_type[off as usize] == COMP_INTER_NONE as u8 { + if edge.comp_type[off as usize] == COMP_INTER_NONE { return 2; } return 1 + 2 * has_uni_comp(edge, off) as u8; } - let a_comp = a.comp_type[xb4 as usize] != COMP_INTER_NONE as u8; - let l_comp = l.comp_type[yb4 as usize] != COMP_INTER_NONE as u8; + let a_comp = a.comp_type[xb4 as usize] != COMP_INTER_NONE; + let l_comp = l.comp_type[yb4 as usize] != COMP_INTER_NONE; let a_ref0 = a.r#ref[0][xb4 as usize]; let l_ref0 = l.r#ref[0][yb4 as usize]; @@ -287,7 +287,7 @@ pub fn get_comp_dir_ctx( if edge.intra[off as usize] != 0 { return 2; } - if edge.comp_type[off as usize] == COMP_INTER_NONE as u8 { + if edge.comp_type[off as usize] == COMP_INTER_NONE { return 2; } return 4 * has_uni_comp(edge, off) as u8; @@ -335,7 +335,7 @@ pub fn get_jnt_comp_ctx( .abs(); let offset = (d0 == d1) as u8; let [a_ctx, l_ctx] = [(a, xb4), (l, yb4)].map(|(al, b4)| { - (al.comp_type[b4 as usize] >= COMP_INTER_AVG as u8 || al.r#ref[0][b4 as usize] == 6) as u8 + (al.comp_type[b4 as usize] >= COMP_INTER_AVG || al.r#ref[0][b4 as usize] == 6) as u8 }); 3 * offset + a_ctx + l_ctx @@ -349,7 +349,7 @@ pub fn get_mask_comp_ctx( xb4: libc::c_int, ) -> u8 { let [a_ctx, l_ctx] = [(a, xb4), (l, yb4)].map(|(al, b4)| { - if al.comp_type[b4 as usize] >= COMP_INTER_SEG as u8 { + if al.comp_type[b4 as usize] >= COMP_INTER_SEG { 1 } else if al.r#ref[0][b4 as usize] == 6 { 3