NVIDIA DRIVE OS Linux SDK API Reference

5.1.9.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Image OpticalFlow/StereoDisparity (OFST) Estimator

Detailed Description

The NvMediaIOFST object takes an uncompressed image frame pair and turns them into opticalflow/stereodisparity estimation data.

Data Structures

struct  NvMediaIOFST
 Holds an OFST object created by NvMediaIOFSTCreate. More...
 
struct  NvMediaOFSTInitializeParams
 Holds OFST estimation initialization parameters. More...
 
struct  NvMediaOFSTExternalHintParams
 Holds OFST estimation parameters. More...
 

Macros

#define NVMEDIA_IOFST_VERSION_MAJOR   1
 Major version number. More...
 
#define NVMEDIA_IOFST_VERSION_MINOR   13
 Minor version number. More...
 

Enumerations

enum  NvMediaIOFSTType {
  NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_HP_MODE,
  NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_HP_MODE,
  NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_HQ_MODE,
  NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_HQ_MODE,
  NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_UHP_MODE,
  NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_UHP_MODE
}
 Defines the image estimation type. More...
 
enum  NvMediaOFSTConfigFeatures { NVMEDIA_OFST_CONFIG_ENABLE_PROFILING = (1 << 0) }
 Defines OFST estimation configuration features. More...
 

Functions

NvMediaStatus NvMediaIOFSTGetVersion (NvMediaVersion *version)
 Returns the version information for the NvMedia IOFST library. More...
 
NvMediaIOFSTNvMediaIOFSTCreate (const NvMediaDevice *device, NvMediaIOFSTType estimationType, NvMediaSurfaceType inputFormat, NvMediaSurfaceType outputFormat, const NvMediaOFSTInitializeParams *initParams, uint8_t maxInputBuffering, NvMediaEncoderInstanceId instanceId)
 Creates an OFST object that can create motion vectors based on the difference between two frames. More...
 
void NvMediaIOFSTDestroy (const NvMediaIOFST *ofst)
 Destroys an NvMediaIOFST object. More...
 
NvMediaStatus NvMediaIOFSTProcessFrame (const NvMediaIOFST *ofst, NvMediaImage *frame, NvMediaImage *refFrame, NvMediaImage *mvs, const NvMediaOFSTExternalHintParams *extHintParams, NvMediaEncoderInstanceId instanceId)
 Performs OFST estimation on a specified frame pair. More...
 
NvMediaStatus NvMediaIOFSTImageRegister (const NvMediaIOFST *ofst, const NvMediaImage *image, NvMediaAccessMode accessMode)
 Registers NvMediaImage for use with a NvMediaIOFST handle. More...
 
NvMediaStatus NvMediaIOFSTImageUnRegister (const NvMediaIOFST *ofst, const NvMediaImage *image)
 This API is not functional. More...
 

Macro Definition Documentation

#define NVMEDIA_IOFST_VERSION_MAJOR   1

Major version number.

Definition at line 37 of file nvmedia_iofst.h.

#define NVMEDIA_IOFST_VERSION_MINOR   13

Minor version number.

Definition at line 39 of file nvmedia_iofst.h.

Enumeration Type Documentation

Defines the image estimation type.

Enumerator
NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_HP_MODE 

High Performance OpticalFlow.

NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_HP_MODE 

High Performance StereoDisparity.

NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_HQ_MODE 

High Quality OpticalFlow.

NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_HQ_MODE 

High Quality StereoDisparity.

NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_UHP_MODE 

Ultra High Performance OpticalFlow.

NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_UHP_MODE 

Ultra High Performance StereoDisparity.

Definition at line 44 of file nvmedia_iofst.h.

Defines OFST estimation configuration features.

Enumerator
NVMEDIA_OFST_CONFIG_ENABLE_PROFILING 

Enables OFST profiling.

Definition at line 62 of file nvmedia_iofst.h.

Function Documentation

NvMediaIOFST* NvMediaIOFSTCreate ( const NvMediaDevice device,
NvMediaIOFSTType  estimationType,
NvMediaSurfaceType  inputFormat,
NvMediaSurfaceType  outputFormat,
const NvMediaOFSTInitializeParams initParams,
uint8_t  maxInputBuffering,
NvMediaEncoderInstanceId  instanceId 
)

Creates an OFST object that can create motion vectors based on the difference between two frames.

