+use std::sync::Arc;
+
use nihav_core::codecs::{DecoderResult, DecoderError};
use nihav_core::io::bitreader::*;
}
pub fn is_high_profile(profile: u8) -> bool {
- match profile {
- 100 | 110 | 122 | 244 | 44 | 83 | 86 | 118 | 128 | 138 | 139 | 134 | 125 => true,
- _ => false,
- }
+ matches!(profile, 100 | 110 | 122 | 244 | 44 | 83 | 86 | 118 | 128 | 138 | 139 | 134 | 125)
}
#[allow(clippy::cognitive_complexity)]
pub second_chroma_qp_index_offset: i8,
}
-pub fn parse_pps(src: &[u8], sps_arr: &[SeqParameterSet], full_size: usize) -> DecoderResult<PicParameterSet> {
+pub fn parse_pps(src: &[u8], sps_arr: &[Arc<SeqParameterSet>], full_size: usize) -> DecoderResult<Arc<PicParameterSet>> {
let mut br = BitReader::new(src, BitReaderMode::BE);
let mut pps: PicParameterSet = unsafe { std::mem::zeroed() };
pps.second_chroma_qp_index_offset = pps.chroma_qp_index_offset;
}
- Ok(pps)
+ Ok(Arc::new(pps))
}