TIOVX User Guide
TI VPAC LDC (Lens Distortion Correction) Kernel APIs

Detailed Description

VPAC Lens Distortion Correction Kernels.

Modules

 Enumerations
 Enumerations for configuration parameters in VPAC LDC structures.
 

Data Structures

struct  tivx_vpac_ldc_region_params_t
 The region_params data structure used by the TIVX_KERNEL_VPAC_LDC kernel. More...
 
struct  tivx_vpac_ldc_multi_region_params_t
 The alternative region_params data structure used by the TIVX_KERNEL_VPAC_LDC kernel. More...
 
struct  tivx_vpac_ldc_mesh_params_t
 The mesh data structure in the configuration data structure used by the TIVX_KERNEL_VPAC_LDC kernel. More...
 
struct  tivx_vpac_ldc_params_t
 The configuration data structure used by the TIVX_KERNEL_VPAC_LDC kernel. More...
 
struct  tivx_vpac_ldc_bandwidth_params_t
 The bandwidth params structure used by the TIVX_KERNEL_VPAC_LDC kernel. Passed as argument to TIVX_VPAC_LDC_CMD_SET_READ_BW_LIMIT_PARAMS command. More...
 
struct  tivx_vpac_ldc_bit_depth_conv_lut_params_t
 The remap params structure used by the TIVX_KERNEL_VPAC_LDC kernel. Passed as argument to TIVX_VPAC_LDC_CMD_SET_BIT_DEPTH_CONV_LUT_PARAMS command. Used to set Remap/Tone Map Lut in LDC. More...
 

Defines

#define TIVX_KERNEL_VPAC_LDC_NAME   "com.ti.hwa.vpac_ldc"
 vpac_ldc kernel name
 
#define TIVX_VPAC_LDC_CMD_SET_READ_BW_LIMIT_PARAMS   (0x10000000u)
 Control Command to set LDC Read Bandwidth limit parameters User data object tivx_vpac_ldc_bandwidth_params_t is passed as argument with this control command.
 
#define TIVX_VPAC_LDC_CMD_SET_BIT_DEPTH_CONV_LUT_PARAMS   (0x10000001u)
 Control Command to set LDC Lut parameters This LUT is used in bit depth conversion for output 2 & 3. An array of tivx_vpac_ldc_bit_depth_conv_lut_params_t is used an an argument to this command. Params at index-0 is used for setting Luma output (output2) and Params at index-1 is used for setting Chroma output (output3). Both entries are optional and can be null if no change is required.
 
#define TIVX_VPAC_LDC_CMD_GET_ERR_STATUS   (0x10000002u)
 Control Command to get the error status Returns the error status of the last processed frame. Reference to vx_scalar is passed as argument with this control command. Node returns bit-mask of error status in u32 variable of vx_scalar.
 
#define TIVX_VPAC_LDC_CMD_SET_LDC_PARAMS   (0x10000003u)
 Control Command to set the LDC Parameters. More...
 
#define TIVX_VPAC_LDC_CMD_SET_LDC_DCC_PARAMS   (0x30000000u)
 Control Command to set the DCC (Dynamic Camera Configuration) information to the given LDC Node. More...
 
#define TIVX_VPAC_LDC_CALC_MESH_LINE_OFFSET(width, subsample_factor)   ((((((width)/(subsample_factor))+1) + 15U) & ~15U) * (4U))
 Macro to calculate mesh line offset for the given width and down scaling factor.
 

Functions

void tivxRegisterHwaTargetVpacLdcKernels (void)
 Function to register HWA Kernels on the vpac_ldc Target.
 
void tivxUnRegisterHwaTargetVpacLdcKernels (void)
 Function to un-register HWA Kernels on the vpac_ldc Target.
 
VX_API_ENTRY vx_node VX_API_CALL tivxVpacLdcNode (vx_graph graph, vx_user_data_object configuration, vx_matrix warp_matrix, vx_user_data_object region_prms, vx_user_data_object mesh_prms, vx_image mesh_img, vx_user_data_object dcc_db, vx_image in_img, vx_image out0_img, vx_image out1_img)
 [Graph] Creates a VPAC_LDC Node. More...
 
void tivx_vpac_ldc_region_params_init (tivx_vpac_ldc_region_params_t *prms)
 Function to initialize LDC Region parameters. More...
 
void tivx_vpac_ldc_multi_region_params_init (tivx_vpac_ldc_multi_region_params_t *prms)
 Function to initialize LDC Multi Region parameters. More...
 
void tivx_vpac_ldc_mesh_params_init (tivx_vpac_ldc_mesh_params_t *prms)
 Function to initialize LDC Mesh parameters. More...
 
void tivx_vpac_ldc_bandwidth_params_init (tivx_vpac_ldc_bandwidth_params_t *prms)
 Function to initialize Bandwidth limiter parameters. More...
 
void tivx_vpac_ldc_params_init (tivx_vpac_ldc_params_t *prms)
 Function to initialize LDC parameters with the default values. More...
 

Macro Definition Documentation

◆ TIVX_VPAC_LDC_CMD_SET_LDC_PARAMS

#define TIVX_VPAC_LDC_CMD_SET_LDC_PARAMS   (0x10000003u)

Control Command to set the LDC Parameters.

This command takes an array of vx_references as an argument, where each index contains a reference to a parameter to update.

The following are the supported paramters: index 0 : vx_matrix reference for updating warp matrix.

Definition at line 130 of file hwa_vpac_ldc.h.

◆ TIVX_VPAC_LDC_CMD_SET_LDC_DCC_PARAMS

#define TIVX_VPAC_LDC_CMD_SET_LDC_DCC_PARAMS   (0x30000000u)

Control Command to set the DCC (Dynamic Camera Configuration) information to the given LDC Node.

Ldc node gets the pointer to DCC buffer containing LDC configuration. It uses DCC parser to parse and map DCC parameters into LDC configuration and sets it in the driver.

User data object containing DCC buffer is passed as argument with this control command.

The ID of this command must be the same as TIVX_VPAC_VISS_CMD_SET_DCC_PARAMS

Definition at line 147 of file hwa_vpac_ldc.h.

Function Documentation

◆ tivxVpacLdcNode()

VX_API_ENTRY vx_node VX_API_CALL tivxVpacLdcNode ( vx_graph  graph,
vx_user_data_object  configuration,
vx_matrix  warp_matrix,
vx_user_data_object  region_prms,
vx_user_data_object  mesh_prms,
vx_image  mesh_img,
vx_user_data_object  dcc_db,
vx_image  in_img,
vx_image  out0_img,
vx_image  out1_img 
)

[Graph] Creates a VPAC_LDC Node.

Valid input/output format combinations:

Input Format Output Format
VX_DF_IMAGE_U8 VX_DF_IMAGE_U8
TIVX_DF_IMAGE_P12
VX_DF_IMAGE_U16 VX_DF_IMAGE_U16
TIVX_DF_IMAGE_P12 TIVX_DF_IMAGE_P12
VX_DF_IMAGE_U8
VX_DF_IMAGE_NV12 VX_DF_IMAGE_NV12
TIVX_DF_IMAGE_NV12_P12
TIVX_DF_IMAGE_NV12_P12 TIVX_DF_IMAGE_NV12_P12
VX_DF_IMAGE_NV12
VX_DF_IMAGE_UYVY VX_DF_IMAGE_UYVY
VX_DF_IMAGE_YUYV
VX_DF_IMAGE_NV12
TIVX_DF_IMAGE_NV12_P12
Parameters
[in]graphThe reference to the graph.
[in]configurationThe input object of a single params structure of type tivx_vpac_ldc_params_t.
[in]warp_matrix(optional) Input warp_matrix of type vx_matrix for affine or perspective transform configuration. Must be 2x3 (affine) or 3x3 (perspective), and of type VX_TYPE_INT16 if using HW register values, or VX_TYPE_FLOAT32 if using matrix values defined in OpenVX warp functions ( vxWarpAffineNode, vxWarpPerspectiveNode).
[in]region_prms(optional) The input object of a single params structure of type tivx_vpac_ldc_region_params_t or tivx_vpac_ldc_multi_region_params_t. If set to null, default block size (TIVX_VPAC_LDC_DEF_BLOCK_WIDTH x TIVX_VPAC_LDC_DEF_BLOCK_HEIGHT) and pixel padding (TIVX_VPAC_LDC_DEF_PIXEL_PAD) is used.
[in]mesh_prms(optional) Mesh Configuration, the input object of type tivx_vpac_ldc_mesh_params_t. It is used to provide frame size and downsampling factor of mesh_img. If set to null, back mapping is disabled.
[in]mesh_img(optional) Mesh image containing mesh 2D coordinate offset lookup table. This can be a full remap table per output pixel, but is typically sub-sampled by a power of 2 as per tivx_vpac_ldc_mesh_params_t.subsample_factor to save memory footprint and bandwidth. The pitch/line offset for the mesh can be calculated using TIVX_VPAC_LDC_CALC_MESH_LINE_OFFSET. The coordinate offsets are of type S16Q3, and are stored as X,Y pairs of type VX_DF_IMAGE_U32.
  • 32bit encoding format (X,Y) is as follows:
    • Y offset (16 bit, 13bit signed integer, 3 bit fractional)
      • [2:0] Fractional is 3 bits (support 1/8th pixel of precision)
      • [15:3] Signed integer offset in verical direction
    • X offset (16 bit, 13bit signed integer, 3 bit fractional)
      • [18:16] Fractional is 3 bits (support 1/8th pixel of precision)
      • [31:19] Signed integer offset in horizontal direction If set to null, back mapping is disabled.
