TI Autonomous Driving Algorithms (TIADALG) Library User Guide
sfm_ti_alg_int.h File Reference

This file defines the private functions for Feature Plane classification. More...

#include "c7x.h"
#include <./../common/tiadalg_alg_int_interface.h>
#include <./../common/tiadalg_common_utils.h>
#include "tiadalg_interface.h"
#include <math.h>
#include <float.h>
#include <string.h>
#include <./../common/profile.h>
#include "sfm_ti_device_utils.h"
#include "VLIB_triangulatePoints_types.h"

Go to the source code of this file.

Data Structures

struct  SFM_TI_Obj
 
struct  SFM_TI_trackInfo
 This structure defines the format in which SFM module expects a particular feature point's tracked location in image plane. More...
 
struct  sSFM_TI_EqSolvePrm
 Buffers required for equation solving (AtA * x = Atb) in triangulation Since total NUM_TRACKS_TOGATHER number of tracks are worked together hence for all the tracks these matrix are formed before calling the equation solve kernel. More...
 
struct  sSFM_TI_EqInitMat
 Place holder for initial data matrices. From this data matrix Pseudo AtA and Pseudo Atb matrices are formed. After forming Pseudo matrices this data is not used. More...
 
struct  sSFM_TI_PrunPrm
 3D pruning related parameters More...
 
union  uSFM_TI_MatData
 Triangulation related mutually exclusive scratch data. More...
 
struct  sSfm_TI_L1DMem
 L1D scratch memory definition. Base address of ever element in below structure is double word aligned if base address of the structure is double word aligned. More...
 
struct  sSfm_TI_L2DMem
 L2 scratch memory definition. Base address of every element in below structure is double word aligned if base address of the structure is double word aligned. More...
 
struct  sSfm_TI_ExtMem
 L1D scratch memory definition. Base address of ever element in below structure is double word aligned if base address of the structure is double word aligned. More...
 

Macros

#define MAX_NUM_IN_POINTS   (20000)
 
#define MAX_NUM_OUT_POINTS   MAX_NUM_IN_POINTS
 
#define CAM_EXT_PRM_BUF_DEPTH   (VLIB_TRIANG_MAX_POINTS_IN_TRACK)
 
#define MAX_3D_POINTS   (MAX_NUM_OUT_POINTS)
 
#define NUM_VECTORS_TOGATHER   (48)
 
#define NUM_TRACKS_TOGATHER   (NUM_VECTORS_TOGATHER * VLIB_TRIANG_NUM_TRACKS_IN_ONE_VECTOR)
 
#define L2_SCRATCH_BUF_SIZE   (448*1024)
 
#define DDR_SCRATCH_BUF_SIZE   (8*1024)
 
#define SIMD_WIDTH   (16)
 
#define TIADALG_DMA_CHANNEL_PING_PONG   ((int32_t) 0)
 
#define TIADALG_DMA_CHANNEL_CBCR_PING_PONG   ((int32_t) 1)
 
#define TIADALG_DMA_CHANNEL_MEMCPY_2   ((int32_t) 2)
 
#define TIADALG_DMA_CHANNEL_MEMCPY   ((int32_t) 3)
 
#define TIADALG_DMA_CHANNEL_MAX   ((int32_t) 4)
 
#define TIADALG_FLOW_CTRL_OPT_ONLY   (0)
 
#define TIADALG_FLOW_CTRL_REF_ONLY   (1)
 
#define TIADALG_FLOW_CTRL_NATC_ONLY   (2)
 
#define TIADALG_DOF_CONFIDENCE_TO_UINT8_SCALING   (17)
 
#define SE_PARAM_BASE   (0x0000)
 
#define SE0_PARAM_OFFSET   (SE_PARAM_BASE)
 
#define SE1_PARAM_OFFSET   (SE0_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define SE2_PARAM_OFFSET   (SE1_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define SE3_PARAM_OFFSET   (SE2_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define SE4_PARAM_OFFSET   (SE3_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define SE5_PARAM_OFFSET   (SE4_PARAM_OFFSET + SE_PARAM_SIZE)
 
#define MAX_NUM_STRM_TEMPLATE   (6)
 
#define SE_PARAM_WORDS   ((uint32_t)SE_PARAM_SIZE/sizeof(uint32_t))
 

Typedefs

typedef SFM_TI_ObjSFM_TI_Handle
 

