aac: clear M/S flags
[nihav.git] / nihav-itu / src / codecs / h264 / slice.rs
index 5c7072908951084788299a2d35177ff1ce31ae6c..ad1d244afe5cfd84b29fbe0060697971491c0558 100644 (file)
@@ -1,3 +1,5 @@
+use std::sync::Arc;
+
 use nihav_core::codecs::{DecoderResult, DecoderError};
 use nihav_core::frame::FrameType;
 use nihav_core::io::bitreader::*;
@@ -18,23 +20,14 @@ pub enum SliceType {
 
 impl SliceType {
     pub fn is_intra(self) -> bool {
-        match self {
-            SliceType::I | SliceType::SI => true,
-            _ => false,
-        }
+        matches!(self, SliceType::I | SliceType::SI)
     }
     pub fn is_p(self) -> bool {
-        match self {
-            SliceType::P | SliceType::SP => true,
-            _ => false,
-        }
+        matches!(self, SliceType::P | SliceType::SP)
     }
     pub fn is_b(self) -> bool { self == SliceType::B }
     pub fn is_s(self) -> bool {
-        match self {
-            SliceType::SI | SliceType::SP => true,
-            _ => false,
-        }
+        matches!(self, SliceType::SI | SliceType::SP)
     }
     pub fn to_frame_type(self) -> FrameType {
         match self {
@@ -162,7 +155,8 @@ pub fn parse_slice_header_minimal(br: &mut BitReader) -> DecoderResult<(usize, S
 }
 
 #[allow(clippy::cognitive_complexity)]
-pub fn parse_slice_header(br: &mut BitReader, sps_arr: &[SeqParameterSet], pps_arr: &[PicParameterSet], is_idr: bool, nal_ref_idc: u8) -> DecoderResult<SliceHeader> {
+#[allow(clippy::manual_range_contains)]
+pub fn parse_slice_header(br: &mut BitReader, sps_arr: &[Arc<SeqParameterSet>], pps_arr: &[Arc<PicParameterSet>], is_idr: bool, nal_ref_idc: u8) -> DecoderResult<SliceHeader> {
     let mut hdr: SliceHeader = unsafe { std::mem::zeroed() };
 
     hdr.first_mb_in_slice                           = br.read_ue()? as usize;