X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-codec-support%2Fsrc%2Fcodecs%2Fmod.rs;h=2bac7e27fa5b84313ab1c49ad3f19ade869dfd13;hb=6bd5b458d9889f092abe9b582bd531ed08a8dc51;hp=92dee916db07f818611befffbb83ba400adcf75e;hpb=473c2f76c1164db245d9de89034650be998d4d7d;p=nihav.git diff --git a/nihav-codec-support/src/codecs/mod.rs b/nihav-codec-support/src/codecs/mod.rs index 92dee91..2bac7e2 100644 --- a/nihav-codec-support/src/codecs/mod.rs +++ b/nihav-codec-support/src/codecs/mod.rs @@ -11,20 +11,21 @@ use std::mem; /// /// # Examples /// -/// ````norun +/// ```ignore /// let mut frame = if is_intra_frame { /// allocate_video_frame() /// } else { /// let ret = shuffler.clone_ref(); /// if ret.is_none() { -/// return Err(DecodingError::MissingReference); +/// return Err(DecoderError::MissingReference); /// } /// ret.unwrap() /// }; /// // output data into the frame /// shuffler.add_frame(frame.clone()); // tells frame manager to use the frame as the next reference -/// ```` +/// ``` #[allow(dead_code)] +#[derive(Default)] pub struct HAMShuffler { lastframe: Option>, } @@ -62,29 +63,26 @@ impl HAMShuffler { } } -impl Default for HAMShuffler { - fn default() -> Self { Self { lastframe: None } } -} - /// Frame manager for codecs with intra and inter frames. /// /// This frame manager simplifies frame management for the case when codec decodes new frame using previous frame as source of some data. /// /// # Examples /// -/// ````norun +/// ```ignore /// let mut frame = allocate_video_frame(); /// if is_inter_frame { /// let ret = shuffler.get_ref(); /// if ret.is_none() { -/// return Err(DecodingError::MissingReference); +/// return Err(DecoderError::MissingReference); /// } /// let ref_frame = ret.unwrap(); /// // keep decoding using data from ref_frame /// } /// shuffler.add_frame(frame.clone()); // tells frame manager to use the frame as the next reference -/// ```` +/// ``` #[allow(dead_code)] +#[derive(Default)] pub struct IPShuffler { lastframe: Option>, } @@ -112,17 +110,13 @@ impl IPShuffler { } } -impl Default for IPShuffler { - fn default() -> Self { Self { lastframe: None } } -} - /// Frame manager for codecs with I-, P- and B-frames. /// /// This frame manager simplifies frame management for the case when codec uses I/P/B frame scheme. /// /// # Examples /// -/// ````norun +/// ```ignore /// let mut frame = allocate_video_frame(); /// for mb in all_macroblocks { /// // decode macroblock type @@ -144,8 +138,9 @@ impl Default for IPShuffler { /// if is_intra_frame || is_p_frame { /// shuffler.add_frame(frame.clone()); // tells frame manager to use the frame as the next reference /// } -/// ```` +/// ``` #[allow(dead_code)] +#[derive(Default)] pub struct IPBShuffler { lastframe: Option>, nextframe: Option>, @@ -202,10 +197,6 @@ impl IPBShuffler { } } -impl Default for IPBShuffler { - fn default() -> Self { Self { lastframe: None, nextframe: None } } -} - /// Motion vector data type. /// /// # Examples