C API

The nvImageCodec library and extension API.

Defines

NVIMGCODEC_MAX_CODEC_NAME_SIZE

NVIMGCODEC_MAX_CODEC_NAME_SIZE

Maximal size of codec name.

NVIMGCODEC_DEVICE_CURRENT

NVIMGCODEC_DEVICE_CURRENT

Defines device id as current device.

NVIMGCODEC_DEVICE_CPU_ONLY

NVIMGCODEC_DEVICE_CPU_ONLY

Defines device id as a CPU only.

NVIMGCODEC_MAX_NUM_DIM

NVIMGCODEC_MAX_NUM_DIM

Maximal number of dimensions.

NVIMGCODEC_MAX_NUM_PLANES

NVIMGCODEC_MAX_NUM_PLANES

Maximum number of image planes.

NVIMGCODEC_JPEG2K_MAXRES

NVIMGCODEC_JPEG2K_MAXRES

Maximum number of JPEG2000 resolutions.

Typedefs

nvimgcodecInstance_t

typedef struct nvimgcodecInstance *nvimgcodecInstance_t

Handle to opaque nvImageCodec library instance type.

nvimgcodecImage_t

typedef struct nvimgcodecImage *nvimgcodecImage_t

Handle to opaque Image type.

nvimgcodecCodeStream_t

typedef struct nvimgcodecCodeStream *nvimgcodecCodeStream_t

Handle to opaque Code Stream type.

nvimgcodecParser_t

typedef struct nvimgcodecParser *nvimgcodecParser_t

Handle to opaque Parser type.

nvimgcodecEncoder_t

typedef struct nvimgcodecEncoder *nvimgcodecEncoder_t

Handle to opaque Encoder type.

nvimgcodecDecoder_t

typedef struct nvimgcodecDecoder *nvimgcodecDecoder_t

Handle to opaque Decoder type.

nvimgcodecDebugMessenger_t

typedef struct nvimgcodecDebugMessenger *nvimgcodecDebugMessenger_t

Handle to opaque Debug Messenger type.

nvimgcodecExtension_t

typedef struct nvimgcodecExtension *nvimgcodecExtension_t

Handle to opaque Extension type.

nvimgcodecFuture_t

typedef struct nvimgcodecFuture *nvimgcodecFuture_t

Handle to opaque Future type.

nvimgcodecDeviceMalloc_t

typedef int (*nvimgcodecDeviceMalloc_t)(void *ctx, void **ptr, size_t size, cudaStream_t stream)

Function type for device memory resource allocation.

Param ctx:

[in] Pointer to user context.

Param ptr:

[in] Pointer where to write pointer to allocated memory.

Param size:

[in] How many bytes to allocate.

Param stream:

[in] CUDA stream

Return:

They will return 0 in case of success, and non-zero otherwise

nvimgcodecDeviceFree_t

typedef int (*nvimgcodecDeviceFree_t)(void *ctx, void *ptr, size_t size, cudaStream_t stream)

Function type for device memory deallocation.

Param ctx:

[in] Pointer to user context.

Param ptr:

[in] Pointer to memory buffer to be deallocated. If NULL, the operation must do nothing, successfully.

Param size:

[in] How many bytes was allocated (size passed during allocation).

Param stream:

[in] CUDA stream

Return:

They will return 0 in case of success, and non-zero otherwise

nvimgcodecPinnedMalloc_t

typedef int (*nvimgcodecPinnedMalloc_t)(void *ctx, void **ptr, size_t size, cudaStream_t stream)

Function type for host pinned memory resource allocation.

Param ctx:

[in] Pointer to user context.

Param ptr:

[in] Pointer where to write pointer to allocated memory.

Param size:

[in] How many bytes to allocate.

Param stream:

[in] CUDA stream

Return:

They will return 0 in case of success, and non-zero otherwise

nvimgcodecPinnedFree_t

typedef int (*nvimgcodecPinnedFree_t)(void *ctx, void *ptr, size_t size, cudaStream_t stream)

Function type for host pinned memory deallocation.

Param ctx:

[in] Pointer to user context.

Param ptr:

[in] Pointer to memory buffer to be deallocated. If NULL, the operation must do nothing, successfully.

Param size:

[in] How many bytes was allocated (size passed during allocation).

Param stream:

[in] CUDA stream

Return:

They will return 0 in case of success, and non-zero otherwise

nvimgcodecProcessingStatus_t

typedef uint32_t nvimgcodecProcessingStatus_t

Processing status type which combine processing status bitmasks.

nvimgcodecDebugCallback_t

typedef int (*nvimgcodecDebugCallback_t)(const nvimgcodecDebugMessageSeverity_t message_severity, const nvimgcodecDebugMessageCategory_t message_category, const nvimgcodecDebugMessageData_t *callback_data, void *user_data)

Debug callback function type.

Param message_severity:

[in] Message severity

Param message_category:

[in] Message category

Param callback_data:

[in] Debug message data

Param user_data:

[in] Pointer that was specified during the setup of the callback

Return:

1 if message should not be passed further to other callbacks and 0 otherwise

nvimgcodecLogFunc_t

typedef nvimgcodecStatus_t (*nvimgcodecLogFunc_t)(void *instance, const nvimgcodecDebugMessageSeverity_t message_severity, const nvimgcodecDebugMessageCategory_t message_category, const nvimgcodecDebugMessageData_t *data)

Pointer to logging function.

Param instance:

[in] Plugin framework instance pointer

Param message_severity:

[in] Message severity e.g. error or warning.

Param message_category:

[in] Message category e.g. general or performance related.

Param data:

[in] Debug message data i.e. message string, status, codec etc.

nvimgcodecExtensionModuleEntryFunc_t

typedef nvimgcodecStatus_t (*nvimgcodecExtensionModuleEntryFunc_t)(nvimgcodecExtensionDesc_t *ext_desc)

Extension module entry function type.

Param ext_desc:

[in/out] Points a nvimgcodecExtensionDesc_t handle in which the extension description is returned.

Return:

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

nvimgcodecResizeBufferFunc_t

typedef unsigned char *(*nvimgcodecResizeBufferFunc_t)(void *ctx, size_t req_size)

Function type to resize and provide host buffer.

Note

This function can be called multiple times and requested size can be lower at the end so buffer can be shrinked.

Param ctx:

[in] Pointer to context provided together with function.

Param req_size:

[in] Requested size of buffer.

Return:

Pointer to requested buffer.

Enums

nvimgcodecStructureType_t

enum nvimgcodecStructureType_t

Structure types supported by the nvImageCodec API.

Each value corresponds to a particular structure with a type member and matching structure name.

Values:

enumerator NVIMGCODEC_STRUCTURE_TYPE_PROPERTIES
enumerator NVIMGCODEC_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
enumerator NVIMGCODEC_STRUCTURE_TYPE_DEVICE_ALLOCATOR
enumerator NVIMGCODEC_STRUCTURE_TYPE_PINNED_ALLOCATOR
enumerator NVIMGCODEC_STRUCTURE_TYPE_DECODE_PARAMS
enumerator NVIMGCODEC_STRUCTURE_TYPE_ENCODE_PARAMS
enumerator NVIMGCODEC_STRUCTURE_TYPE_ORIENTATION
enumerator NVIMGCODEC_STRUCTURE_TYPE_REGION
enumerator NVIMGCODEC_STRUCTURE_TYPE_IMAGE_INFO
enumerator NVIMGCODEC_STRUCTURE_TYPE_IMAGE_PLANE_INFO
enumerator NVIMGCODEC_STRUCTURE_TYPE_JPEG_IMAGE_INFO
enumerator NVIMGCODEC_STRUCTURE_TYPE_JPEG_ENCODE_PARAMS
enumerator NVIMGCODEC_STRUCTURE_TYPE_JPEG2K_ENCODE_PARAMS
enumerator NVIMGCODEC_STRUCTURE_TYPE_BACKEND
enumerator NVIMGCODEC_STRUCTURE_TYPE_IO_STREAM_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_FRAMEWORK_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_DECODER_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_ENCODER_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_PARSER_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_IMAGE_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_CODE_STREAM_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_DEBUG_MESSENGER_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_DEBUG_MESSAGE_DATA
enumerator NVIMGCODEC_STRUCTURE_TYPE_EXTENSION_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_EXECUTOR_DESC
enumerator NVIMGCODEC_STRUCTURE_TYPE_BACKEND_PARAMS
enumerator NVIMGCODEC_STRUCTURE_TYPE_EXECUTION_PARAMS
enumerator NVIMGCODEC_STRUCTURE_TYPE_ENUM_FORCE_INT