[in]dcc_db(optional) DCC tuning database for the given sensor vx_user_data_object
[in]in_imgThe input image in VX_DF_IMAGE_NV12, TIVX_DF_IMAGE_NV12_P12, VX_DF_IMAGE_UYVY, VX_DF_IMAGE_U8 (8bit Luma only), VX_DF_IMAGE_U16 (12bit in 16bit container Luma only), or TIVX_DF_IMAGE_P12 (12bit packed Luma only) format.
[out]out0_imgThe output image in VX_DF_IMAGE_NV12, TIVX_DF_IMAGE_NV12_P12, VX_DF_IMAGE_UYVY, VX_DF_IMAGE_YUYV, VX_DF_IMAGE_U8 (8bit Luma only), VX_DF_IMAGE_U16 (12bit in 16bit container Luma only), or TIVX_DF_IMAGE_P12 (12bit packed Luma only) format.
[out]out1_img(optional) The output image in VX_DF_IMAGE_NV12, VX_DF_IMAGE_UYVY, VX_DF_IMAGE_YUYV, VX_DF_IMAGE_U8 (8bit Luma only) format.
See also
TIVX_KERNEL_VPAC_LDC_NAME
Returns
vx_node.
Return values
vx_nodeA node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus

◆ tivx_vpac_ldc_region_params_init()

void tivx_vpac_ldc_region_params_init ( tivx_vpac_ldc_region_params_t prms)

Function to initialize LDC Region parameters.

Parameters
prms[IN] Pointer to LDC region parameter structure

◆ tivx_vpac_ldc_multi_region_params_init()

void tivx_vpac_ldc_multi_region_params_init ( tivx_vpac_ldc_multi_region_params_t prms)

Function to initialize LDC Multi Region parameters.

Parameters
prms[IN] Pointer to LDC multi region parameter structure

◆ tivx_vpac_ldc_mesh_params_init()

void tivx_vpac_ldc_mesh_params_init ( tivx_vpac_ldc_mesh_params_t prms)

Function to initialize LDC Mesh parameters.

Parameters
prms[IN] Pointer to LDC mesh parameter structure

◆ tivx_vpac_ldc_bandwidth_params_init()

void tivx_vpac_ldc_bandwidth_params_init ( tivx_vpac_ldc_bandwidth_params_t prms)

Function to initialize Bandwidth limiter parameters.

Parameters
prms[IN] Pointer to LDC bandwidth limiter parameter structure

◆ tivx_vpac_ldc_params_init()

void tivx_vpac_ldc_params_init ( tivx_vpac_ldc_params_t prms)

Function to initialize LDC parameters with the default values.

Parameters
prms[IN] Pointer to LDC parameter structure