Parameters
[in]deviceA pointer to the NvMediaDevice this OFST is to use.
Range: Non-null - valid address
[in]estimationTypeOF/ST estimation type.
Range:
NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_HP_MODE
NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_HP_MODE
NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_HQ_MODE
NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_HQ_MODE
NVMEDIA_IMAGE_OPTICALFLOW_ESTIMATION_UHP_MODE
NVMEDIA_IMAGE_STEREODISPARITY_ESTIMATION_UHP_MODE
[in]inputFormatInput format.
Range: Input format returned by a call to NvMediaSurfaceFormatGetType() with:
NVM_SURF_FMT_SET_ATTR_YUV(attr, LUMA, NONE, PACKED, UINT, [8/10/16], BL)
NVM_SURF_FMT_SET_ATTR_YUV(attr, YUV, 420, SEMI_PLANAR, UINT, [8/10/12/16], BL)
NVM_SURF_FMT_SET_ATTR_YUV(attr, YUV, 444, SEMI_PLANAR, UINT, [8/10/12/16], BL)
[in]outputFormatOutput format.
Range: Obtained by a call to NvMediaSurfaceFormatGetType() with:
NVM_SURF_FMT_SET_ATTR_RGBA(attr, RG, INT, 16, BL)
NVM_SURF_FMT_SET_ATTR_RGBA(attr, ALPHA, INT, 16, BL)
[in]initParamsA pointer to a structure that specifies initialization parameters.
Range: Non-null - valid address. Ranges specific to each member in the structure can be found in NvMediaOFSTInitializeParams
[in]maxInputBufferingNumber of NvMediaIOFSTProcessFrame() operations that can be queued by the NvMediaIOFST. If more than maxInputBuffering operations are queued, NvMediaIOFSTProcessFrame() blocks until the excess operations are dequeued.
Range: 1-16 (steps of 1)
[in]instanceIdID of the encoder engine instance.
Range:
NVMEDIA_ENCODER_INSTANCE_0
NVMEDIA_ENCODER_INSTANCE_1
NVMEDIA_ENCODER_INSTANCE_AUTO [No support in Safety Build]
Returns
The new NvM OFST Estimator handle if successful, or NULL otherwise.
void NvMediaIOFSTDestroy ( const NvMediaIOFST ofst)

Destroys an NvMediaIOFST object.

Parameters
[in]ofstThe OFST object to destroy.
Range: Non-null – valid pointer address
NvMediaStatus NvMediaIOFSTGetVersion ( NvMediaVersion version)

Returns the version information for the NvMedia IOFST library.

Parameters
[out]version: A pointer to a NvMediaVersion structure filled by the IOFST library.
Returns
NvMediaStatus, the completion status of the operation: NVMEDIA_STATUS_OK if successful, or NVMEDIA_STATUS_BAD_PARAMETER if the pointer is invalid.
NvMediaStatus NvMediaIOFSTImageRegister ( const NvMediaIOFST ofst,
const NvMediaImage image,
NvMediaAccessMode  accessMode 
)

Registers NvMediaImage for use with a NvMediaIOFST handle.

NvMediaIOFST handle maintains a record of all the images registered using this API.

This is an optional API, skipping it will result in non-deterministic NvMediaIOFSTProcessFrame execution time.

For deterministic execution time of NvMediaIOFSTProcessFrame API :

Maximum of 32 NvMediaImage handles can be registered per access mode.

Parameters
[in]ofst: NvMedia IOFST device handle.
[in]image: A pointer to NvMedia image
[in]accessMode: NvMediaAccessMode required for the image
Returns
NvMediaStatus, the completion status of operation:

This API is not functional in current release. Calling this API will return NVMEDIA_STATUS_OK

NvMediaStatus NvMediaIOFSTImageUnRegister ( const NvMediaIOFST ofst,
const NvMediaImage image 
)

This API is not functional.

Calling this API will return NVMEDIA_STATUS_OK

Un-registers NvMediaImage which is registered with NvMediaIOFST using NvMediaIOFSTImageRegister.

For all NvMediaImage handles registered with NvMediaIOFST using NvMediaIOFSTImageRegister API, NvMediaIOFSTImageUnRegister must be called before calling NvMediaIOFSTDestroy API.

For deterministic execution of NvMediaIOFSTProcessFrame API, NvMediaIOFSTImageUnRegister must be called only after last NvMediaIOFSTProcessFrame call.

Parameters
[in]ofst: NvMedia IOFST device handle.
[in]image: A pointer to NvMedia image
Returns
NvMediaStatus, the completion status of operation:
NvMediaStatus NvMediaIOFSTProcessFrame ( const NvMediaIOFST ofst,
NvMediaImage frame,
NvMediaImage refFrame,
NvMediaImage mvs,
const NvMediaOFSTExternalHintParams extHintParams,
NvMediaEncoderInstanceId  instanceId 
)

Performs OFST estimation on a specified frame pair.

Estimation is based on the difference between refFrame and frame. The OFST produces motion vectors.

Parameters
[in]ofstA pointer to the OFSTestimator to use.
Range: Non-null – valid pointer address
[in]frameA pointer to current frame YUV data. It must be the same sourceType as ofst->inputformat.
Range: Non-null – valid pointer address
[in]refFrameA pointer to reference frame YUV data. It must be the same sourceType as ofst->inputformat.
Range: Non-null – valid pointer address
[in]mvsA pointer to a frame which contains motion vector output. It must be of the same sourceType as ofst->outputformat.
Range: Non-null – valid pointer address
[in]extHintParamsA pointer to a structure containing external hint parameters. It is used for ME hinting. Set it to NULL if ME hinting is not needed.External hint parameter is not supported in safety build.
Range: NULL to disable ME hints, Non-null valid pointer address to enable ME hints
[in]instanceIdThe ID of the encoder engine instance. In the case of non-safety builds, if NVMEDIA_ENCODER_INSTANCE_AUTO is used in the call to NvMediaVideoEncoderCreate(), the following instances are supported:
- NVMEDIA_ENCODER_INSTANCE_0
- NVMEDIA_ENCODER_INSTANCE_1
Otherwise an error is thrown.
Returns
The completion status of the operation: NVMEDIA_STATUS_OK if the call is successful, or NVMEDIA_STATUS_BAD_PARAMETER if any of the input parameters are invalid.