nvimgcodecStatus_t

enum nvimgcodecStatus_t

The return status codes of the nvImageCodec API.

Values:

enumerator NVIMGCODEC_STATUS_SUCCESS
enumerator NVIMGCODEC_STATUS_NOT_INITIALIZED
enumerator NVIMGCODEC_STATUS_INVALID_PARAMETER
enumerator NVIMGCODEC_STATUS_BAD_CODESTREAM
enumerator NVIMGCODEC_STATUS_CODESTREAM_UNSUPPORTED
enumerator NVIMGCODEC_STATUS_ALLOCATOR_FAILURE
enumerator NVIMGCODEC_STATUS_EXECUTION_FAILED
enumerator NVIMGCODEC_STATUS_ARCH_MISMATCH
enumerator NVIMGCODEC_STATUS_INTERNAL_ERROR
enumerator NVIMGCODEC_STATUS_IMPLEMENTATION_UNSUPPORTED
enumerator NVIMGCODEC_STATUS_MISSED_DEPENDENCIES
enumerator NVIMGCODEC_STATUS_EXTENSION_NOT_INITIALIZED
enumerator NVIMGCODEC_STATUS_EXTENSION_INVALID_PARAMETER
enumerator NVIMGCODEC_STATUS_EXTENSION_BAD_CODE_STREAM
enumerator NVIMGCODEC_STATUS_EXTENSION_CODESTREAM_UNSUPPORTED
enumerator NVIMGCODEC_STATUS_EXTENSION_ALLOCATOR_FAILURE
enumerator NVIMGCODEC_STATUS_EXTENSION_ARCH_MISMATCH
enumerator NVIMGCODEC_STATUS_EXTENSION_INTERNAL_ERROR
enumerator NVIMGCODEC_STATUS_EXTENSION_IMPLEMENTATION_NOT_SUPPORTED
enumerator NVIMGCODEC_STATUS_EXTENSION_INCOMPLETE_BITSTREAM
enumerator NVIMGCODEC_STATUS_EXTENSION_EXECUTION_FAILED
enumerator NVIMGCODEC_STATUS_EXTENSION_CUDA_CALL_ERROR
enumerator NVIMGCODEC_STATUS_ENUM_FORCE_INT

nvimgcodecSampleDataType_t

enum nvimgcodecSampleDataType_t

Describes type sample of data.

Meaning of bits: 0 bit -> 0 - unsigned, 1- signed 1..7 bits -> define type 8..15 bits -> type bitdepth

Values:

enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_UNKNOWN
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_INT8
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_UINT8
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_INT16
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_UINT16
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_INT32
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_UINT32
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_INT64
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_UINT64
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_FLOAT16
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_FLOAT32
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_FLOAT64
enumerator NVIMGCODEC_SAMPLE_DATA_TYPE_UNSUPPORTED
enumerator NVIMGCODEC_SAMPLE_ENUM_FORCE_INT

nvimgcodecChromaSubsampling_t

enum nvimgcodecChromaSubsampling_t

Chroma subsampling.

Values:

enumerator NVIMGCODEC_SAMPLING_NONE
enumerator NVIMGCODEC_SAMPLING_444
enumerator NVIMGCODEC_SAMPLING_422
enumerator NVIMGCODEC_SAMPLING_420
enumerator NVIMGCODEC_SAMPLING_440
enumerator NVIMGCODEC_SAMPLING_411
enumerator NVIMGCODEC_SAMPLING_410
enumerator NVIMGCODEC_SAMPLING_GRAY
enumerator NVIMGCODEC_SAMPLING_410V
enumerator NVIMGCODEC_SAMPLING_UNSUPPORTED
enumerator NVIMGCODEC_SAMPLING_ENUM_FORCE_INT

nvimgcodecSampleFormat_t

enum nvimgcodecSampleFormat_t

Provides information how color components are matched to channels in given order and channels are matched to planes.

Values:

enumerator NVIMGCODEC_SAMPLEFORMAT_UNKNOWN
enumerator NVIMGCODEC_SAMPLEFORMAT_P_UNCHANGED
enumerator NVIMGCODEC_SAMPLEFORMAT_I_UNCHANGED
enumerator NVIMGCODEC_SAMPLEFORMAT_P_RGB
enumerator NVIMGCODEC_SAMPLEFORMAT_I_RGB
enumerator NVIMGCODEC_SAMPLEFORMAT_P_BGR
enumerator NVIMGCODEC_SAMPLEFORMAT_I_BGR
enumerator NVIMGCODEC_SAMPLEFORMAT_P_Y
enumerator NVIMGCODEC_SAMPLEFORMAT_P_YUV
enumerator NVIMGCODEC_SAMPLEFORMAT_UNSUPPORTED
enumerator NVIMGCODEC_SAMPLEFORMAT_ENUM_FORCE_INT

nvimgcodecColorSpec_t

enum nvimgcodecColorSpec_t

Defines color specification.

Values:

enumerator NVIMGCODEC_COLORSPEC_UNKNOWN
enumerator NVIMGCODEC_COLORSPEC_UNCHANGED
enumerator NVIMGCODEC_COLORSPEC_SRGB
enumerator NVIMGCODEC_COLORSPEC_GRAY
enumerator NVIMGCODEC_COLORSPEC_SYCC
enumerator NVIMGCODEC_COLORSPEC_CMYK
enumerator NVIMGCODEC_COLORSPEC_YCCK
enumerator NVIMGCODEC_COLORSPEC_UNSUPPORTED
enumerator NVIMGCODEC_COLORSPEC_ENUM_FORCE_INT

nvimgcodecImageBufferKind_t

enum nvimgcodecImageBufferKind_t

Defines buffer kind in which image data is stored.

Values:

enumerator NVIMGCODEC_IMAGE_BUFFER_KIND_UNKNOWN
enumerator NVIMGCODEC_IMAGE_BUFFER_KIND_STRIDED_DEVICE

GPU-accessible with planes in pitch-linear layout.

enumerator NVIMGCODEC_IMAGE_BUFFER_KIND_STRIDED_HOST

Host-accessible with planes in pitch-linear layout.

enumerator NVIMGCODEC_IMAGE_BUFFER_KIND_UNSUPPORTED
enumerator NVIMGCODEC_IMAGE_BUFFER_KIND_ENUM_FORCE_INT

nvimgcodecJpegEncoding_t

enum nvimgcodecJpegEncoding_t

JPEG Encoding.

Currently parseable JPEG encodings (SOF markers) https://www.w3.org/Graphics/JPEG/itu-t81.pdf Table B.1 Start of Frame markers

Values:

enumerator NVIMGCODEC_JPEG_ENCODING_UNKNOWN
enumerator NVIMGCODEC_JPEG_ENCODING_BASELINE_DCT
enumerator NVIMGCODEC_JPEG_ENCODING_EXTENDED_SEQUENTIAL_DCT_HUFFMAN
enumerator NVIMGCODEC_JPEG_ENCODING_PROGRESSIVE_DCT_HUFFMAN
enumerator NVIMGCODEC_JPEG_ENCODING_LOSSLESS_HUFFMAN
enumerator NVIMGCODEC_JPEG_ENCODING_DIFFERENTIAL_SEQUENTIAL_DCT_HUFFMAN
enumerator NVIMGCODEC_JPEG_ENCODING_DIFFERENTIAL_PROGRESSIVE_DCT_HUFFMAN
enumerator NVIMGCODEC_JPEG_ENCODING_DIFFERENTIAL_LOSSLESS_HUFFMAN
enumerator NVIMGCODEC_JPEG_ENCODING_RESERVED_FOR_JPEG_EXTENSIONS
enumerator NVIMGCODEC_JPEG_ENCODING_EXTENDED_SEQUENTIAL_DCT_ARITHMETIC
enumerator NVIMGCODEC_JPEG_ENCODING_PROGRESSIVE_DCT_ARITHMETIC
enumerator NVIMGCODEC_JPEG_ENCODING_LOSSLESS_ARITHMETIC
enumerator NVIMGCODEC_JPEG_ENCODING_DIFFERENTIAL_SEQUENTIAL_DCT_ARITHMETIC
enumerator NVIMGCODEC_JPEG_ENCODING_DIFFERENTIAL_PROGRESSIVE_DCT_ARITHMETIC
enumerator NVIMGCODEC_JPEG_ENCODING_DIFFERENTIAL_LOSSLESS_ARITHMETIC
enumerator NVIMGCODEC_JPEG_ENCODING_ENUM_FORCE_INT

