pub struct Av1TileParallelEncoder { /* private fields */ }Expand description
Encoder that splits video frames into tiles and encodes each tile in parallel using rayon.
The encoder works with raw RGBA or YUV420 frame data (stored as a flat
Vec<u8>). Each tile is extracted from the source buffer, passed to
the configurable Av1TileEncodeOp trait, and the resulting bitstreams
are assembled into a single frame bitstream.
Implementations§
Source§impl Av1TileParallelEncoder
impl Av1TileParallelEncoder
Sourcepub fn new(
tile_config: Av1TileConfig,
frame_width: u32,
frame_height: u32,
) -> Result<Self>
pub fn new( tile_config: Av1TileConfig, frame_width: u32, frame_height: u32, ) -> Result<Self>
Creates a new tile encoder for frames of frame_width × frame_height.
§Errors
Returns an error when the tile configuration is incompatible with the frame dimensions.
Sourcepub fn tile_config(&self) -> &Av1TileConfig
pub fn tile_config(&self) -> &Av1TileConfig
Returns the tile configuration.
Sourcepub fn stats(&self) -> &Av1TileStats
pub fn stats(&self) -> &Av1TileStats
Returns collected encoding statistics.
Sourcepub fn encode_frame_rgba(&mut self, rgba: &[u8]) -> Result<Vec<u8>>
pub fn encode_frame_rgba(&mut self, rgba: &[u8]) -> Result<Vec<u8>>
Encodes one RGBA frame using tile-based rayon parallelism.
The frame data must be a row-major RGBA buffer of exactly
frame_width * frame_height * 4 bytes.
§Returns
An assembled tile bitstream (simple concatenation with 4-byte LE length
prefix per tile, as produced by assemble_av1_tile_bitstream).
§Errors
Returns an error when the frame buffer is too small.
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Resets the accumulated statistics.
Auto Trait Implementations§
impl Freeze for Av1TileParallelEncoder
impl RefUnwindSafe for Av1TileParallelEncoder
impl Send for Av1TileParallelEncoder
impl Sync for Av1TileParallelEncoder
impl Unpin for Av1TileParallelEncoder
impl UnsafeUnpin for Av1TileParallelEncoder
impl UnwindSafe for Av1TileParallelEncoder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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