Enumerations

enum  eMemrecs {
  ALG_HANDLE_MEMREC, ALG_HANDLE_INT_MEMREC, ALG_EXT_MEMREC, ALG_L3D_MEMREC,
  ALG_L2D_MEMREC, ALG_L1D_MEMREC, ALG_TRACK_MEMREC, ALG_TRACK_INT_MEMREC,
  NUM_MEMRECS, ALG_HANDLE_MEMREC, EL_ALG_BUFDESC_VOXEL_INFO_MEM, EL_ALG_BUFDESC_3D_POINTS_MEM,
  EL_ALG_BUFDESC_POINTS_DESC_MEM, EL_ALG_EXT_PERSIST_MEM, EL_ALG_EXT_SCRATCH_MEM, EL_ALG_L2_SCRATCH_MEM,
  NUM_MEMRECS
}
 Memory records for Feature Plane classification applet. More...
 
enum  eAlgState { ALG_NOT_ACTIVE, ALG_ACTIVE, ALG_NOT_ACTIVE, ALG_ACTIVE }
 State of Feature Plane computation applet. More...
 

Functions

int32_t SFM_TI_numAlloc (void)
 
int32_t SFM_TI_alloc (const IALG_Params *params, struct IALG_Fxns **parentFxns, IALG_MemRec *memRec)
 
int32_t SFM_TI_init (IALG_Handle handle, const IALG_MemRec *memRec, IALG_Handle parent, const IALG_Params *params)
 
void SFM_TI_activate (IALG_Handle handle)
 
void SFM_TI_deactivate (IALG_Handle handle)
 
int32_t SFM_TI_free (IALG_Handle handle, IALG_MemRec *memRec)
 
int32_t SFM_TI_control (IVISION_Handle handle, IALG_Cmd cmd, const IALG_Params *inParams, IALG_Params *outParams)
 
int32_t SFM_TI_process (IVISION_Handle handle, IVISION_InBufs *inBufs, IVISION_OutBufs *outBufs, IVISION_InArgs *inArgs, IVISION_OutArgs *outArgs)
 
void SFM_TI_updatePtrs (sSfm_TI_L1DMem *sfmL1Prm, sSfm_TI_L2DMem *sfmL2Prm, sSfm_TI_ExtMem *sfmPrm, SFM_TI_CreateParams *createParams)
 

Variables

TI_DSP_PrfInfoprfInfo
 

Detailed Description

This file defines the private functions for Feature Plane classification.

Author
Deepak Poddar
Version
0.1 (Sep 2014) : Base version.

Macro Definition Documentation

◆ MAX_NUM_IN_POINTS

#define MAX_NUM_IN_POINTS   (20000)

◆ MAX_NUM_OUT_POINTS

#define MAX_NUM_OUT_POINTS   MAX_NUM_IN_POINTS

◆ CAM_EXT_PRM_BUF_DEPTH

#define CAM_EXT_PRM_BUF_DEPTH   (VLIB_TRIANG_MAX_POINTS_IN_TRACK)

◆ MAX_3D_POINTS

#define MAX_3D_POINTS   (MAX_NUM_OUT_POINTS)

◆ NUM_VECTORS_TOGATHER

#define NUM_VECTORS_TOGATHER   (48)

◆ NUM_TRACKS_TOGATHER

#define NUM_TRACKS_TOGATHER   (NUM_VECTORS_TOGATHER * VLIB_TRIANG_NUM_TRACKS_IN_ONE_VECTOR)

◆ L2_SCRATCH_BUF_SIZE

#define L2_SCRATCH_BUF_SIZE   (448*1024)

◆ DDR_SCRATCH_BUF_SIZE

#define DDR_SCRATCH_BUF_SIZE   (8*1024)

◆ SIMD_WIDTH

#define SIMD_WIDTH   (16)

◆ TIADALG_DMA_CHANNEL_PING_PONG

#define TIADALG_DMA_CHANNEL_PING_PONG   ((int32_t) 0)

◆ TIADALG_DMA_CHANNEL_CBCR_PING_PONG

#define TIADALG_DMA_CHANNEL_CBCR_PING_PONG   ((int32_t) 1)

◆ TIADALG_DMA_CHANNEL_MEMCPY_2

#define TIADALG_DMA_CHANNEL_MEMCPY_2   ((int32_t) 2)