nvimgcodecBackendKind_t

enum nvimgcodecBackendKind_t

Defines decoding/encoding backend kind.

Values:

enumerator NVIMGCODEC_BACKEND_KIND_CPU_ONLY

Decoding/encoding is executed only on CPU.

enumerator NVIMGCODEC_BACKEND_KIND_GPU_ONLY

Decoding/encoding is executed only on GPU.

enumerator NVIMGCODEC_BACKEND_KIND_HYBRID_CPU_GPU

Decoding/encoding is executed on both CPU and GPU.

enumerator NVIMGCODEC_BACKEND_KIND_HW_GPU_ONLY

Decoding/encoding is executed on GPU dedicated hardware engine.

nvimgcodecProcessingStatus

enum nvimgcodecProcessingStatus

Processing status bitmask for decoding or encoding .

Values:

enumerator NVIMGCODEC_PROCESSING_STATUS_UNKNOWN
enumerator NVIMGCODEC_PROCESSING_STATUS_SUCCESS

Processing finished with success.

enumerator NVIMGCODEC_PROCESSING_STATUS_SATURATED

Decoder/encoder could potentially process image but is saturated.

See also

nvimgcodecBackendParams_t load_hint.

enumerator NVIMGCODEC_PROCESSING_STATUS_FAIL

Processing failed because unknown reason.

enumerator NVIMGCODEC_PROCESSING_STATUS_IMAGE_CORRUPTED

Processing failed because compressed image stream is corrupted.

enumerator NVIMGCODEC_PROCESSING_STATUS_CODEC_UNSUPPORTED

Processing failed because codec is unsupported

enumerator NVIMGCODEC_PROCESSING_STATUS_BACKEND_UNSUPPORTED

Processing failed because no one from allowed backends is supported.

enumerator NVIMGCODEC_PROCESSING_STATUS_ENCODING_UNSUPPORTED

Processing failed because codec encoding is unsupported.

enumerator NVIMGCODEC_PROCESSING_STATUS_RESOLUTION_UNSUPPORTED

Processing failed because image resolution is unsupported.

enumerator NVIMGCODEC_PROCESSING_STATUS_CODESTREAM_UNSUPPORTED

Processing failed because some feature of compressed stream is unsupported

enumerator NVIMGCODEC_PROCESSING_STATUS_COLOR_SPEC_UNSUPPORTED

Color specification unsupported.

enumerator NVIMGCODEC_PROCESSING_STATUS_ORIENTATION_UNSUPPORTED

Apply orientation was enabled but it is unsupported.

enumerator NVIMGCODEC_PROCESSING_STATUS_ROI_UNSUPPORTED

Decoding region of interest is unsupported.

enumerator NVIMGCODEC_PROCESSING_STATUS_SAMPLING_UNSUPPORTED

Selected unsupported chroma subsampling .

enumerator NVIMGCODEC_PROCESSING_STATUS_SAMPLE_TYPE_UNSUPPORTED

Selected unsupported sample type.

enumerator NVIMGCODEC_PROCESSING_STATUS_SAMPLE_FORMAT_UNSUPPORTED

Selected unsupported sample format.

enumerator NVIMGCODEC_PROCESSING_STATUS_NUM_PLANES_UNSUPPORTED

Unsupported number of planes to decode/encode.

enumerator NVIMGCODEC_PROCESSING_STATUS_NUM_CHANNELS_UNSUPPORTED

Unsupported number of channels to decode/encode.

enumerator NVIMGCODEC_PROCESSING_STATUS_ENUM_FORCE_INT

nvimgcodecJpeg2kProgOrder_t

enum nvimgcodecJpeg2kProgOrder_t

Progression orders defined in the JPEG2000 standard.

Values:

enumerator NVIMGCODEC_JPEG2K_PROG_ORDER_LRCP
enumerator NVIMGCODEC_JPEG2K_PROG_ORDER_RLCP
enumerator NVIMGCODEC_JPEG2K_PROG_ORDER_RPCL
enumerator NVIMGCODEC_JPEG2K_PROG_ORDER_PCRL
enumerator NVIMGCODEC_JPEG2K_PROG_ORDER_CPRL
enumerator NVIMGCODEC_JPEG2K_PROG_ORDER_ENUM_FORCE_INT

nvimgcodecJpeg2kBitstreamType_t

enum nvimgcodecJpeg2kBitstreamType_t

JPEG2000 code stream type.

Values:

enumerator NVIMGCODEC_JPEG2K_STREAM_J2K

Corresponds to the JPEG2000 code stream.

enumerator NVIMGCODEC_JPEG2K_STREAM_JP2

Corresponds to the .jp2 container.

enumerator NVIMGCODEC_JPEG2K_STREAM_ENUM_FORCE_INT

nvimgcodecDebugMessageSeverity_t

enum nvimgcodecDebugMessageSeverity_t

Bitmask specifying which severities of events cause a debug messenger callback.

Values:

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_NONE
enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_TRACE

Diagnostic message useful for developers

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_DEBUG

Diagnostic message useful for developers

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_INFO

Informational message like the creation of a resource

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_WARNING

Message about behavior that is not necessarily an error, but very likely a bug in your application

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_ERROR

Message about behavior that is invalid and may cause improper execution or result of operation (e.g. can’t open file) but not application

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_FATAL

Message about behavior that is invalid and may cause crashes and forcing to shutdown application

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_ALL

Used in case filtering out by message severity

enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_DEFAULT
enumerator NVIMGCODEC_DEBUG_MESSAGE_SEVERITY_ENUM_FORCE_INT

nvimgcodecDebugMessageCategory_t

enum nvimgcodecDebugMessageCategory_t

Bitmask specifying which category of events cause a debug messenger callback.

Values:

enumerator NVIMGCODEC_DEBUG_MESSAGE_CATEGORY_NONE
enumerator NVIMGCODEC_DEBUG_MESSAGE_CATEGORY_GENERAL

Some event has happened that is unrelated to the specification or performance

enumerator NVIMGCODEC_DEBUG_MESSAGE_CATEGORY_VALIDATION

Something has happened that indicates a possible mistake

enumerator NVIMGCODEC_DEBUG_MESSAGE_CATEGORY_PERFORMANCE

Potential non-optimal use

enumerator NVIMGCODEC_DEBUG_MESSAGE_CATEGORY_ALL

Used in case filtering out by message category

enumerator NVIMGCODEC_DEBUG_MESSAGE_CATEGORY_ENUM_FORCE_INT

nvimgcodecPriority_t

enum nvimgcodecPriority_t

Defines decoder or encoder priority in codec.

For each codec there can be more decoders and encoders registered. Every decoder and encoder is registered with defined priority. Decoding process starts with selecting highest priority decoder and checks whether it can decode particular code stream. In case decoding could not be handled by selected decoder, there is fallback mechanism which selects next in priority decoder. There can be more decoders registered with the same priority. In such case decoders with the same priority are selected in order of registration.

Values:

