The LDC API encompasses all NvMedia LDC/TNR image processing related functionality.
6
Data Structures | |
struct | NvMediaLdcAttributes |
Attributes structure for NvMediaLdcCreate(). More... | |
struct | NvMediaLdcParametersAttributes |
Attributes that specify resources needed for NvMediaLdcParameters instance. More... | |
struct | NvMediaLdcResult |
Stores information returned from NvMediaLdcProcess(). More... | |
struct | NvMediaLdcRegionParameters |
Holds the NvMedia LDC region configuration. More... | |
struct | NvMediaLdcIptParameters |
Holds inverse perspective transformation configuration. More... | |
struct | NvMediaLdcControlPoint |
Represents a control point. More... | |
struct | NvMediaLdcWarpMapParameters |
Holds the NvMedia LDC definition of a Warp Map. More... | |
struct | NvMediaLdcMaskMapParameters |
Holds the Mask Map information. More... | |
struct | NvMediaLdcTnrParameters |
Holds the TNR3 initialization parameters. More... | |
struct | NvMediaLdcChecksum |
Represents a checksum. More... | |
Macros | |
#define | NVMEDIA_LDC_VERSION_MAJOR 10 |
Major version number of NvMedia LDC header. More... | |
#define | NVMEDIA_LDC_VERSION_MINOR 0 |
Minor version number of NvMedia LDC header. More... | |
#define | NVMEDIA_LDC_VERSION_PATCH 0 |
Patch version number of NvMedia LDC header. More... | |
#define | NVMEDIA_LDC_MAX_REGIONS_X 4u |
Maximum number of horizontal regions. More... | |
#define | NVMEDIA_LDC_MAX_REGIONS_Y 4u |
Maximum number of vertical regions. More... | |
#define | NVMEDIA_LDC_CHECKSUM_NUM_BYTES 24u |
Number of bytes in NvMedia LDC checksums. More... | |
Typedefs | |
typedef struct NvMediaLdc | NvMediaLdc |
NvMediaLdc context. More... | |
typedef uint32_t | NvMediaLdcParameters |
Stores configuration for the NvMediaLdcProcess() operation. More... | |
Enumerations | |
enum | NvMediaLdcFilter { NVMEDIA_LDC_FILTER_OFF, NVMEDIA_LDC_FILTER_LOW, NVMEDIA_LDC_FILTER_MEDIUM } |
VIC filter mode. More... | |
enum | NvMediaLdcChecksumMode { NVMEDIA_LDC_CHECKSUM_MODE_DISABLED, NVMEDIA_LDC_CHECKSUM_MODE_SRC_SURFACE } |
NvMedia LDC checksum mode. More... | |
Functions | |
NvMediaStatus | NvMediaLdcGetVersion (NvMediaVersion *const version) |
Returns the version number of the NvMedia LDC library. More... | |
NvMediaStatus | NvMediaLdcCreate (NvMediaLdc **const handle, NvMediaLdcAttributes const *const attr) |
Creates a new NvMediaLdc context. More... | |
NvMediaStatus | NvMediaLdcDestroy (NvMediaLdc *const handle) |
Destroys the NvMediaLdc context. More... | |
NvMediaStatus | NvMediaLdcCreateParameters (NvMediaLdc *const handle, NvMediaLdcParametersAttributes const *const attr, NvMediaLdcParameters *const params) |
Creates and returns an NvMediaLdcParameters instance. More... | |
NvMediaStatus | NvMediaLdcDestroyParameters (NvMediaLdc *const handle, NvMediaLdcParameters const params) |
Destroys an NvMediaLdcParameters instance. More... | |
NvMediaStatus | NvMediaLdcSetFilter (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaLdcFilter const filter) |
Sets the filter mode to use for LDC pixel interpolation. More... | |
NvMediaStatus | NvMediaLdcSetGeometry (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaRect const *const srcRect, NvMediaRect const *const dstRect) |
Sets source and destination rectangles for LDC operation. More... | |
NvMediaStatus | NvMediaLdcSetIptParameters (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaLdcIptParameters const *const iptParams) |
Sets parameters for LDC Inverse Perspective Transform (IPT) operation. More... | |
NvMediaStatus | NvMediaLdcSetWarpMapParameters (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaLdcWarpMapParameters const *const warpMapParams) |
Sets parameters for LDC Warp Map. More... | |
NvMediaStatus | NvMediaLdcSetMaskMapParameters (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaLdcMaskMapParameters const *const maskMapParams) |
Sets parameters for LDC Mask Map. More... | |
NvMediaStatus | NvMediaLdcSetTnrParameters (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaLdcTnrParameters const *const tnrParams) |
Sets Temporal Noise Reduction (TNR) parameters. More... | |
NvMediaStatus | NvMediaLdcResetTnr (NvMediaLdc *const handle, NvMediaLdcParameters const params) |
Resets TNR algorithm state. More... | |
NvMediaStatus | NvMediaLdcSetChecksumMode (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaLdcChecksumMode const checksumMode) |
Sets checksum calculation mode. More... | |
NvMediaStatus | NvMediaLdcGetChecksum (NvMediaLdc *const handle, NvMediaLdcResult const *const result, NvMediaLdcChecksum *const checksum) |
Gets a checksum calculated for an NvMediaLdcProcess() operation. More... | |
NvMediaStatus | NvMediaLdcProcess (NvMediaLdc *const handle, NvMediaLdcParameters const params, NvMediaLdcResult *const result) |
Performs LDC operation. More... | |
#define NVMEDIA_LDC_CHECKSUM_NUM_BYTES 24u |
Number of bytes in NvMedia LDC checksums.
Definition at line 611 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_MAX_REGIONS_X 4u |
Maximum number of horizontal regions.
Definition at line 243 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_MAX_REGIONS_Y 4u |
Maximum number of vertical regions.
Definition at line 246 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_VERSION_MAJOR 10 |
Major version number of NvMedia LDC header.
This defines the major version of the API defined in this header. This is intended to be used when validating the version number returned by the NvMediaLdcGetVersion() function.
Definition at line 48 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_VERSION_MINOR 0 |
Minor version number of NvMedia LDC header.
This defines the minor version of the API defined in this header. This is intended to be used when validating the version number returned by the NvMediaLdcGetVersion() function.
Definition at line 58 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_VERSION_PATCH 0 |
Patch version number of NvMedia LDC header.
This defines the patch version of the API defined in this header. This might be used to validate the version number returned by the NvMediaLdcGetVersion() function in case when the client needs a revision with a particular patch included.
Definition at line 69 of file nvmedia_ldc.h.
typedef struct NvMediaLdc NvMediaLdc |
NvMediaLdc context.
This type represents a context for the NvMediaLdc library. This context is an opaque data type that encapsulates the state needed to service the NvMediaLdc API calls.
Definition at line 79 of file nvmedia_ldc.h.
typedef uint32_t NvMediaLdcParameters |
Stores configuration for the NvMediaLdcProcess() operation.
This object stores the information needed to configure the LDC operation that is executed inside the NvMediaLdcProcess() function.
The underlying object cannot be instantiated directly by the client. Instead use the NvMediaLdcCreateParameters() function to create and retrieve a handle to an available instance with resources allocated in respect to used NvMediaLdcParametersAttributes. Use NvMediaLdcDestroyParameters() function to deallocate resources allocated by NvMediaLdcCreateParameters() and release an instance.
Value 0 is never a valid handle value, and can be used to initialize an NvMediaLdcParameters handle to a known value.
Definition at line 106 of file nvmedia_ldc.h.
NvMedia LDC checksum mode.
This enum describes the different checksum calculation modes that are supported by NvMedia LDC.
Enumerator | |
---|---|
NVMEDIA_LDC_CHECKSUM_MODE_DISABLED | No checksum calculated. This is the default behavior. |
NVMEDIA_LDC_CHECKSUM_MODE_SRC_SURFACE | Checksum calculated from source surface pixel data. |
Definition at line 625 of file nvmedia_ldc.h.
enum NvMediaLdcFilter |
VIC filter mode.
This enum describes the filter modes that are supported by NvMedia LDC.
Enumerator | |
---|---|
NVMEDIA_LDC_FILTER_OFF | Filtering is disabled. |
NVMEDIA_LDC_FILTER_LOW | Low quality filtering. |
NVMEDIA_LDC_FILTER_MEDIUM | Medium quality filtering. |
Definition at line 230 of file nvmedia_ldc.h.
NvMediaStatus NvMediaLdcCreate | ( | NvMediaLdc **const | handle, |
NvMediaLdcAttributes const *const | attr | ||
) |
Creates a new NvMediaLdc context.
This function creates a new instance of an NvMediaLdc context, and returns a pointer to that context. Ownership of this context is passed to the caller. When no longer in use, the caller must destroy the context using the NvMediaLdcDestroy() function.
Default attributes (when not specified by caller):
[out] | handle | Pointer to receive the handle to the new NvMediaLdc context. |
[in] | attr | Pointer to NvMediaLdcAttributes struct, or NULL for default attributes. |
NVMEDIA_STATUS_OK | Context created successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | handle is NULL, or attr has bad attribute values. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_NOT_SUPPORTED | NvMedia LDC is not supported on this hardware platform. |
NVMEDIA_STATUS_OUT_OF_MEMORY | Memory allocation failed for internal data structures or device memory buffers. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to create the context. |
Usage considerations
NvMediaStatus NvMediaLdcCreateParameters | ( | NvMediaLdc *const | handle, |
NvMediaLdcParametersAttributes const *const | attr, | ||
NvMediaLdcParameters *const | params | ||
) |
Creates and returns an NvMediaLdcParameters instance.
This functions returns a handle to an NvMediaLdcParameters object. The object will be initialised and ready to use. The attributes attr define resources preallocated per parameters instance. The parameters instance must be destroyed with NvMediaLdcDestroyParameters() during the De-Init stage.
The object will be initialised with these default values:
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | attr | Pointer to NvMediaLdcParametersAttributes. The pointer can be NULL, in which case TNR, Warp Map, and Mask Map mode will be disabled, and no memory resources will be pre-allocated. |
[out] | params | Pointer to an NvMediaLdcParameters, which will be populated with the handle. |
NVMEDIA_STATUS_OK | Parameters are created successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of parameters objects has been created. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_OUT_OF_MEMORY | Failed to allocate memory for the parameters. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to create the parameters object. |
Usage considerations
NvMediaStatus NvMediaLdcDestroy | ( | NvMediaLdc *const | handle | ) |
Destroys the NvMediaLdc context.
This function destroys the specified NvMediaLdc context.
Before calling this function, the caller must ensure:
[in] | handle | Pointer to the NvMediaLdc context. |
NVMEDIA_STATUS_OK | Context destroyed successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | handle is NULL. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_PENDING | There are still some NvSciSync or NvSciBuf objects registered against the NvMediaLdc context. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to destroy the context. The context is in state where the only valid operation is to attempt to destroy it again. |
Usage considerations
NvMediaStatus NvMediaLdcDestroyParameters | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params | ||
) |
Destroys an NvMediaLdcParameters instance.
This functions destroys an NvMediaLdcParameters object.
[in] | handle | Pointer to the NvMediaLdc context. |
[out] | params | An NvMediaLdcParameters handle. |
NVMEDIA_STATUS_OK | Parameters are destroyed successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value, either:
|
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_PENDING | The parameters object is still being used by a pending operation. The object is in state where the only valid operation is to attempt to destroy it again. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to destroy the parameters object. The object is in state where the only valid operation is to attempt to destroy it again. |
Usage considerations
NvMediaStatus NvMediaLdcGetChecksum | ( | NvMediaLdc *const | handle, |
NvMediaLdcResult const *const | result, | ||
NvMediaLdcChecksum *const | checksum | ||
) |
Gets a checksum calculated for an NvMediaLdcProcess() operation.
This function gets a checksum calculated for an NvMediaLdcProcess() operation. The operation must have had checksum calculation configured with NvMediaLdcSetChecksumMode().
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | result | Pointer to the NvMediaLdcResult object of the operation. |
[out] | checksum | Pointer to an NvMediaLdcChecksum object that will be populated with the checksum. |
NVMEDIA_STATUS_OK | Checksum returned successfully in checksum. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_NOT_SUPPORTED | Checksums are not supported on current platform. |
NVMEDIA_STATUS_PENDING | The operation is still pending. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to read the checksum. |
Usage considerations
NvMediaStatus NvMediaLdcGetVersion | ( | NvMediaVersion *const | version | ) |
Returns the version number of the NvMedia LDC library.
This function returns the major, minor, and patch version number of the NvMedia LDC library. The client must pass an NvMediaVersion struct to this function, and the version information will be returned in this struct.
This allows the client to verify that the version of the library matches and is compatible with the the version number of the header file they are using.
[out] | version | Pointer to an NvMediaVersion struct that will be populated with the version information. |
NVMEDIA_STATUS_OK | Version information returned successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | version is NULL. |
Usage considerations
NvMediaStatus NvMediaLdcProcess | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaLdcResult *const | result | ||
) |
Performs LDC operation.
LDC performs transformations depending on the parameters set:
LDC performs a geometric transformation if NvMediaLdcSetIptParameters() was called with proper IPT parameters or if NvMediaLdcSetWarpMapParameters() was called with proper Warp Map parameters. It fetches the pixels in the source image and renders onto the destination rectangle of the destination image. The source image and the destination image must have the same format. LDC bypasses the transform stage if no IPT or Warp Map parameters are set.
The region of interest in the destination image is defined by:
LDC outputs 4x4 downsampled xSobel output if NvMediaLdcSetDownsampledXSobelDstSurface() was called prior. The downsampled image must have the same bit depth as the source image.
In order to produce xSobel output, xSobel surface must be explicitly set prior to every NvMediaLdcProcess() call, just like all other surfaces. If xSobel surface is not explicitly set between NvMediaLdcProcess() calls, the xSobel output will be disabled. The same applies to downsampled xSobel.
Restrictions on dimensions for source and destination images:
Restrictions on the source rectangle:
Restrictions on the destination rectangle:
If any of the restrictions are violated, this function will fail with an error code.
Performance considerations:
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[out] | result | Pointer to NvMediaLdcResult struct that will be populated with result info. May be NULL. |
NVMEDIA_STATUS_OK | Operation submitted successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_NOT_SUPPORTED | Requested operation is not supported by current platform or some of the parameters combinations are not supported by the current implementation (see restrictions on parameters). |
NVMEDIA_STATUS_TIMED_OUT | No space available in the command buffer for this operation, because previous operations are still pending (see restrictions on concurrency). The caller should wait for the least recently submitted operation to complete and then try again. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to perform the LDC operation. This error indicates the system is potentially in an unrecoverable state. |
Usage considerations
NvMediaStatus NvMediaLdcResetTnr | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params | ||
) |
Resets TNR algorithm state.
This function resets NvMedia LDC internal TNR algorithm state. After a successful call to this function, the next frame submitted for TNR processing with NvMediaLdcProcess() will be treated by the algorithm as the first one and no previous surface needs to be set for it with NvMediaLdcSetPreviousSurface().
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
NVMEDIA_STATUS_OK | State reset successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetChecksumMode | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaLdcChecksumMode const | checksumMode | ||
) |
Sets checksum calculation mode.
This function configures the checksums to calculate for the NvMediaLdcProcess() operations performed using params.
NvMedia LDC maintains the checksums from 16 most recent NvMediaLdcProcess() operations that had the checksum calculation configured using this function. When more operations are performed, the oldest checksums are overwritten. The client must ensure the checksums are read with NvMediaLdcGetChecksum() before they are overwritten by subsequent operations.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | checksumMode | The checksum to calculate. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetFilter | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaLdcFilter const | filter | ||
) |
Sets the filter mode to use for LDC pixel interpolation.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | filter | An NvMediaLdcFilter to use when reading the the layer's source surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetGeometry | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaRect const *const | srcRect, | ||
NvMediaRect const *const | dstRect | ||
) |
Sets source and destination rectangles for LDC operation.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | srcRect | Pointer to an NvMediaRect that contains the source rectangle, or NULL for default rectangle. |
[in] | dstRect | Pointer to an NvMediaRect that contains the destination rectangle, or NULL for default rectangle. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetIptParameters | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaLdcIptParameters const *const | iptParams | ||
) |
Sets parameters for LDC Inverse Perspective Transform (IPT) operation.
This enables VIC geotrans processing in IPT mode. To disable IPT mode iptParams must be set to NULL.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | iptParams | Pointer to NvMediaLdcIptParameters. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetMaskMapParameters | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaLdcMaskMapParameters const *const | maskMapParams | ||
) |
Sets parameters for LDC Mask Map.
This enables VIC Mask Map feature. This feature can be used only if IPT or Warp Map mode is enabled. The map data accessed through maskMapParams is copied to NvMediaLdc internal data structures.
To disable the feature maskMapParams must be set to NULL.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | maskMapParams | Pointer to NvMediaLdcMaskMapParameters. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetTnrParameters | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaLdcTnrParameters const *const | tnrParams | ||
) |
Sets Temporal Noise Reduction (TNR) parameters.
This enables VIC TNR3 processing. To disable TNR3 tnrParams must set to NULL.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | tnrParams | Pointer to NvMediaLdcTnrParameters. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetWarpMapParameters | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvMediaLdcWarpMapParameters const *const | warpMapParams | ||
) |
Sets parameters for LDC Warp Map.
This enables VIC geotrans processing in Warp Map mode. The map data accessed through warpMapParams is copied to NvMediaLdc internal data structures.
To disable Warp Map mode warpMapParams must be set to NULL.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | warpMapParams | Pointer to NvMediaLdcWarpMapParameters. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations