]> git.nihav.org Git - nihav.git/blobdiff - src/codecs/indeo/imc.rs
drop unneeded mut for mutable refs
[nihav.git] / src / codecs / indeo / imc.rs
index b6b679f50e9de7ea49ef1d0baf4e04095f1bc450..f11daa90c29a3a7b7723ca80840dd7fe81a85808 100644 (file)
@@ -2,13 +2,13 @@ use std::mem;
 use std::ptr;
 use std::f32::consts;
 
-use formats::*;
-use frame::*;
+use crate::formats::*;
+use crate::frame::*;
 use super::super::*;
-use io::bitreader::*;
-use io::codebook::*;
-use dsp::fft::*;
-use dsp::window::*;
+use crate::io::bitreader::*;
+use crate::io::codebook::*;
+use crate::dsp::fft::*;
+use crate::dsp::window::*;
 
 const BANDS:      usize =  32;
 const COEFFS:     usize = 256;
@@ -434,7 +434,7 @@ impl IMCDecoder {
     }
 
     fn read_level_coeffs_raw(&mut self, br: &mut BitReader, ch: usize) -> DecoderResult<()> {
-        let mut ch_data = &mut self.ch_data[ch];
+        let ch_data = &mut self.ch_data[ch];
         let maxc_pos = br.read(5)? as usize;
         let max_coef = br.read(7)? as u8;
 
@@ -458,7 +458,7 @@ impl IMCDecoder {
     }
 
     fn calculate_channel_values(&mut self, ch: usize) {
-        let mut ch_data = &mut self.ch_data[ch];
+        let ch_data = &mut self.ch_data[ch];
         let mut tmp2: [f32; BANDS+1] = [0.0; BANDS+1];
         let mut tmp3: [f32; BANDS] = [0.0; BANDS];
 
@@ -526,7 +526,7 @@ impl IMCDecoder {
             self.ba.keep_flag[i] = level[i] == 16;
         }
         if reset {
-            let mut ch_data = &mut self.ch_data[ch];
+            let ch_data = &mut self.ch_data[ch];
             let (mut c1, mut c2) = calc_maxcoef(level[0] as f32);
             ch_data.new_floor[0] = c1;
             ch_data.log_floor[0] = c2;
@@ -550,7 +550,7 @@ impl IMCDecoder {
                 }
             }
         } else {
-            let mut ch_data = &mut self.ch_data[ch];
+            let ch_data = &mut self.ch_data[ch];
             for i in 0..BANDS {
                 if level[i] < 16 {
                     let lval = level[i] - 7;
@@ -570,7 +570,7 @@ impl IMCDecoder {
                 self.ba.band_width[i] = 0;
             }
         }
-        
+
         for i in 0..BANDS-1 {
             if self.ba.band_width[i] > 0 {
                 self.ba.band_present[i] = br.read_bool()?;
@@ -582,7 +582,7 @@ impl IMCDecoder {
     }
 
     fn read_skip_flags(&mut self, br: &mut BitReader) -> DecoderResult<()> {
-        let mut ba = &mut self.ba;
+        let ba = &mut self.ba;
         for band in 0..BANDS {
             if !ba.band_present[band] || ba.band_width[band] == 0 { continue; }
 
@@ -697,7 +697,7 @@ impl IMCDecoder {
 
     fn inv_quant(&mut self, ch: usize, raw_coeffs: bool) {
         let qidx: usize = if raw_coeffs { 1 } else { 0 };
-        let mut ch_data = &mut self.ch_data[ch];
+        let ch_data = &mut self.ch_data[ch];
         for band in 0..BANDS {
             for i in IMC_BANDS[band]..IMC_BANDS[band + 1] {
                 ch_data.cw[i] = 0.0;
@@ -721,7 +721,7 @@ impl IMCDecoder {
                         ch_data.cw[i] =  quant[val - 1]       * ch_data.adj_floor[band];
                     } else {
                         ch_data.cw[i] = -quant[max - val - 1] * ch_data.adj_floor[band];
-                    }                    
+                    }
                 }
             }
         }
@@ -1107,7 +1107,7 @@ const IMC_CB_SELECTOR: [[usize; BANDS]; 4] = [
 
 #[cfg(test)]
 mod test {
-    use test::dec_video::*;
+    use crate::test::dec_video::*;
     #[test]
     fn test_imc() {
 //        let file = "assets/neal73_saber.avi";