enumerator NVIMGCODEC_PRIORITY_HIGHEST
enumerator NVIMGCODEC_PRIORITY_VERY_HIGH
enumerator NVIMGCODEC_PRIORITY_HIGH
enumerator NVIMGCODEC_PRIORITY_NORMAL
enumerator NVIMGCODEC_PRIORITY_LOW
enumerator NVIMGCODEC_PRIORITY_VERY_LOW
enumerator NVIMGCODEC_PRIORITY_LOWEST
enumerator NVIMGCODEC_PRIORITY_ENUM_FORCE_INT

Structures

nvimgcodecBackend_t

struct nvimgcodecBackend_t

Defines decoding/encoding backend.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

nvimgcodecBackendKind_t kind

Decoding/encoding backend kind.

nvimgcodecBackendParams_t params

Decoding/encoding backend parameters.

nvimgcodecBackendParams_t

struct nvimgcodecBackendParams_t

Defines decoding/encoding backend parameters.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

float load_hint

Fraction of the batch items that will be picked by this backend. The remaining items will be marked as “saturated” status and will be picked by the next backend. This is just a hint and a particular implementation can choose to ignore it.

nvimgcodecCodeStreamDesc_t

struct nvimgcodecCodeStreamDesc_t

Code stream description.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

Code stream description instance pointer which will be passed back in functions

nvimgcodecIoStreamDesc_t *io_stream

I/O stream which works as a source or sink of code stream bytes

nvimgcodecStatus_t (*getImageInfo)(void *instance, nvimgcodecImageInfo_t *image_info)

Retrieves image information.

Param instance:

[in] Pointer to nvimgcodecCodeStreamDesc_t instance.

Param image_info:

[in/out] Points where to return image information.

Return:

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

nvimgcodecDebugMessageData_t

struct nvimgcodecDebugMessageData_t

Describing debug message passed to debug callback function.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

const char *message

Null-terminated string detailing the trigger conditions

uint32_t internal_status_id

It is internal codec status id

const char *codec

Codec name if codec is rising message or NULL otherwise (e.g framework)

const char *codec_id

Codec id if codec is rising message or NULL otherwise

uint32_t codec_version

Codec version if codec is rising message or 0 otherwise

nvimgcodecDebugMessengerDesc_t

struct nvimgcodecDebugMessengerDesc_t

Debug messenger description.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

uint32_t message_severity

Bitmask of message severity to listen for e.g. error or warning.

uint32_t message_category

Bitmask of message category to listen for e.g. general or performance related.

nvimgcodecDebugCallback_t user_callback

Debug callback function

void *user_data

Pointer to user data which will be passed back to debug callback function.

nvimgcodecDecodeParams_t

struct nvimgcodecDecodeParams_t

Decode parameters.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

int apply_exif_orientation

Apply exif orientation if available. Valid values 0 or 1.

int enable_roi

Enables region of interest. Valid values 0 or 1.

nvimgcodecDecoderDesc_t

struct nvimgcodecDecoderDesc_t

Decoder description.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

Decoder description instance pointer which will be passed back in functions

const char *id

Codec named identifier e.g. nvJpeg2000

const char *codec

Codec name e.g. jpeg2000

nvimgcodecBackendKind_t backend_kind

Backend kind

nvimgcodecStatus_t (*create)(void *instance, nvimgcodecDecoder_t *decoder, const nvimgcodecExecutionParams_t *exec_params, const char *options)

Creates decoder.

Param instance:

[in] Pointer to nvimgcodecDecoderDesc_t instance.

Param encoder:

[in/out] Points where to return handle to created decoder.

Param exec_params:

[in] Points an execution parameters.

Param options:

[in] String with optional, space separated, list of parameters for decoders, in format “<encoder_id>:<parameter_name>=<parameter_value>”.

Return:

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

nvimgcodecStatus_t (*destroy)(nvimgcodecDecoder_t decoder)

Destroys decoder.

Param decoder:

[in] Decoder handle to destroy.

Return:

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

nvimgcodecStatus_t (*canDecode)(nvimgcodecDecoder_t decoder, nvimgcodecProcessingStatus_t *status, nvimgcodecCodeStreamDesc_t **code_streams, nvimgcodecImageDesc_t **images, int batch_size, const nvimgcodecDecodeParams_t *params)

Checks whether decoder can decode given batch of code streams to images with provided parameters.

Param decoder:

[in] Decoder handle to use for check.

Param status:

[in/out] Points to array of batch size and nvimgcodecProcessingStatus_t type, where result will be returned.

Param code_streams:

[in] Pointer to array of pointers of batch size with input code streams to check decoding.

Param images:

[in] Pointer to array of pointers of batch size with output images to check decoding.

Param batch_size:

[in] Number of items in batch to check.

Param params:

[in] Decode parameters which will be used with check.

Return:

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

nvimgcodecStatus_t (*decode)(nvimgcodecDecoder_t decoder, nvimgcodecCodeStreamDesc_t **code_streams, nvimgcodecImageDesc_t **images, int batch_size, const nvimgcodecDecodeParams_t *params)

Decode given batch of code streams to images with provided parameters.

Param encoder:

[in] Decoder handle to use for decoding.

Param code_streams:

[in] Pointer to array of pointers of batch size with input code streams.

Param images:

[in/out] Pointer to array of pointers of batch size with output images.

Param batch_size:

[in] Number of items in batch to encode.

Param params:

[in] Decode parameters.

Return:

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

nvimgcodecDeviceAllocator_t

struct nvimgcodecDeviceAllocator_t

Device memory allocator.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

nvimgcodecDeviceMalloc_t device_malloc

Allocate memory on the device.

nvimgcodecDeviceFree_t device_free

Frees memory on the device.

void *device_ctx

When invoking the allocators, this context will be pass as input to allocator functions.

size_t device_mem_padding

Any device memory allocation would be padded to the multiple of specified number of bytes

nvimgcodecEncodeParams_t

struct nvimgcodecEncodeParams_t

Encode parameters.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

float quality

Float value of quality which interpretation depends of particular codec.

For JPEG codec it is expected to be integer values between 1 and 100, where 100 is the highest quality. Default value is 70.

Warning

For JPEG2000 it is unsupported and target_psnr should be used instead.

float target_psnr

Float value of target PSNR (Peak Signal to Noise Ratio)

Warning

It is valid only for lossy encoding.

Warning

It not supported by all codec.

nvimgcodecEncoderDesc_t

struct nvimgcodecEncoderDesc_t

Encoder description.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

Encoder description instance pointer which will be passed back in functions

const char *id

Codec named identifier e.g. nvJpeg2000

const char *codec

Codec name e.g. jpeg2000

nvimgcodecBackendKind_t backend_kind

What kind of backend this encoder is using

nvimgcodecStatus_t (*create)(void *instance, nvimgcodecEncoder_t *encoder, const nvimgcodecExecutionParams_t *exec_params, const char *options)

Creates encoder.

Param instance:

[in] Pointer to nvimgcodecEncoderDesc_t instance.

Param encoder:

[in/out] Points where to return handle to created encoder.

Param exec_params:

[in] Points an execution parameters.

Param options:

[in] String with optional, space separated, list of parameters for encoders, in format “<encoder_id>:<parameter_name>=<parameter_value>”.

Return:

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

nvimgcodecStatus_t (*destroy)(nvimgcodecEncoder_t encoder)

Destroys encoder.

Param encoder:

[in] Encoder handle to destroy.

Return:

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

nvimgcodecStatus_t (*canEncode)(nvimgcodecEncoder_t encoder, nvimgcodecProcessingStatus_t *status, nvimgcodecImageDesc_t **images, nvimgcodecCodeStreamDesc_t **code_streams, int batch_size, const nvimgcodecEncodeParams_t *params)

Checks whether encoder can encode given batch of images to code stream and with provided parameters.

Param encoder:

[in] Encoder handle to use for check.

Param status:

[in/out] Points to array of batch size and nvimgcodecProcessingStatus_t type, where result will be returned.

Param images:

[in] Pointer to array of pointers of batch size with input images to check encoding.

Param code_streams:

[in/out] Pointer to array of pointers of batch size with output code streams to check encoding with.

Param batch_size:

[in] Number of items in batch to check.

Param params:

[in] Encode parameters which will be used with check.

Return:

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