◆ TIADALG_DMA_CHANNEL_MEMCPY

#define TIADALG_DMA_CHANNEL_MEMCPY   ((int32_t) 3)

◆ TIADALG_DMA_CHANNEL_MAX

#define TIADALG_DMA_CHANNEL_MAX   ((int32_t) 4)

◆ TIADALG_FLOW_CTRL_OPT_ONLY

#define TIADALG_FLOW_CTRL_OPT_ONLY   (0)

◆ TIADALG_FLOW_CTRL_REF_ONLY

#define TIADALG_FLOW_CTRL_REF_ONLY   (1)

◆ TIADALG_FLOW_CTRL_NATC_ONLY

#define TIADALG_FLOW_CTRL_NATC_ONLY   (2)

◆ TIADALG_DOF_CONFIDENCE_TO_UINT8_SCALING

#define TIADALG_DOF_CONFIDENCE_TO_UINT8_SCALING   (17)

◆ SE_PARAM_BASE

#define SE_PARAM_BASE   (0x0000)

◆ SE0_PARAM_OFFSET

#define SE0_PARAM_OFFSET   (SE_PARAM_BASE)

◆ SE1_PARAM_OFFSET

#define SE1_PARAM_OFFSET   (SE0_PARAM_OFFSET + SE_PARAM_SIZE)

◆ SE2_PARAM_OFFSET

#define SE2_PARAM_OFFSET   (SE1_PARAM_OFFSET + SE_PARAM_SIZE)

◆ SE3_PARAM_OFFSET

#define SE3_PARAM_OFFSET   (SE2_PARAM_OFFSET + SE_PARAM_SIZE)

◆ SE4_PARAM_OFFSET

#define SE4_PARAM_OFFSET   (SE3_PARAM_OFFSET + SE_PARAM_SIZE)

◆ SE5_PARAM_OFFSET

#define SE5_PARAM_OFFSET   (SE4_PARAM_OFFSET + SE_PARAM_SIZE)

◆ MAX_NUM_STRM_TEMPLATE

#define MAX_NUM_STRM_TEMPLATE   (6)

◆ SE_PARAM_WORDS

#define SE_PARAM_WORDS   ((uint32_t)SE_PARAM_SIZE/sizeof(uint32_t))

Typedef Documentation

◆ SFM_TI_Handle

Enumeration Type Documentation

◆ eMemrecs

enum eMemrecs

Memory records for Feature Plane classification applet.

Memory records for alogirthm handle. Alg Handle should be first entry in this enum table as test app is expecting it to be first entry.

Enumerator
ALG_HANDLE_MEMREC 
ALG_HANDLE_INT_MEMREC 
ALG_EXT_MEMREC 
ALG_L3D_MEMREC 
ALG_L2D_MEMREC 
ALG_L1D_MEMREC 
ALG_TRACK_MEMREC 
ALG_TRACK_INT_MEMREC 
NUM_MEMRECS 
ALG_HANDLE_MEMREC 
EL_ALG_BUFDESC_VOXEL_INFO_MEM 
EL_ALG_BUFDESC_3D_POINTS_MEM 
EL_ALG_BUFDESC_POINTS_DESC_MEM 
EL_ALG_EXT_PERSIST_MEM 
EL_ALG_EXT_SCRATCH_MEM 
EL_ALG_L2_SCRATCH_MEM 
NUM_MEMRECS 

◆ eAlgState

enum eAlgState

State of Feature Plane computation applet.

State of EL algorithm.

Enumerator
ALG_NOT_ACTIVE 
ALG_ACTIVE 
ALG_NOT_ACTIVE 
ALG_ACTIVE 

Function Documentation

◆ SFM_TI_numAlloc()

int32_t SFM_TI_numAlloc ( void  )

◆ SFM_TI_alloc()

int32_t SFM_TI_alloc ( const IALG_Params *  params,
struct IALG_Fxns **  parentFxns,
IALG_MemRec *  memRec 
)

SFM_TI_alloc

Description:
Function to supply memory requirement to user refer algAlloc function for details in XADIS (ialg.h file)
Parameters
[in]paramsCreate time parameters (IALG_Params )
[in]parentFxnsIALG function pointers (IALG_Fxns )
[in]memRecIALG requested memory handle (IALG_MemRec )
Assumptions:
  • Not Any
Implementation Notes:
  • Not Any

