nvjpeg2kDecode()¶
Decodes a single image, and writes it to the output device buffers. The function is asynchronous with respect to the host.
All GPU tasks will be submitted to the provided stream. Prior to calling this function user must parse the bitstream
using nvjpeg2kStreamParse() such that the bitstream information is stored in jpeg2k_stream.
Signature:
nvjpeg2kStatus_t nvjpeg2kDecode(nvjpeg2kHandle_t handle,
nvjpeg2kDecodeState_t decode_state,
nvjpeg2kStream_t jpeg2k_stream,
nvjpeg2kImage_t* decode_output,
cudaStream_t stream);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvjpeg2kHandle_t handle |
Input |
Host |
library handle |
nvjpeg2kDecodeState_t decode_state |
Input |
Host |
decode state handle |
nvjpeg2kStream_t jpeg2k_stream |
Input |
Host |
nvjpeg2k bitstream handle |
nvjpeg2kImage_t* decode_output |
Input/Output |
Host |
Decode output struct. The struct should be on host memory. The image component pointers should point to device memory. See Image Data |
cudaStream_t stream |
Input |
Host |
Instance of cudaStream_t. Can be set to 0. |
Returns:
nvjpeg2kStatus_t - An error code as specified in API Return Status Codes
nvjpeg2kDecodeTile()¶
Decodes a tile within an image and writes it to the output device buffers. The function is asynchronous with respect to the host.
All GPU tasks will be submitted to the provided stream. Prior to calling this function user must parse the bitstream
using nvjpeg2kStreamParse() such that the bitstream information is stored in jpeg2k_stream.
Signature:
nvjpeg2kStatus_t nvjpeg2kDecodeTile(nvjpeg2kHandle_t handle,
nvjpeg2kDecodeState_t decode_state,
nvjpeg2kStream_t jpeg2k_stream,
nvjpeg2kDecodeParams_t decode_params,
uint32_t tile_id,
uint32_t num_res_levels,
nvjpeg2kImage_t* decode_output,
cudaStream_t stream);
Parameters:
Parameter |
Input/Output |
Memory |
Description |
|---|---|---|---|
nvjpeg2kHandle_t handle |
Input |
Host |
library handle |
nvjpeg2kDecodeState_t decode_state |
Input |
Host |
decode state handle |
nvjpeg2kStream_t jpeg2k_stream |
Input |
Host |
nvjpeg2k bitstream handle |
nvjpeg2kDecodeParams_t decode_params |
Input |
Host |
Used to control the decoded output (like specifying an area of interest) Can be set to NULL. |
uint32_t tile_id |
Input |
Host |
Raster scan based tile index |
uint32_t num_res_levels |
Input |
Host |
Number of Resolutions to be decoded within a tile, When set 0, image is decoded at full resolution Maximum allowed resolutions in a tile can be determined using nvjpeg2kStreamGetResolutionsInTile() |
nvjpeg2kImage_t* decode_output |
Input/Output |
Host |
Decode output struct. The struct should be on host memory. The image component pointers should point to device memory. See Image Data |
cudaStream_t stream |
Input |
Host |
Instance of cudaStream_t. Can be set to 0. |
Returns:
nvjpeg2kStatus_t - An error code as specified in API Return Status Codes