MacroblockDecoder

Struct MacroblockDecoder 

Source
pub struct MacroblockDecoder {
    pub width: u32,
    pub height: u32,
    pub width_mb: u32,
    pub height_mb: u32,
    pub ref_frame: Option<YuvFrame>,
    /* private fields */
}

Fields§

§width: u32§height: u32§width_mb: u32§height_mb: u32§ref_frame: Option<YuvFrame>

Reference frame for P/B decoding

Implementations§

Source§

impl MacroblockDecoder

Source

pub fn new(width: u32, height: u32) -> Self

Source

pub fn decode_frame( &mut self, payload: &[u8], pic_hdr: &PictureHeader, seq: &SequenceHeader, frame: &mut YuvFrame, ) -> Result<()>

Source§

impl MacroblockDecoder

Source

pub fn wmv2_set_extradata(&mut self, extradata: &[u8])

Decode one WMV2 frame. hdr is the already-parsed per-frame header. This is the public entry point called from main.rs. Parse WMV2 ext-header from ASF extradata (upstream decode_ext_header).

If extradata is missing/short, we keep all flags at default false.

Source

pub fn wmv2_copy_ref(&self, out: &mut YuvFrame) -> bool

Source

pub fn decode_wmv2_frame( &mut self, payload: &[u8], hdr: &Wmv2FrameHeader, params: &Wmv2Params, frame: &mut YuvFrame, ) -> Result<()>

Source

pub fn probe_wmv2_payload(&self, payload: &[u8], hdr: &Wmv2FrameHeader) -> usize

Heuristic probe: try to parse a few macroblock headers after hdr.header_bits. Used to disambiguate ASF framing-byte offsets when the picture header can be (mis-)parsed at multiple byte offsets.

Returns a “score” = number of MB headers successfully parsed (higher is better).

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.