pub struct ScalabilityPattern { /* private fields */ }Expand description
The dependency structure of a ScalabilityMode, as a generator of pictures.
The structure is the one of the specification’s dependency diagrams (webrtc-svc section 9) and of the AV1 RTP specification’s examples (A.10.2), which give the same structures as tables:
- temporal layers: with two, pictures alternate between layers 0 and 1; with three, the layers go 0, 2, 1, 2. A frame predicts from the latest frame of its spatial layer in a lower temporal layer (in layer 0: the latest of layer 0);
LxTy: in addition every frame predicts from the frame of the spatial layer below in its picture;LxTy_KEY: it does so in the key picture only;LxTy_KEY_SHIFT: as_KEY, and after the key picture the temporal pattern of spatial layersofSstarts(s + 1) mod Spictures late, so the layers’ base layer frames fall in different pictures;SxTy: the spatial layers are independent, each with its own key frame.
Decode targets are one per spatial and temporal layer, highest spatial layer first and within it highest temporal layer first (the order of the AV1 RTP specification’s tables). There is one chain per spatial layer, protecting that layer’s decode targets.
Implementations§
Source§impl ScalabilityPattern
impl ScalabilityPattern
Sourcepub fn new(mode: ScalabilityMode) -> Self
pub fn new(mode: ScalabilityMode) -> Self
The pattern of mode, before its first picture.
Sourcepub fn mode(&self) -> ScalabilityMode
pub fn mode(&self) -> ScalabilityMode
The mode.
Sourcepub fn decode_target_layers(&self) -> Vec<(u8, u8)>
pub fn decode_target_layers(&self) -> Vec<(u8, u8)>
The spatial and temporal layer each decode target stands for, in decode target order.
Sourcepub fn next_picture(&mut self, key_picture: bool) -> Vec<LayerFrame>
pub fn next_picture(&mut self, key_picture: bool) -> Vec<LayerFrame>
The frames of the next picture, lowest spatial layer first. key_picture starts a new
coded video sequence (the first picture always does): ask for one when a receiver
asks for a key frame.
Sourcepub fn dependency_structure(
mode: ScalabilityMode,
resolution: Option<(u32, u32)>,
) -> FrameDependencyStructure
pub fn dependency_structure( mode: ScalabilityMode, resolution: Option<(u32, u32)>, ) -> FrameDependencyStructure
The mode’s frame dependency structure for the Dependency Descriptor (AV1 RTP
specification A.8): one template for every kind of frame the pattern produces, so that
each frame’s descriptor is three bytes. resolution is the highest spatial layer’s
width and height, when the structure should carry the layers’ resolutions.
For "L1T3", "L3T3" and "L3T3_KEY_SHIFT" this is the structure the specification
gives as an example (A.10.2.1 to A.10.2.3), template for template.
Sourcepub fn vp9_scalability_structure(
mode: ScalabilityMode,
resolution: Option<(u32, u32)>,
flexible_mode: bool,
) -> Result<Vp9ScalabilityStructure>
pub fn vp9_scalability_structure( mode: ScalabilityMode, resolution: Option<(u32, u32)>, flexible_mode: bool, ) -> Result<Vp9ScalabilityStructure>
The mode’s VP9 scalability structure (RFC 9628 section 4.2.1), for
Vp9Payloader::set_scalability_structure.
resolution is the highest spatial layer’s width and height, when the SS should carry
the layers’ resolutions.
For non-flexible mode (flexible_mode false) it has the picture group that declares
the temporal structure; in flexible mode each packet carries its own references and
the SS has none.
§Errors
Non-flexible mode for a mode with shifted temporal layers: there “all frames follow the same inter-picture dependency structure” (RFC 9628 section 4.2.1), which a shifted pattern does not; and a resolution that does not fit 16 bits.