nvimgcodecStatus_t (*encode)(nvimgcodecEncoder_t encoder, nvimgcodecImageDesc_t **images, nvimgcodecCodeStreamDesc_t **code_streams, int batch_size, const nvimgcodecEncodeParams_t *params)

Encode given batch of images to code streams with provided parameters.

Param encoder:

[in] Encoder handle to use for check.

Param images:

[in] Pointer to array of pointers of batch size with input images to encode.

Param code_streams:

[in/out] Pointer to array of pointers of batch size with ouput code streams.

Param batch_size:

[in] Number of items in batch to encode.

Param params:

[in] Encode parameters.

Return:

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

nvimgcodecExecutionParams_t

struct nvimgcodecExecutionParams_t

Execution parameters.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

nvimgcodecDeviceAllocator_t *device_allocator

Custom allocator for device memory

nvimgcodecPinnedAllocator_t *pinned_allocator

Custom allocator for pinned memory

int max_num_cpu_threads

Max number of CPU threads in default executor (0 means default value equal to number of cpu cores)

nvimgcodecExecutorDesc_t *executor

Points an executor. If NULL default executor will be used.

Note

At plugin level API it always points to executor, either custom or default.

int device_id

Device id to process decoding on. It can be also specified using defines NVIMGCODEC_DEVICE_CURRENT or NVIMGCODEC_DEVICE_CPU_ONLY.

int pre_init

If true, all relevant resources are initialized at creation of the instance

int num_backends

Number of allowed backends passed (if any) in backends parameter. For 0, all backends are allowed.

const nvimgcodecBackend_t *backends

Points a nvimgcodecBackend_t array with defined allowed backends. For nullptr, all backends are allowed.

nvimgcodecExecutorDesc_t

struct nvimgcodecExecutorDesc_t

Executor description.

Codec plugins can use executor available via execution parameters to schedule execution of asynchronous task.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

const void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

Executor instance pointer which will be passed back in functions

nvimgcodecStatus_t (*launch)(void *instance, int device_id, int sample_idx, void *task_context, void (*task)(int thread_id, int sample_idx, void *task_context))

Schedule execution of asynchronous task.

Param instance:

[in] Pointer to nvimgcodecExecutorDesc_t instance.

Param device_id:

[in] Device id on which task will be executed.

Param sample_idx:

[in] Index of batch sample to process task on; It will be passed back as an argument in task function.

Param task_context:

[in] Pointer to task context which will be passed back as an argument in task function.

Param task:

[in] Pointer to task function to schedule.

Return:

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

int (*getNumThreads)(void *instance)

Gets number of threads.

Param instance:

[in] Pointer to nvimgcodecExecutorDesc_t instance.

Return:

Number of threads in executor.

nvimgcodecExtensionDesc_t

struct nvimgcodecExtensionDesc_t

Extension description.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

Extension instance pointer which will be passed back in functions

const char *id

Extension named identifier e.g. nvjpeg_ext

uint32_t version

Extension version. Used when registering extension to check if there are newer.

uint32_t ext_api_version

The version of nvImageCodec extension API with which the extension was built.

nvimgcodecStatus_t (*create)(void *instance, nvimgcodecExtension_t *extension, const nvimgcodecFrameworkDesc_t *framework)

Creates extension.

Param instance:

[in] Pointer to nvimgcodecExtensionDesc_t instance.

Param extension:

[in/out] Points where to return handle to created extension.

Param framework:

[in] Pointer to framework description which can be use to register plugins.

Return:

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

nvimgcodecStatus_t (*destroy)(nvimgcodecExtension_t extension)

Destroys extension.

Param extension:

[in] Extension handle to destroy.

Return:

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

nvimgcodecFrameworkDesc_t

struct nvimgcodecFrameworkDesc_t

Plugin Framework.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

Plugin framework instance pointer which will be passed back in functions

const char *id

Plugin framework named identifier e.g. nvImageCodec

uint32_t version

Plugin framework version.

uint32_t ext_api_version

The nvImageCodec extension API version.

uint32_t cudart_version

The version of CUDA Runtime with which plugin framework was built.

nvimgcodecLogFunc_t log

Pointer to logging function.

nvimgcodecStatus_t (*registerEncoder)(void *instance, const nvimgcodecEncoderDesc_t *desc, float priority)

Registers encoder plugin.

Param instance:

[in] Pointer to nvimgcodecFrameworkDesc_t instance.

Param desc:

[in] Pointer to encoder description.

Param priority:

[in] Priority of encoder.

Return:

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

nvimgcodecStatus_t (*unregisterEncoder)(void *instance, const nvimgcodecEncoderDesc_t *desc)

Unregisters encoder plugin.

Param instance:

[in] Pointer to nvimgcodecFrameworkDesc_t instance.

Param desc:

[in] Pointer to encoder description to unregister.

Return:

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

nvimgcodecStatus_t (*registerDecoder)(void *instance, const nvimgcodecDecoderDesc_t *desc, float priority)

Registers decoder plugin.

Param instance:

[in] Pointer to nvimgcodecFrameworkDesc_t instance.

Param desc:

[in] Pointer to decoder description.

Param priority:

[in] Priority of decoder.

Return:

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

nvimgcodecStatus_t (*unregisterDecoder)(void *instance, const nvimgcodecDecoderDesc_t *desc)

Unregisters decoder plugin.

Param instance:

[in] Pointer to nvimgcodecFrameworkDesc_t instance.

Param desc:

[in] Pointer to decoder description to unregister.

Return:

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

nvimgcodecStatus_t (*registerParser)(void *instance, const nvimgcodecParserDesc_t *desc, float priority)

Registers parser plugin.

Param instance:

[in] Pointer to nvimgcodecFrameworkDesc_t instance.

Param desc:

[in] Pointer to parser description.

Param priority:

[in] Priority of decoder.

Return:

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

nvimgcodecStatus_t (*unregisterParser)(void *instance, const nvimgcodecParserDesc_t *desc)

Unregisters parser plugin.

Param instance:

[in] Pointer to nvimgcodecFrameworkDesc_t instance.

Param desc:

[in] Pointer to parser description to unregister.

Return:

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

nvimgcodecImageDesc_t

struct nvimgcodecImageDesc_t

Image description.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

Image instance pointer which will be passed back in functions

nvimgcodecStatus_t (*getImageInfo)(void *instance, nvimgcodecImageInfo_t *image_info)

Retrieves image info information.

Param instance:

[in] Pointer to nvimgcodecImageDesc_t instance.

Param image_info:

[in/out] Points where to return image information.

Return:

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

nvimgcodecStatus_t (*imageReady)(void *instance, nvimgcodecProcessingStatus_t processing_status)

Informs that host side of processing of image is ready.

Param instance:

[in] Pointer to nvimgcodecImageDesc_t instance.

Param processing_status:

[in] Processing status.

Return:

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

nvimgcodecImageInfo_t

struct nvimgcodecImageInfo_t

Defines information about an image.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

char codec_name[NVIMGCODEC_MAX_CODEC_NAME_SIZE]

Information about codec used. Only valid when used with code stream.

nvimgcodecColorSpec_t color_spec

Image color specification.

nvimgcodecChromaSubsampling_t chroma_subsampling

Image chroma subsampling. Only valid with chroma components.

nvimgcodecSampleFormat_t sample_format

Defines how color components are matched to channels in given order and channels are matched to planes.

nvimgcodecOrientation_t orientation

Image orientation.

nvimgcodecRegion_t region

Region of interest.

uint32_t num_planes

Number of image planes.

nvimgcodecImagePlaneInfo_t plane_info[NVIMGCODEC_MAX_NUM_PLANES]

Array with information about image planes.

void *buffer

Pointer to buffer in which image data is stored.

size_t buffer_size

Size of buffer in which image data is stored.

nvimgcodecImageBufferKind_t buffer_kind

Buffer kind in which image data is stored.

cudaStream_t cuda_stream

CUDA stream to synchronize with

nvimgcodecImagePlaneInfo_t

struct nvimgcodecImagePlaneInfo_t

Defines plane of an image.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

uint32_t width

Plane width. First plane defines width of image.

