The APIs under this category are used to initialize the decoding parameters as part of the nvjpeg2kDecodeParams_t handle. Once initialized, the handle can be passed as an input to nvjpeg2kDecodeTile()

nvjpeg2kDecodeParamsSetDecodeArea()

This function is used to set the decode area of interest. The coordinates are relative to the image origin and should be within the tile of interest. If the coordinates are set to 0, the entire tile will be decoded.

Signature:

nvjpeg2kStatus_t nvjpeg2kDecodeParamsSetDecodeArea(nvjpeg2kDecodeParams_t decode_params,
        uint32_t start_x,
        uint32_t end_x,
        uint32_t start_y,
        uint32_t end_y);

Parameters:

Parameter

Input/Output

Memory

Description

nvjpeg2kDecodeParams_t decode_params

Input/Output

Host

Decode output parameters handle

uint32_t start_x

Input

Host

Left coordinate of the decode area

uint32_t end_x

Input

Host

Right coordinate of the decode area

uint32_t start_y

Input

Host

Top coordinate of the decode area

uint32_t end_y

Input

Host

Bottom coordinate of the decode area

Returns:

nvjpeg2kStatus_t - An error code as specified in API Return Status Codes

nvjpeg2kDecodeParamsSetRGBOutput()

This function enables RGB decode output for images with 422/420 chroma subsampling. It is ignored for other chroma subsampling values. YCC to RGB conversion is based on sYCC, Amendment 1 to IEC 61966-2-1. The color conversion is applied at a tile granularity due to which the chroma reconstruction may not be accurate for tiles with odd dimensions.

Signature:

nvjpeg2kStatus_t nvjpeg2kDecodeParamsSetRGBOutput(nvjpeg2kDecodeParams_t decode_params,
        int32_t enable_RGB);

Parameters:

Parameter

Input/Output

Memory

Description

nvjpeg2kDecodeParams_t decode_params

Input/Output

Host

Decode output parameters handle

int32_t enable_RGB

Input

Host

Set to 1 to enable RGB output

Returns:

nvjpeg2kStatus_t - An error code as specified in API Return Status Codes