X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fdsp%2Fdct.rs;h=e58ccc706d87ae5ab54f08dcde36eb0bad996bb2;hb=d24468d9dbd54f5cbe414649ff061699337fa7fe;hp=ae04e8e88e2ff13da4f35ba5bbfb9183b22bf333;hpb=e243ceb4d694cc08767ad70027bb6963f4cefea3;p=nihav.git diff --git a/nihav-core/src/dsp/dct.rs b/nihav-core/src/dsp/dct.rs index ae04e8e..e58ccc7 100644 --- a/nihav-core/src/dsp/dct.rs +++ b/nihav-core/src/dsp/dct.rs @@ -48,7 +48,7 @@ impl DCT { perm_tab.push(0); // size = 1 perm_tab.push(0); // size = 2 perm_tab.push(1); - for blen in 2..bits+1 { + for blen in 2..=bits { let ssize = 1 << blen; for i in 0..ssize { perm_tab.push(swp_idx(i, blen)); } } @@ -66,7 +66,7 @@ impl DCT { tab.push((consts::PI / 8.0).sin()); // size = 1 tab.push((consts::PI / 8.0).cos()); if bits > 1 { - for blen in 1..bits+1 { + for blen in 1..=bits { let tsize = 1 << blen; let base = consts::PI / ((tsize * 8) as f32); for i in 0..tsize { @@ -81,7 +81,7 @@ impl DCT { },*/ _ => { tab = Vec::new(); }, }; - + Self { tmp, tab, mode, size, swaps, perms, is_pow2, perm_tab } } fn can_do_fast(&mut self) -> bool { @@ -153,7 +153,7 @@ fn reverse_bits(inval: u32) -> u32 { let mut val = inval; for _ in 0..8 { ret = (ret << 4) | (REV_TAB[(val & 0xF) as usize] as u32); - val = val >> 4; + val >>= 4; } ret }