◆ SFM_TI_init()

int32_t SFM_TI_init ( IALG_Handle  handle,
const IALG_MemRec *  memRec,
IALG_Handle  parent,
const IALG_Params *  params 
)

SFM_TI_init

Description:
Does initialization of algorithm at create time.
Parameters
[in]handleSFM Algorithm handle (IVISION_Handle )
[in]memRecIALG requested memory handle (IALG_MemRec )
[in]paramsCreate time parameters (IALG_Params )
Assumptions:
  • Not Any
Implementation Notes:
  • Not Any

◆ SFM_TI_activate()

void SFM_TI_activate ( IALG_Handle  handle)

SFM_TI_activate

Description:
Activation of the algorithm, like persistent memory copy back to internal memory etc. Currently not in use
Parameters
[in]handleAlgorithm Handle (IALG_Handle )
Assumptions:
  • Not Any
Implementation Notes:
  • Not Any

◆ SFM_TI_deactivate()

void SFM_TI_deactivate ( IALG_Handle  handle)

SFM_TI_activate

Description:
DEactivation of the algorithm, like persistent memory copy from internal memory to external memory. Currently not in use.
Parameters
[in]handleAlgorithm Handle (IALG_Handle )
Assumptions:
  • Not Any
Implementation Notes:
  • Not Any

◆ SFM_TI_free()

int32_t SFM_TI_free ( IALG_Handle  handle,
IALG_MemRec *  memRec 
)

SFM_TI_free

Description:
Releases all the memory requested for algorithm. Currently Not in use
Parameters
[in]handleAlgorithm Handle (IALG_Handle )
[in]memRecIALG memory request handle (IALG_MemRec )
Assumptions:
  • Not Any
Implementation Notes:
  • Not Any

◆ SFM_TI_control()

int32_t SFM_TI_control ( IVISION_Handle  handle,
IALG_Cmd  cmd,
const IALG_Params *  inParams,
IALG_Params *  outParams 
)

◆ SFM_TI_process()

int32_t SFM_TI_process ( IVISION_Handle  handle,
IVISION_InBufs *  inBufs,
IVISION_OutBufs *  outBufs,
IVISION_InArgs *  inArgs,
IVISION_OutArgs *  outArgs 
)

SFM_TI_process

Description:
This is the main processing API for SFM and should be called for each frame from application. Refer process function for details in ivision.h file.
Parameters
[in]handleSFM Algorithm handle (IVISION_Handle )
[in]inBufsInput Buffer to be processed (IVISION_InBufs )
[in]outBufsOutput Buffer to be filled up (IVISION_OutBufs)
[in]inArgsInput Arguments to control the behavior (IVISION_InArgs )
[in]outArgsGenerated discrete information (IVISION_OutArgs)
Assumptions:
  • Input buffer is not image buffer. Input buffer is set of objects of 'SFM_TI_trackInfo' placed in linear memory. inBufs :: bufDesc[SFM_TI_IN_BUFDESC_FEATURE_PLANE]:: bufPlanes[0] :: width should be greater than or equal to input tracks which is equal to inArgs :: numTracks
  • Output buffer also is not image buffer, it is set of objects of 'SFM_TI_output' placed in linear memory. Since number of output buffer is not known at the time of process call, hence out buf should be allocated assuming maximum possible number of output points. Maximum number of out 3D points can be equal to maxNumTracks*6. Hence user should set outBufs :: bufDesc [SFM_TI_OUT_BUFDESC_FEATURE_PLANES] :: bufPlanes[0] ::width greater than or equal to maxNumTracks*VLIB_TRIANG_MAX_POINTS_IN_TRACK. maxNumTracks was set at the time of create.
  • inArgs :: numTracks should be less than or equal to maxNumTracks provided at create time.
Implementation Notes:
  • There are two optimization flows have been implemented for this kernel. These two flow can be selected by:

◆ SFM_TI_updatePtrs()

void SFM_TI_updatePtrs ( sSfm_TI_L1DMem sfmL1Prm,
sSfm_TI_L2DMem sfmL2Prm,
sSfm_TI_ExtMem sfmPrm,
SFM_TI_CreateParams createParams 
)

Variable Documentation

◆ prfInfo

TI_DSP_PrfInfo* prfInfo

© Copyright 2018 Texas Instruments Incorporated. All rights reserved.
Document generated by doxygen 1.8.6