scuffle_h265/sps/
sps_multilayer_extension.rs

1use std::io;
2
3use scuffle_bytes_util::BitReader;
4
5/// Sequence parameter set multilayer extension.
6///
7/// `sps_multilayer_extension()`
8///
9/// - ISO/IEC 23008-2 - F.7.3.2.2.4
10/// - ISO/IEC 23008-2 - F.7.4.3.2.4
11#[derive(Debug, Clone, PartialEq)]
12pub struct SpsMultilayerExtension {
13    /// Equal to `true` indicates that vertical component of motion vectors
14    /// used for inter-layer prediction are constrained in the layers for which this SPS RBSP is the active SPS
15    /// RBSP. When this value is equal to `true`, the vertical component of the motion
16    /// vectors used for inter-layer prediction shall be less than or equal to 56 in units of luma samples.
17    ///
18    /// When this value is equal to `false`, no constraint on the vertical component of the motion
19    /// vectors used for inter-layer prediction is signalled by this flag.
20    pub inter_view_mv_vert_constraint_flag: bool,
21}
22
23impl SpsMultilayerExtension {
24    pub(crate) fn parse<R: io::Read>(bit_reader: &mut BitReader<R>) -> io::Result<Self> {
25        Ok(Self {
26            inter_view_mv_vert_constraint_flag: bit_reader.read_bit()?,
27        })
28    }
29}