pub const H263_INTERP_AVG_FUNCS: &[blockdsp::BlkInterpFunc] = &[
         h263_interp00_avg, h263_interp01_avg, h263_interp10_avg, h263_interp11_avg ];
 
+#[derive(Default)]
 pub struct H263BlockDSP { }
 
 impl H263BlockDSP {
 
             bi.mv_f[blk_no]
         }
     }
+    #[allow(clippy::cyclomatic_complexity)]
     fn reconstruct_obmc(&mut self, buf: &mut NAVideoBuffer<u8>, slice_start: usize, start: usize, end: usize, slice_end: bool) -> usize {
         let mut mb_x = start % self.mb_w;
         let mut mb_y = start / self.mb_w;
         }
         mb_pos
     }
+    #[allow(clippy::cyclomatic_complexity)]
     pub fn parse_frame(&mut self, bd: &mut BlockDecoder, bdsp: &BlockDSP) -> DecoderResult<NABufferType> {
         let pinfo = bd.decode_pichdr()?;
         let mut mvi = MVInfo::new();
 
 use super::{MV, ZERO_MV};
 use nihav_core::frame::{NAVideoBuffer, NAVideoBufferRef};
 
+#[allow(clippy::erasing_op)]
 #[allow(clippy::many_single_char_names)]
 pub mod code;
 pub mod data;
 
     }
 }
 
-
+impl Default for IMAState {
+    fn default() -> Self {
+        Self::new()
+    }
+}
 
 pub mod blockdsp;
 
 #[cfg(feature="h263")]
+#[allow(clippy::collapsible_if)]
+#[allow(clippy::manual_memcpy)]
+#[allow(clippy::needless_range_loop)]
 pub mod h263;
 
 /// The common 8x8 zigzag scan.
 
     let mut ret = 0;
     let mut val = inval;
     for _ in 0..8 {
-        ret = (ret << 4) | (REV_TAB[(val & 0xF) as usize] as u32);
+        ret = (ret << 4) | u32::from(REV_TAB[(val & 0xF) as usize]);
         val >>= 4;
     }
     ret
 
 #[cfg(feature="dsp")]
 #[allow(clippy::excessive_precision)]
 #[allow(clippy::identity_op)]
+#[allow(clippy::manual_memcpy)]
 #[allow(clippy::needless_range_loop)]
 #[allow(clippy::unreadable_literal)]
 pub mod dsp;
 
 pub mod data;
 
+#[allow(clippy::identity_op)]
+#[allow(clippy::many_single_char_names)]
 pub mod imgwrite;
 
+#[allow(clippy::too_many_arguments)]
+#[allow(clippy::type_complexity)]
 pub mod test;
 
 #[cfg(feature="vq")]
+#[allow(clippy::needless_range_loop)]
 pub mod vq;
 
 extern crate nihav_core;
 
 
     let mux_f = mux_reg.find_muxer(muxer).unwrap();
 
-    let mut dst = Vec::with_capacity(1048576);
+    let mut dst = Vec::with_capacity(1 << 10);
     let mut gw = GrowableMemoryWriter::new_write(&mut dst);
     let mut bw = ByteWriter::new(&mut gw);
     let mut out_sm = StreamManager::new();
 
 //! Decoder testing functionality.
 //!
 //! This module provides functions that may be used in internal test to check that decoders produce output and that they produce expected output.
+#[allow(clippy::identity_op)]
 pub mod dec_video;
 pub mod enc_video;
 pub mod wavwriter;
 
+#[allow(clippy::identity_op)]
+#[allow(clippy::unreadable_literal)]
 mod md5; // for internal checksums only
 
 /// Decoder testing modes.
 
     fn new() -> Self { Self { seed: 0x1234 } }
     fn next(&mut self) -> u8 {
         if (self.seed & 0x8000) != 0 {
-            self.seed = (self.seed & 0x7FFF) * 2 ^ 0x1B2B;
+            self.seed = ((self.seed & 0x7FFF) * 2) ^ 0x1B2B;
         } else {
             self.seed <<= 1;
         }
         clu1.calc_dist();
         clu0.dist + clu1.dist
     }
+    #[allow(clippy::cyclomatic_complexity)]
     pub fn quantise(&mut self, src: &[T], dst: &mut [T]) -> usize {
-        if src.len() < 1 || dst.len() != self.clusters.len() {
+        if src.is_empty() || dst.len() != self.clusters.len() {
             return 0;
         }
         let mut old_cb = vec![T::default(); self.clusters.len()];
             if do_elbg_step {
                 do_elbg_step = false;
                 for low_idx in low_u.iter() {
-                    if high_u.len() == 0 {
+                    if high_u.is_empty() {
                         break;
                     }
                     let high_idx_idx = (rng.next() as usize) % high_u.len();
 
 
 pub fn quantise_median_cut<T: VQElement, TS: VQElementSum<T>>(src: &[T], dst: &mut [T]) -> usize {
     let mut points = Vec::with_capacity(src.len());
-    points.extend(src.into_iter());
+    points.extend(src.iter());
     for comp in 0..T::num_components() {
         T::sort_by_component(points.as_mut_slice(), comp);
     }