uint32_t height

Plane height. First plane defines height of image.

size_t row_stride

Number of bytes need to offset to next row of plane.

uint32_t num_channels

Number of channels. Color components, are always first but there can be more channels than color components.

nvimgcodecSampleDataType_t sample_type

Sample data type.

uint8_t precision

Value 0 means that precision is equal to sample type bitdepth

nvimgcodecInstanceCreateInfo_t

struct nvimgcodecInstanceCreateInfo_t

The nvImageCodec library instance create information structure.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

int load_builtin_modules

Load default modules. Valid values 0 or 1.

int load_extension_modules

Discover and load extension modules on start. Valid values 0 or 1.

const char *extension_modules_path

There may be several paths separated by ‘:’ on Linux or ‘;’ on Windows

int create_debug_messenger

Create debug messenger during instance creation. Valid values 0 or 1.

const nvimgcodecDebugMessengerDesc_t *debug_messenger_desc

Pointer to description to use when creating debug messenger. If NULL, default internal description will be used, together with following message_severity and message_category fields.

uint32_t message_severity

Severity for default debug messenger

uint32_t message_category

Message category for default debug messenger

nvimgcodecIoStreamDesc_t

struct nvimgcodecIoStreamDesc_t

Input/Output stream description.

This abstracts source or sink for code stream bytes.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

I/O stream description instance pointer which will be passed back in functions

nvimgcodecStatus_t (*read)(void *instance, size_t *output_size, void *buf, size_t bytes)

Reads all requested data from the stream.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param output_size:

[in/out] Pointer to where to return number of read bytes.

Param buf:

[in] Pointer to output buffer

Param bytes:

[in] Number of bytes to read

Return:

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

nvimgcodecStatus_t (*write)(void *instance, size_t *output_size, void *buf, size_t bytes)

Writes all requested data to the stream.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param output_size:

[in/out] Pointer to where to return number of written bytes.

Param buf:

[in] Pointer to input buffer

Param bytes:

[in] Number of bytes to write

Return:

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

nvimgcodecStatus_t (*putc)(void *instance, size_t *output_size, unsigned char ch)

Writes one character to the stream.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param output_size:

[in/out] Pointer to where to return number of written bytes.

Param ch:

[in] Character to write.

Return:

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

nvimgcodecStatus_t (*skip)(void *instance, size_t count)

Skips count objects in the stream.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param count:

[in] Number bytes to skip

Return:

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

nvimgcodecStatus_t (*seek)(void *instance, ptrdiff_t offset, int whence)

Moves the read pointer in the stream.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param offset:

[in] Offset to move.

Param whence:

[in] Beginning - SEEK_SET, SEEK_CUR or SEEK_END.

Return:

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

nvimgcodecStatus_t (*tell)(void *instance, ptrdiff_t *offset)

Retrieves current position, in bytes from the beginning, in the stream.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param offset:

[in/out] Pointer where to return current position.

Return:

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

nvimgcodecStatus_t (*size)(void *instance, size_t *size)

Retrieves the length, in bytes, of the stream.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param size:

[in/out] Pointer where to return length of the stream.

Return:

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

nvimgcodecStatus_t (*reserve)(void *instance, size_t bytes)

Provides expected bytes which are going to be written.

This function gives possibility to pre/re-allocate map function.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param bytes:

[in] Number of expected bytes which are going to be written.

Return:

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

nvimgcodecStatus_t (*flush)(void *instance)

Requests all data to be written to the output.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Return:

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

nvimgcodecStatus_t (*map)(void *instance, void **buffer, size_t offset, size_t size)

Maps data into host memory

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance.

Param buffer:

[in/out] Points where to return pointer to mapped data. If data cannot be mapped, NULL will be returned.

Param offset:

[in] Offset in the stream to begin mapping.

Param size:

[in] Length of the mapping

Return:

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

nvimgcodecStatus_t (*unmap)(void *instance, void *buffer, size_t size)

Unmaps previously mapped data.

Param instance:

[in] Pointer to nvimgcodecIoStreamDesc_t instance. *

Param buffer:

[in] Pointer to mapped data

Param size:

[in] Length of data to unmap

Return:

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

nvimgcodecJpeg2kEncodeParams_t

struct nvimgcodecJpeg2kEncodeParams_t

JPEG2000 Encode parameters.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

nvimgcodecJpeg2kBitstreamType_t stream_type

JPEG2000 code stream type.

nvimgcodecJpeg2kProgOrder_t prog_order

JPEG2000 progression order.

uint32_t num_resolutions

Number of resolutions.

uint32_t code_block_w

Code block width. Allowed values 32, 64

uint32_t code_block_h

Code block height. Allowed values 32, 64

int irreversible

Sets whether or not to use irreversible encoding. Valid values 0 or 1.

nvimgcodecJpegEncodeParams_t

struct nvimgcodecJpegEncodeParams_t

JPEG Encode parameters.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

int optimized_huffman

Sets whether or not to use optimized Huffman. Valid values 0 or 1.

Note

Using optimized Huffman produces smaller JPEG bitstream sizes with the same quality, but with slower performance.

nvimgcodecJpegImageInfo_t

struct nvimgcodecJpegImageInfo_t

Defines image information related to JPEG format.

This structure extends information provided in nvimgcodecImageInfo_t

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

nvimgcodecJpegEncoding_t encoding

JPEG encoding type.

nvimgcodecOrientation_t

struct nvimgcodecOrientation_t

Defines orientation of an image.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

int rotated

Rotation angle in degrees (clockwise). Only multiples of 90 are allowed.

int flip_x

Flip horizontal 0 or 1

int flip_y

Flip vertical 0 or 1

nvimgcodecParserDesc_t

struct nvimgcodecParserDesc_t

Parser description.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

void *instance

nvimgcodecStatus_t (size)(void instance, size_t* size); Parser description instance pointer which will be passed back in functions

const char *id

Codec named identifier e.g. nvJpeg2000

const char *codec

Codec name e.g. jpeg2000

nvimgcodecStatus_t (*canParse)(void *instance, int *result, nvimgcodecCodeStreamDesc_t *code_stream)

Checks whether parser can parse given code stream.

Param instance:

[in] Pointer to nvimgcodecParserDesc_t instance.

Param result:

[in/out] Points where to return result of parsing check. Valid values 0 or 1.

Param code_stream:

[in] Code stream to parse check.

Return:

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

nvimgcodecStatus_t (*create)(void *instance, nvimgcodecParser_t *parser)

Creates parser.

Param Pointer:

[in] to nvimgcodecParserDesc_t instance.

Param [in/out]:

Points where to return handle to created parser.

Return:

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

nvimgcodecStatus_t (*destroy)(nvimgcodecParser_t parser)

Destroys parser.

Param parser:

[in] Parser handle to destroy.

Return:

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

nvimgcodecStatus_t (*getImageInfo)(nvimgcodecParser_t parser, nvimgcodecImageInfo_t *image_info, nvimgcodecCodeStreamDesc_t *code_stream)

Parses given code stream and returns image information.

Param parser:

[in] Parser handle.

Param image_info:

[in/out] Points where to return image information.

Param code_stream:

[in] Code stream to parse.

Return:

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

nvimgcodecPinnedAllocator_t

struct nvimgcodecPinnedAllocator_t

Host pinned memory allocator.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

nvimgcodecPinnedMalloc_t pinned_malloc

Allocate host pinned memory: memory directly accessible by both CPU and cuda-enabled GPU.

nvimgcodecPinnedFree_t pinned_free

Frees host pinned memory.

void *pinned_ctx

When invoking the allocators, this context will be pass as input to allocator functions.

size_t pinned_mem_padding

Any pinned host memory allocation would be padded to the multiple of specified number of bytes

nvimgcodecProperties_t

struct nvimgcodecProperties_t

The nvImageCodec properties.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

uint32_t version

The nvImageCodec library version.

uint32_t ext_api_version

The nvImageCodec extension API version.

uint32_t cudart_version

The version of CUDA Runtime with which nvImageCodec library was built.

nvimgcodecRegion_t

struct nvimgcodecRegion_t

