Skip to main content

ScalabilityPattern

Struct ScalabilityPattern 

Source
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 layer s of S starts (s + 1) mod S pictures 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

Source

pub fn new(mode: ScalabilityMode) -> Self

The pattern of mode, before its first picture.

Source

pub fn mode(&self) -> ScalabilityMode

The mode.

Source

pub fn decode_target_layers(&self) -> Vec<(u8, u8)>

The spatial and temporal layer each decode target stands for, in decode target order.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for ScalabilityPattern

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScalabilityPattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.