nvjpeg2kStreamParse()¶
This function is the first step in the decoding of a JPEG2000 bitstream. It accepts the bitstream buffer on host memory as input
and parses the JPEG2000 header information. The parsed information is stored in the nvjpeg2kStream_t handle and can be
retrieved by the APIs documented in this section.
Signature:
nvjpeg2kStatus_t nvjpeg2kStreamParse(nvjpeg2kHandle_t handle,
const unsigned char *data,
size_t length,
int save_metadata,
int save_stream,
nvjpeg2kStream_t *stream_handle);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvjpeg2kHandle_t handle |
Input |
Host |
library handle |
const unsigned char *data |
Input |
Host |
bitstream buffer |
size_t length |
Input |
Host |
bitstream size in bytes |
int save_metadata |
Input |
Host |
Set to 0. Added for future use |
int save_stream |
Input |
Host |
Set to 0. Added for future use |
nvjpeg2kStream_t *stream_handle |
Input |
Host |
bitstream handle |
Returns:
nvjpeg2kStatus_t - An error code as specified in API Return Status Codes
nvjpeg2kStreamGetImageInfo()¶
Retrieves the image information defined in nvjpeg2kImageInfo_t. This information is useful in allocating output buffers on device memory.
Signature:
nvjpeg2kStatus_t nvjpeg2kStreamGetImageInfo(nvjpeg2kStream_t stream_handle,
nvjpeg2kImageInfo_t* image_info);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvjpeg2kStream_t *stream_handle |
Input |
Host |
bitstream handle |
nvjpeg2kImageInfo_t* image_info |
Input/Output |
Host |
Pointer to nvjpeg2kImageInfo_t |
Returns:
nvjpeg2kStatus_t - An error code as specified in API Return Status Codes
nvjpeg2kStreamGetImageComponentInfo()¶
Retrieves the component level information defined in nvjpeg2kImageComponentInfo_t This information can be used in allocating output buffers on device memory. Component level information is useful when the dimensions vary across components.
Signature:
nvjpeg2kStatus_t nvjpeg2kStreamGetImageComponentInfo(nvjpeg2kStream_t stream_handle,
nvjpeg2kImageComponentInfo_t* component_info,
uint32_t component_id);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvjpeg2kStream_t stream_handle |
Input |
Host |
bitstream handle |
nvjpeg2kImageComponentInfo_t* component_info |
Input/Output |
Host |
Pointer to nvjpeg2kImageInfo_t |
uint32_t component_id |
Input |
Host |
Component index |
Returns:
nvjpeg2kStatus_t - An error code as specified in API Return Status Codes