pub struct H264Decoder { /* private fields */ }Expand description
Baseline H.264 decoder.
Parses SPS/PPS from the bitstream to determine frame dimensions. Decodes I-slice macroblocks using CAVLC entropy decoding with full coefficient reconstruction (I_PCM, I_16x16, I_4x4 macroblock types), 4x4 inverse DCT, dequantization, and DC prediction for both luma and chroma planes. P-slice motion compensation and B-slice bidirectional prediction are handled by companion modules (h264_motion, h264_bslice). Deblocking is provided by h264_deblock.
Implementations§
Source§impl H264Decoder
impl H264Decoder
pub fn new() -> Self
pub fn process_nal( &mut self, nal: &NalUnit, ) -> Result<Option<DecodedFrame>, VideoError>
Trait Implementations§
Source§impl Default for H264Decoder
impl Default for H264Decoder
Source§impl VideoDecoder for H264Decoder
impl VideoDecoder for H264Decoder
fn codec(&self) -> VideoCodec
Source§fn decode(
&mut self,
data: &[u8],
timestamp_us: u64,
) -> Result<Option<DecodedFrame>, VideoError>
fn decode( &mut self, data: &[u8], timestamp_us: u64, ) -> Result<Option<DecodedFrame>, VideoError>
Decode a single compressed access unit into an RGB8 frame.
Returns
None if the decoder needs more data (e.g., initial SPS/PPS).Source§fn flush(&mut self) -> Result<Vec<DecodedFrame>, VideoError>
fn flush(&mut self) -> Result<Vec<DecodedFrame>, VideoError>
Flush any remaining buffered frames.
Auto Trait Implementations§
impl Freeze for H264Decoder
impl RefUnwindSafe for H264Decoder
impl Send for H264Decoder
impl Sync for H264Decoder
impl Unpin for H264Decoder
impl UnsafeUnpin for H264Decoder
impl UnwindSafe for H264Decoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more