Multi-threaded API#
- group MT_API
Interface API for multi-threaded support in AOCL Compression library are described in this section.
This file contains APIs that can be used to interpret streams produced by AOCL-Compression library with multi-threaded support.
RAP (Random Access Point) Frame : AOCL multi-threaded compressor might add an additional RAP frame at the start of the compressed stream for methods with no support for skippable blocks/frames. This contains metadata which the AOCL multi-threaded decompressor will use to decompress the stream on multiple threads.
Note : AOCL multi-threaded compressed output can be decompressed by a legacy single-threaded decompressor by incorporating an additional step of skipping the RAP frame bytes and passing the source stream buffer pointer that succeeds the RAP frame to the decompressor.
Functions
-
int32_t aocl_get_rap_frame_bound_mt(void)#
Interface API to get the upper bound of RAP frame bytes that will be added during multithreaded compression.
Applications may call this API to know how many additional bytes are needed in the destination buffer, and allocate them in addition to what is needed for single threaded compression.
- Returns:
Result
Description
RAP_frame_bound
Upper bound of RAP frame bytes
-
int32_t aocl_skip_rap_frame_mt(char *src, int32_t src_size)#
Interface API to get the length of the RAP frame in the compressed stream.
Legacy single threaded decompressors can call this API to know how many bytes of the compressed stream to skip to get the format compliant compressed stream that they can decompress.
Note : Presence of RAP frame is determined by checking for the magic word: 0x434C4C5F4C434F41 (ASCII encoding of AOCL_LLC) at the start of the stream.
Parameters
Direction
Description
src
in
Input stream buffer pointer.
src_size
in
Input stream buffer size.
- Returns:
Result
Description
RAP_frame_length
Length of RAP frame bytes in src
0
If RAP frame does not exist
Fail
ERR_INVALID_INPUT
-
int32_t aocl_get_rap_frame_bound_mt(void)#