From: Kostya Shishkov Date: Mon, 17 Dec 2018 11:30:38 +0000 (+0100) Subject: drop unneeded mut for mutable refs X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=4a9d2671dbfa6cab657ef52d321f153174cb6e1b;p=nihav.git drop unneeded mut for mutable refs --- diff --git a/src/codecs/blockdsp.rs b/src/codecs/blockdsp.rs index 4c0fea6..33d682a 100644 --- a/src/codecs/blockdsp.rs +++ b/src/codecs/blockdsp.rs @@ -150,7 +150,7 @@ pub fn copy_blocks(dst: &mut NAVideoBuffer, src: &NAVideoBuffer, let dstride = dst.get_stride(comp); let doff = dst.get_offset(comp); let mut ddta = dst.get_data_mut(); - let mut dbuf: &mut [u8] = ddta.as_mut_slice(); + let dbuf: &mut [u8] = ddta.as_mut_slice(); let x = if comp > 0 { dx/2 } else { dx }; let y = if comp > 0 { dy/2 } else { dy }; let sx_ = (if comp > 0 { sx >> 1 } else { sx }) - pre; @@ -172,7 +172,7 @@ pub fn copy_blocks(dst: &mut NAVideoBuffer, src: &NAVideoBuffer, let dstride = dst.get_stride(comp); let doff = dst.get_offset(comp); let mut ddta = dst.get_data_mut(); - let mut dbuf: &mut [u8] = ddta.as_mut_slice(); + let dbuf: &mut [u8] = ddta.as_mut_slice(); let x = if comp > 0 { dx/2 } else { dx }; let y = if comp > 0 { dy/2 } else { dy }; let sx_ = ((if comp > 0 { sx >> 1 } else { sx }) - pre) as usize; diff --git a/src/codecs/indeo/ividsp.rs b/src/codecs/indeo/ividsp.rs index 5bec1eb..88bc8cc 100644 --- a/src/codecs/indeo/ividsp.rs +++ b/src/codecs/indeo/ividsp.rs @@ -102,13 +102,13 @@ fn haar8x8_2d(blk: &mut[i32; 64]) { blk[i + 4*8], blk[i + 5*8], blk[i + 6*8], blk[i + 7*8]); } for i in 0..8 { - let mut row = &mut blk[i*8..(i+1)*8]; + let row = &mut blk[i*8..(i+1)*8]; haar_transform!(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7]); } } fn haar8x8_row(blk: &mut[i32; 64]) { for i in 0..8 { - let mut row = &mut blk[i*8..(i+1)*8]; + let row = &mut blk[i*8..(i+1)*8]; haar_transform!(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7]); } } @@ -135,13 +135,13 @@ fn haar4x4_2d(blk: &mut[i32; 64]) { haar_transform!(blk[i + 0*4], blk[i + 1*4], blk[i + 2*4], blk[i + 3*4]); } for i in 0..4 { - let mut row = &mut blk[i*4..(i+1)*4]; + let row = &mut blk[i*4..(i+1)*4]; haar_transform!(row[0], row[1], row[2], row[3]); } } fn haar4x4_row(blk: &mut[i32; 64]) { for i in 0..4 { - let mut row = &mut blk[i*4..(i+1)*4]; + let row = &mut blk[i*4..(i+1)*4]; haar_transform!(row[0], row[1], row[2], row[3]); } } @@ -168,7 +168,7 @@ fn slant8x8_2d(blk: &mut[i32; 64]) { blk[i + 4*8], blk[i + 5*8], blk[i + 6*8], blk[i + 7*8], pass1); } for i in 0..8 { - let mut row = &mut blk[i*8..(i+1)*8]; + let row = &mut blk[i*8..(i+1)*8]; slant_transform!(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], pass2); } } @@ -180,7 +180,7 @@ fn slant8x8_row(blk: &mut[i32; 64]) { let pass = |x: i32| (x + 1) >> 1; for i in 0..8 { - let mut row = &mut blk[i*8..(i+1)*8]; + let row = &mut blk[i*8..(i+1)*8]; slant_transform!(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], pass); } } @@ -215,7 +215,7 @@ fn slant4x4_2d(blk: &mut[i32; 64]) { slant_transform!(blk[i + 0*4], blk[i + 1*4], blk[i + 2*4], blk[i + 3*4], pass1); } for i in 0..4 { - let mut row = &mut blk[i*4..(i+1)*4]; + let row = &mut blk[i*4..(i+1)*4]; slant_transform!(row[0], row[1], row[2], row[3], pass2); } } @@ -227,7 +227,7 @@ fn slant4x4_row(blk: &mut[i32; 64]) { let pass = |x: i32| (x + 1) >> 1; for i in 0..4 { - let mut row = &mut blk[i*4..(i+1)*4]; + let row = &mut blk[i*4..(i+1)*4]; slant_transform!(row[0], row[1], row[2], row[3], pass); } } @@ -312,7 +312,7 @@ pub fn ivi_mc_put(dst: &mut [i16], dstride: usize, src: &[i16], sstride: usize, match mode { 0 => { for _ in 0..h { - let mut dest = &mut dst[didx..didx+w]; + let dest = &mut dst[didx..didx+w]; dest.copy_from_slice(&src[sidx..sidx+w]); sidx += sstride; didx += dstride; diff --git a/src/codecs/real/rv60.rs b/src/codecs/real/rv60.rs index a1ad055..2d1262b 100644 --- a/src/codecs/real/rv60.rs +++ b/src/codecs/real/rv60.rs @@ -741,7 +741,7 @@ println!(" left {} bits", br.left()); let dstride = buf.get_stride(0); let off = xpos + ypos * dstride; let mut data = buf.get_data_mut(); - let mut dst = &mut data; + let dst = &mut data; self.populate_ipred(hdr, dst, 0, dstride, 0, 0, size, true); self.ipred.pred_angle(dst, off, dstride, size, itype as usize, true); }