Defines region of an image.

Public Members

nvimgcodecStructureType_t struct_type

The type of the structure.

size_t struct_size

The size of the structure, in bytes.

void *struct_next

Is NULL or a pointer to an extension structure type.

int ndim

Number of dimensions, 0 value means no region.

int start[NVIMGCODEC_MAX_NUM_DIM]

Region start position at the particular dimension.

int end[NVIMGCODEC_MAX_NUM_DIM]

Region end position at the particular dimension.

Functions

nvimgcodecExtensionModuleEntry

nvimgcodecStatus_t nvimgcodecExtensionModuleEntry(nvimgcodecExtensionDesc_t *ext_desc)

Extension shared module exported entry function.

Parameters:

ext_desc – [in/out] Points a nvimgcodecExtensionDesc_t handle in which the extension description is returned.

Returns:

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

nvimgcodecGetProperties

nvimgcodecStatus_t nvimgcodecGetProperties(nvimgcodecProperties_t *properties)

Provides nvImageCodec library properties.

Parameters:

properties – [in/out] Points a nvimgcodecProperties_t handle in which the properties are returned.

Returns:

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

nvimgcodecInstanceCreate

nvimgcodecStatus_t nvimgcodecInstanceCreate(nvimgcodecInstance_t *instance, const nvimgcodecInstanceCreateInfo_t *create_info)

Creates an instance of the library using the input arguments.

Parameters:
  • instance – [in/out] Points a nvimgcodecInstance_t handle in which the resulting instance is returned.

  • create_info – [in] Pointer to a nvimgcodecInstanceCreateInfo_t structure controlling creation of the instance.

Returns:

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

nvimgcodecInstanceDestroy

nvimgcodecStatus_t nvimgcodecInstanceDestroy(nvimgcodecInstance_t instance)

Destroys the nvImageCodec library instance.

Parameters:

instance – [in] The library instance handle to destroy

Returns:

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

nvimgcodecExtensionCreate

nvimgcodecStatus_t nvimgcodecExtensionCreate(nvimgcodecInstance_t instance, nvimgcodecExtension_t *extension, nvimgcodecExtensionDesc_t *extension_desc)

Creates library extension.

Parameters:
  • instance – [in] The library instance handle the extension will be used with.

  • extension – [in/out] Points a nvimgcodecExtension_t handle in which the resulting extension is returned.

  • extension_desc – [in] Pointer to a nvimgcodecExtensionDesc_t structure which defines extension to create.

Returns:

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

nvimgcodecExtensionDestroy

nvimgcodecStatus_t nvimgcodecExtensionDestroy(nvimgcodecExtension_t extension)

Destroys library extension.

Parameters:

extension – [in] The extension handle to destroy

Returns:

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

nvimgcodecDebugMessengerCreate

nvimgcodecStatus_t nvimgcodecDebugMessengerCreate(nvimgcodecInstance_t instance, nvimgcodecDebugMessenger_t *dbg_messenger, const nvimgcodecDebugMessengerDesc_t *messenger_desc)

Creates a debug messenger.

Parameters:
  • instance – [in] The library instance handle the messenger will be used with.

  • dbg_messenger – [in/out] Points a nvimgcodecDebugMessenger_t handle in which the resulting debug messenger is returned.

  • messenger_desc – [in] Pointer to nvimgcodecDebugMessengerDesc_t structure which defines debug messenger to create.

Returns:

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

nvimgcodecDebugMessengerDestroy

nvimgcodecStatus_t nvimgcodecDebugMessengerDestroy(nvimgcodecDebugMessenger_t dbg_messenger)

Destroys debug messenger.

Parameters:

dbg_messenger – [in] The debug messenger handle to destroy

Returns:

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

nvimgcodecFutureWaitForAl

nvimgcodecStatus_t nvimgcodecFutureWaitForAll(nvimgcodecFuture_t future)

Waits for processing items to be finished.

See also

nvimgcodecImageInfo_t cuda_stream field.

Warning

Please note that when future is ready, it only means that all host work was done and it can be that some work was scheduled to be executed on device (depending on codec). To further synchronize work on device, there is cuda_stream field available in nvimgcodecImageInfo_t which can be used to specify cuda_stream to synchronize with.

Parameters:

future – [in] Handle to future object created by decode or encode functions.

Returns:

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

nvimgcodecFutureDestroy

nvimgcodecStatus_t nvimgcodecFutureDestroy(nvimgcodecFuture_t future)

Destroys future.

Parameters:

future – [in] The future handle to destroy

Returns:

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

nvimgcodecFutureGetProcessingStatus

nvimgcodecStatus_t nvimgcodecFutureGetProcessingStatus(nvimgcodecFuture_t future, nvimgcodecProcessingStatus_t *processing_status, size_t *size)

Receives processing statuses of batch items scheduled for decoding or encoding.

Parameters:
  • future – [in] The future handle returned by decode or encode function for given batch items.

  • processing_status – [in/out] Points a nvimgcodecProcessingStatus_t handle in which the processing statuses is returned.

  • size – [in/out] Points a size_t in which the size of processing statuses returned.

Returns:

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

nvimgcodecImageCreate

nvimgcodecStatus_t nvimgcodecImageCreate(nvimgcodecInstance_t instance, nvimgcodecImage_t *image, const nvimgcodecImageInfo_t *image_info)

Creates Image which wraps sample buffer together with format information.

Parameters:
  • instance – [in] The library instance handle the image will be used with.

  • image – [in/out] Points a nvimgcodecImage_t handle in which the resulting image is returned.

  • image_info – [in] Points a nvimgcodecImageInfo_t struct which describes sample buffer together with format.

Returns:

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

nvimgcodecImageDestroy

nvimgcodecStatus_t nvimgcodecImageDestroy(nvimgcodecImage_t image)

Destroys image.

Parameters:

image – [in] The image handle to destroy

Returns:

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

nvimgcodecImageGetImageInfo

nvimgcodecStatus_t nvimgcodecImageGetImageInfo(nvimgcodecImage_t image, nvimgcodecImageInfo_t *image_info)

Retrieves image information from provided opaque image object.

Parameters:
  • image – [in] The image handle to retrieve information from.

  • image_info – [in/out] Points a nvimgcodecImageInfo_t handle in which the image information is returned.

Returns:

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

nvimgcodecCodeStreamCreateFromFile

nvimgcodecStatus_t nvimgcodecCodeStreamCreateFromFile(nvimgcodecInstance_t instance, nvimgcodecCodeStream_t *code_stream, const char *file_name)

Creates code stream which wraps file source of compressed data.

Parameters:
  • instance – [in] The library instance handle the code stream will be used with.

  • code_stream – [in/out] Points a nvimgcodecCodeStream_t handle in which the resulting code stream is returned.

  • file_name – [in] File name with compressed image data to wrap.

Returns:

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

nvimgcodecCodeStreamCreateFromHostMem

nvimgcodecStatus_t nvimgcodecCodeStreamCreateFromHostMem(nvimgcodecInstance_t instance, nvimgcodecCodeStream_t *code_stream, const unsigned char *data, size_t length)

Creates code stream which wraps host memory source of compressed data.

Parameters:
  • instance – [in] The library instance handle the code stream will be used with.

  • code_stream – [in/out] Points a nvimgcodecCodeStream_t handle in which the resulting code stream is returned.

  • data – [in] Pointer to buffer with compressed data.

  • length – [in] Length of compressed data in provided buffer.

Returns:

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

nvimgcodecCodeStreamCreateToFile

nvimgcodecStatus_t nvimgcodecCodeStreamCreateToFile(nvimgcodecInstance_t instance, nvimgcodecCodeStream_t *code_stream, const char *file_name, const nvimgcodecImageInfo_t *image_info)

Creates code stream which wraps file sink for compressed data with given format.

Parameters:
  • instance – [in] The library instance handle the code stream will be used with.

  • code_stream – [in/out] Points a nvimgcodecCodeStream_t handle in which the resulting code stream is returned.

  • file_name – [in] File name sink for compressed image data to wrap.

  • image_info – [in] Points a nvimgcodecImageInfo_t struct which describes output image format.

