pub struct ParallelTileEncoder {
pub frame_width: u32,
pub frame_height: u32,
pub config: TileEncoderConfig,
}Expand description
Parallel AV1 tile encoder operating on raw byte frames.
This struct provides the same functionality as encode_tiles_parallel
but as a reusable object that caches frame geometry.
Fields§
§frame_width: u32Frame width in pixels.
frame_height: u32Frame height in pixels.
config: TileEncoderConfigEncoder configuration.
Implementations§
Source§impl ParallelTileEncoder
impl ParallelTileEncoder
Sourcepub fn new(
frame_width: u32,
frame_height: u32,
config: TileEncoderConfig,
) -> CodecResult<Self>
pub fn new( frame_width: u32, frame_height: u32, config: TileEncoderConfig, ) -> CodecResult<Self>
Create a new ParallelTileEncoder.
§Errors
Returns CodecError::InvalidParameter if the configuration is invalid
or the frame dimensions are zero.
Sourcepub fn split_frame(&self, frame: &[u8]) -> Vec<(TileRegionInfo, Vec<u8>)>
pub fn split_frame(&self, frame: &[u8]) -> Vec<(TileRegionInfo, Vec<u8>)>
Split frame (luma bytes, row-major) into (TileRegionInfo, Vec<u8>) pairs.
Each pair contains the region descriptor and the extracted luma bytes for that tile, ready for encoding. Tiles are returned in raster order.
Sourcepub fn encode_frame_parallel(
&self,
frame: &[u8],
) -> CodecResult<Vec<EncodedTile>>
pub fn encode_frame_parallel( &self, frame: &[u8], ) -> CodecResult<Vec<EncodedTile>>
Encode all tiles in parallel and return EncodedTile results in
raster order.
§Errors
Returns CodecError::InvalidBitstream if any tile fails to encode.
Sourcepub fn assemble_encoded(&self, tiles: &[EncodedTile]) -> Vec<u8> ⓘ
pub fn assemble_encoded(&self, tiles: &[EncodedTile]) -> Vec<u8> ⓘ
Assemble a slice of EncodedTiles into a single byte stream.
Format: for each tile except the last, a 4-byte LE tile size prefix is written followed by the tile data. The last tile has no size prefix (matching AV1 tile group conventions where the last tile size is implicit).
Trait Implementations§
Source§impl Clone for ParallelTileEncoder
impl Clone for ParallelTileEncoder
Source§fn clone(&self) -> ParallelTileEncoder
fn clone(&self) -> ParallelTileEncoder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ParallelTileEncoder
impl RefUnwindSafe for ParallelTileEncoder
impl Send for ParallelTileEncoder
impl Sync for ParallelTileEncoder
impl Unpin for ParallelTileEncoder
impl UnsafeUnpin for ParallelTileEncoder
impl UnwindSafe for ParallelTileEncoder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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