Skip to main content

encode_tiles_parallel

Function encode_tiles_parallel 

Source
pub fn encode_tiles_parallel(
    frame: &[u8],
    width: u32,
    height: u32,
    config: &TileEncoderConfig,
) -> CodecResult<Vec<Vec<u8>>>
Expand description

Encode a raw luma frame into parallel tile bitstreams.

frame is interpreted as a contiguous row-major luma plane of width × height bytes. The frame is split into a config.tile_cols × config.tile_rows grid and each tile is encoded independently and concurrently using rayon.

§Returns

Vec<Vec<u8>> — one inner Vec<u8> per tile, in raster order (row-by-row, left to right within each row).

§Errors

Returns CodecError::InvalidParameter when the configuration is invalid or CodecError::InvalidBitstream when an individual tile fails to encode.