Returns:

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

nvimgcodecCodeStreamCreateToHostMem

nvimgcodecStatus_t nvimgcodecCodeStreamCreateToHostMem(nvimgcodecInstance_t instance, nvimgcodecCodeStream_t *code_stream, void *ctx, nvimgcodecResizeBufferFunc_t resize_buffer_func, const nvimgcodecImageInfo_t *image_info)

Creates code stream which wraps host memory sink for compressed data with given format.

Parameters:
  • instance – [in] The library instance handle the code stream will be used with.

  • code_stream – [in/out] Points a nvimgcodecCodeStream_t handle in which the resulting code stream is returned.

  • ctx – [in] Pointer to user defined context with which get buffer function will be called back.

  • resize_buffer_func – [in] Points a nvimgcodecResizeBufferFunc_t function handle which will be used to resize and providing host output buffer.

  • image_info – [in] Points a nvimgcodecImageInfo_t struct which describes output image format.

Returns:

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

nvimgcodecCodeStreamDestroy

nvimgcodecStatus_t nvimgcodecCodeStreamDestroy(nvimgcodecCodeStream_t code_stream)

Destroys code stream.

Parameters:

code_stream – [in] The code stream handle to destroy

Returns:

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

nvimgcodecCodeStreamGetImageInfo

nvimgcodecStatus_t nvimgcodecCodeStreamGetImageInfo(nvimgcodecCodeStream_t code_stream, nvimgcodecImageInfo_t *image_info)

Retrieves compressed image information from code stream.

Parameters:
  • code_stream – [in] The code stream handle to retrieve information from.

  • image_info – [in/out] Points a nvimgcodecImageInfo_t handle in which the image information is returned.

Returns:

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

nvimgcodecDecoderCreate

nvimgcodecStatus_t nvimgcodecDecoderCreate(nvimgcodecInstance_t instance, nvimgcodecDecoder_t *decoder, const nvimgcodecExecutionParams_t *exec_params, const char *options)

Creates generic image decoder.

Parameters:
  • instance – [in] The library instance handle the decoder will be used with.

  • decoder – [in/out] Points a nvimgcodecDecoder_t handle in which the decoder is returned.

  • exec_params – [in] Points an execution parameters.

  • options – [in] String with optional space separated list of parameters for specific decoders in format “<decoder_id>:<parameter_name>=<parameter_value>”. For example “nvjpeg:fancy_upsampling=1”

Returns:

nvimgcodecStatus_t - An error code as specified in { API Return Status Codes }

nvimgcodecDecoderDestroy

nvimgcodecStatus_t nvimgcodecDecoderDestroy(nvimgcodecDecoder_t decoder)

Destroys decoder.

Parameters:

decoder – [in] The decoder handle to destroy

Returns:

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

nvimgcodecDecoderCanDecode

nvimgcodecStatus_t nvimgcodecDecoderCanDecode(nvimgcodecDecoder_t decoder, const nvimgcodecCodeStream_t *streams, const nvimgcodecImage_t *images, int batch_size, const nvimgcodecDecodeParams_t *params, nvimgcodecProcessingStatus_t *processing_status, int force_format)

Checks if decoder can decode provided code stream to given output images with specified parameters.

Parameters:
  • decoder – [in] The decoder handle to use for checks.

  • streams – [in] Pointer to input nvimgcodecCodeStream_t array to check decoding with.

  • images – [in] Pointer to output nvimgcodecImage_t array to check decoding with.

  • batch_size – [in] Batch size of provided code streams and images.

  • params – [in] Pointer to nvimgcodecDecodeParams_t struct to check decoding with.

  • processing_status – [in/out] Points a nvimgcodecProcessingStatus_t handle in which the processing statuses is returned.

  • force_format – [in] Valid values 0 or 1. If 1 value, and high priority codec does not support provided format it will fallback to lower priority codec for further checks. For 0 value, when high priority codec does not support provided format or parameters but it can process input in general, it will stop check and return processing status with flags which shows what format or parameters need to be changed to avoid fallback to lower priority codec.

Returns:

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

nvimgcodecDecoderDecode

nvimgcodecStatus_t nvimgcodecDecoderDecode(nvimgcodecDecoder_t decoder, const nvimgcodecCodeStream_t *streams, const nvimgcodecImage_t *images, int batch_size, const nvimgcodecDecodeParams_t *params, nvimgcodecFuture_t *future)

Decode batch of provided code streams to given output images with specified parameters.

Parameters:
  • decoder – [in] The decoder handle to use for decoding.

  • streams – [in] Pointer to input nvimgcodecCodeStream_t array to decode.

  • images – [in] Pointer to output nvimgcodecImage_t array to decode to.

  • batch_size – [in] Batch size of provided code streams and images.

  • params – [in] Pointer to nvimgcodecDecodeParams_t struct to decode with.

  • future – [in/out] Points a nvimgcodecFuture_t handle in which the future is returned. The future object can be used to waiting and getting processing statuses.

Returns:

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

nvimgcodecEncoderCreate

nvimgcodecStatus_t nvimgcodecEncoderCreate(nvimgcodecInstance_t instance, nvimgcodecEncoder_t *encoder, const nvimgcodecExecutionParams_t *exec_params, const char *options)

Creates generic image encoder.

Parameters:
  • instance – [in] The library instance handle the encoder will be used with.

  • encoder – [in/out] Points a nvimgcodecEncoder_t handle in which the decoder is returned.

  • exec_params – [in] Points an execution parameters.

  • options – [in] String with optional, space separated, list of parameters for specific encoders, in format “<encoder_id>:<parameter_name>=<parameter_value>.”

Returns:

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

nvimgcodecEncoderDestroy

nvimgcodecStatus_t nvimgcodecEncoderDestroy(nvimgcodecEncoder_t encoder)

Destroys encoder.

Parameters:

encoder – [in] The encoder handle to destroy

Returns:

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

nvimgcodecEncoderCanEncode

nvimgcodecStatus_t nvimgcodecEncoderCanEncode(nvimgcodecEncoder_t encoder, const nvimgcodecImage_t *images, const nvimgcodecCodeStream_t *streams, int batch_size, const nvimgcodecEncodeParams_t *params, nvimgcodecProcessingStatus_t *processing_status, int force_format)

Checks if encoder can encode provided images to given output code streams with specified parameters.

Parameters:
  • encoder – [in] The encoder handle to use for checks.

  • images – [in] Pointer to input nvimgcodecImage_t array to check encoding with.

  • streams – [in] Pointer to output nvimgcodecCodeStream_t array to check encoding with.

  • batch_size – [in] Batch size of provided code streams and images.

  • params – [in] Pointer to nvimgcodecEncodeParams_t struct to check decoding with.

  • processing_status – [in/out] Points a nvimgcodecProcessingStatus_t handle in which the processing statuses is returned.

  • force_format – [in] Valid values 0 or 1. If 1 value, and high priority codec does not support provided format it will fallback to lower priority codec for further checks. For 0 value, when high priority codec does not support provided format or parameters but it can process input in general, it will stop check and return processing status with flags which shows what format or parameters need to be changed to avoid fallback to lower priority codec.

Returns:

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

nvimgcodecEncoderEncode

nvimgcodecStatus_t nvimgcodecEncoderEncode(nvimgcodecEncoder_t encoder, const nvimgcodecImage_t *images, const nvimgcodecCodeStream_t *streams, int batch_size, const nvimgcodecEncodeParams_t *params, nvimgcodecFuture_t *future)

Encode batch of provided images to given output code streams with specified parameters.

Parameters:
  • encoder – [in] The encoder handle to use for encoding.

  • images – [in] Pointer to input nvimgcodecImage_t array to encode.

  • streams – [in] Pointer to output nvimgcodecCodeStream_t array to encode to.

  • batch_size – [in] Batch size of provided code streams and images.

  • params – [in] Pointer to nvimgcodecEncodeParams_t struct to encode with.

  • future – [in/out] Points a nvimgcodecFuture_t handle in which the future is returned. The future object can be used to waiting and getting processing statuses.

Returns:

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