diff --git a/src/decode.rs b/src/decode.rs index 0a9d467ee..61e1277b2 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -6021,7 +6021,7 @@ pub unsafe extern "C" fn dav1d_submit_frame(c: *mut Dav1dContext) -> libc::c_int (*c).frame_hdr_ref = 0 as *mut Dav1dRef; (*f).dsp = &mut *((*c).dsp).as_mut_ptr().offset((*(*f).seq_hdr).hbd as isize) as *mut Dav1dDSPContext; - let bpc: libc::c_int = 8 + 2 * (*(*f).seq_hdr).hbd; + let bpc = 8 + 2 * (*(*f).seq_hdr).hbd; if ((*(*f).dsp).ipred.intra_pred[DC_PRED as libc::c_int as usize]).is_none() { let dsp: *mut Dav1dDSPContext = &mut *((*c).dsp).as_mut_ptr().offset((*(*f).seq_hdr).hbd as isize) diff --git a/src/obu.rs b/src/obu.rs index 4a8407d11..c0f48abcc 100644 --- a/src/obu.rs +++ b/src/obu.rs @@ -1353,11 +1353,11 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) -> && dav1d_get_bit(gb) == 0) as libc::c_int; (*hdr).tiling.uniform = dav1d_get_bit(gb) as libc::c_int; let sbsz_min1: libc::c_int = ((64 as libc::c_int) << (*seqhdr).sb128) - 1; - let sbsz_log2: libc::c_int = 6 + (*seqhdr).sb128; + let sbsz_log2 = 6 + (*seqhdr).sb128; let sbw: libc::c_int = (*hdr).width[0] + sbsz_min1 >> sbsz_log2; let sbh: libc::c_int = (*hdr).height + sbsz_min1 >> sbsz_log2; - let max_tile_width_sb: libc::c_int = 4096 >> sbsz_log2; - let max_tile_area_sb: libc::c_int = 4096 * 2304 >> 2 * sbsz_log2; + let max_tile_width_sb = 4096 >> sbsz_log2; + let max_tile_area_sb = 4096 * 2304 >> 2 * sbsz_log2; (*hdr).tiling.min_log2_cols = tile_log2(max_tile_width_sb, sbw); (*hdr).tiling.max_log2_cols = tile_log2(1 as libc::c_int, imin(sbw, 64 as libc::c_int)); (*hdr).tiling.max_log2_rows = tile_log2(1 as libc::c_int, imin(sbh, 64 as libc::c_int)); @@ -1370,7 +1370,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) -> while (*hdr).tiling.log2_cols < (*hdr).tiling.max_log2_cols && dav1d_get_bit(gb) != 0 { (*hdr).tiling.log2_cols += 1; } - let tile_w: libc::c_int = 1 + (sbw - 1 >> (*hdr).tiling.log2_cols); + let tile_w = 1 + (sbw - 1 >> (*hdr).tiling.log2_cols); (*hdr).tiling.cols = 0 as libc::c_int; let mut sbx = 0; while sbx < sbw { @@ -1384,7 +1384,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) -> while (*hdr).tiling.log2_rows < (*hdr).tiling.max_log2_rows && dav1d_get_bit(gb) != 0 { (*hdr).tiling.log2_rows += 1; } - let tile_h: libc::c_int = 1 + (sbh - 1 >> (*hdr).tiling.log2_rows); + let tile_h = 1 + (sbh - 1 >> (*hdr).tiling.log2_rows); (*hdr).tiling.rows = 0 as libc::c_int; let mut sby = 0; while sby < sbh { @@ -1773,8 +1773,8 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) -> let poc: libc::c_uint = (*hdr).frame_offset as libc::c_uint; let mut off_before: libc::c_uint = 0xffffffff as libc::c_uint; let mut off_after: libc::c_int = -(1 as libc::c_int); - let mut off_before_idx: libc::c_int = 0; - let mut off_after_idx: libc::c_int = 0; + let mut off_before_idx = 0; + let mut off_after_idx = 0; let mut i_16 = 0; while i_16 < 7 { if ((*c).refs[(*hdr).refidx[i_16 as usize] as usize] @@ -1825,7 +1825,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) -> (*hdr).skip_mode_allowed = 1 as libc::c_int; } else if off_before != 0xffffffff as libc::c_uint { let mut off_before2: libc::c_uint = 0xffffffff as libc::c_uint; - let mut off_before2_idx: libc::c_int = 0; + let mut off_before2_idx = 0; let mut i_17 = 0; while i_17 < 7 { if ((*c).refs[(*hdr).refidx[i_17 as usize] as usize] @@ -2057,7 +2057,7 @@ unsafe extern "C" fn parse_frame_hdr(c: *mut Dav1dContext, gb: *mut GetBits) -> .wrapping_add(8 as libc::c_int as libc::c_uint) as libc::c_int; (*fgd).ar_coeff_lag = dav1d_get_bits(gb, 2 as libc::c_int) as libc::c_int; - let num_y_pos: libc::c_int = 2 * (*fgd).ar_coeff_lag * ((*fgd).ar_coeff_lag + 1); + let num_y_pos = 2 * (*fgd).ar_coeff_lag * ((*fgd).ar_coeff_lag + 1); if (*fgd).num_y_points != 0 { let mut i_23 = 0; while i_23 < num_y_pos { diff --git a/tests/seek_stress.rs b/tests/seek_stress.rs index 924721a86..2d258552b 100644 --- a/tests/seek_stress.rs +++ b/tests/seek_stress.rs @@ -194,7 +194,7 @@ unsafe extern "C" fn decode_rand( data: *mut Dav1dData, fps: libc::c_double, ) -> libc::c_int { - let mut res: libc::c_int = 0; + let mut res = 0; let mut p: Dav1dPicture = Dav1dPicture { seq_hdr: 0 as *mut Dav1dSequenceHeader, frame_hdr: 0 as *mut Dav1dFrameHeader, @@ -483,7 +483,7 @@ unsafe fn main_0(argc: libc::c_int, argv: *const *mut libc::c_char) -> libc::c_i spf = i_fps[1] as libc::c_double / i_fps[0] as libc::c_double; fps = i_fps[0] as libc::c_double / i_fps[1] as libc::c_double; if !(fps < 1 as libc::c_double) { - let mut i: libc::c_int = 0; + let mut i = 0; loop { if !(i < 3) { current_block = 5948590327928692120; @@ -593,7 +593,7 @@ unsafe fn main_0(argc: libc::c_int, argv: *const *mut libc::c_char) -> libc::c_i } } // simulate seeking after the end of the file - let mut i_1: libc::c_int = 0; + let mut i_1 = 0; while i_1 < 2 { if seek( in_0, @@ -611,7 +611,7 @@ unsafe fn main_0(argc: libc::c_int, argv: *const *mut libc::c_char) -> libc::c_i if decode_all(in_0, c, &mut data) != 0 { break; } - let mut num_flush: libc::c_int = 1 + 64 + xor128_rand() % 64; + let mut num_flush = 1 + 64 + xor128_rand() % 64; loop { num_flush -= 1; if num_flush == 0 {