annotate the sources for test samples
[nihav.git] / nihav-itu / src / codecs / h264 / mod.rs
index 5ecd05cc6fd875baacc8ad4ef1e19981e3a0418a..3034e0768608feb4fba3679de15d61ad97216bc6 100644 (file)
@@ -15,6 +15,10 @@ mod types;
 pub use types::*;
 mod pic_ref;
 pub use pic_ref::*;
+#[allow(clippy::identity_op)]
+#[allow(clippy::erasing_op)]
+#[allow(clippy::many_single_char_names)]
+#[allow(clippy::range_plus_one)]
 mod dsp;
 use dsp::*;
 mod cabac;
@@ -190,7 +194,7 @@ struct H264Decoder {
 fn unescape_nal(src: &[u8], dst: &mut Vec<u8>) -> usize {
     let mut off = 0;
     let mut zrun = 0;
-    dst.truncate(0);
+    dst.clear();
     dst.reserve(src.len());
     while off < src.len() {
         dst.push(src[off]);
@@ -653,6 +657,7 @@ println!("PAFF?");
             }
         }
     }
+    #[allow(clippy::cognitive_complexity)]
     fn handle_macroblock(&mut self, mb_info: &mut CurrentMBInfo) {
         let pps = &self.pps[self.cur_pps];
 
@@ -1456,6 +1461,7 @@ mod test {
     use crate::itu_register_all_decoders;
     use nihav_commonfmt::generic_register_all_demuxers;
 
+    // samples if not specified otherwise come from H.264 conformance suite
     mod raw_demux;
     mod conformance;
     use self::raw_demux::RawH264DemuxerCreator;
@@ -1498,6 +1504,7 @@ mod test {
                         [0xa90454f5, 0x7875d5db, 0xbab234bd, 0xe6ce1193]]));
     }
 
+    // mostly static music video downloaded with youtube-dl
     #[test]
     fn test_h264_real1() {
         let mut dmx_reg = RegisteredDemuxers::new();
@@ -1571,6 +1578,7 @@ mod test {
                             [0x94fee093, 0x78ad89b3, 0xf20e882b, 0x941425db],
                             [0xc3eb1a78, 0x4b4e098a, 0xcbcf9bb4, 0xfd5b5426]]));
     }
+    // a sample downloaded from gfycat.com
     #[test]
     fn test_h264_real2() {
         let mut dmx_reg = RegisteredDemuxers::new();