VXLIB User Guide
VXLIB_accumulateImage

Introduction

Kernel for adding the input image to the output image. This kernel has no internel implementation. Instead, it calls the VXLIB_add kernel implementation.

Performs addition between the input image and the output image and put the result to the output image. The overflow handling is controlled by an overflow-policy parameter VXLIB_OVERFLOW_POLICY. Use VXLIB_WRAP as the parameter for wrap and VXLIB_SATURATE for saturate. The following datatype combinations are supported:

Case Input Output
0 uint8_t uint8_t
1 uint8_t uint16_t
2 uint16_t uint16_t
Method
 dst(x,y) = src(x,y) + dst(x,y)

Data Structures

struct  VXLIB_accumulateImage_InitArgs
 Structure containing the parameters to initialize the kernel. More...
 

Functions

int32_t VXLIB_accumulateImage_getHandleSize (VXLIB_accumulateImage_InitArgs *pKerInitArgs)
 This is a query function to calculate the size of internal handle. More...
 
VXLIB_STATUS VXLIB_accumulateImage_init (VXLIB_kernelHandle handle, VXLIB_bufParams2D_t *bufParamsIn, VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_accumulateImage_InitArgs *pKerInitArgs)
 This function should be called before the VXLIB_accumulateImage_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine. The results of these operations are stored in the handle. More...
 
VXLIB_STATUS VXLIB_accumulateImage_init_checkParams (VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_accumulateImage_InitArgs *pKerInitArgs)
 This function checks the validity of the parameters passed to VXLIB_accumulateImage_init function. This function is called with the same parameters as the VXLIB_accumulateImage_init, and this function must be called before the VXLIB_accumulateImage_init is called. More...
 
VXLIB_STATUS VXLIB_accumulateImage_exec_checkParams (VXLIB_kernelHandle handle, const void *restrict pIn, const void *restrict pOut)
 This function checks the validity of the parameters passed to VXLIB_accumulateImage_exec function. This function is called with the same parameters as the VXLIB_accumulateImage_init, and this function must be called before the VXLIB_accumulateImage_init is called. More...
 
VXLIB_STATUS VXLIB_accumulateImage_exec (VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
 This function is the main kernel compute function. More...
 
void VXLIB_accumulateImage_perfEst (VXLIB_kernelHandle handle, size_t *archCycles, size_t *estCycles)
 

Function Documentation

◆ VXLIB_accumulateImage_getHandleSize()

int32_t VXLIB_accumulateImage_getHandleSize ( VXLIB_accumulateImage_InitArgs pKerInitArgs)

This is a query function to calculate the size of internal handle.

Parameters
[in]pKerInitArgs: Pointer to structure holding init parameters
Returns
Size of the buffer in bytes
Remarks
Application is expected to allocate buffer of the requested size and provide it as input to other functions requiring it.

Definition at line 53 of file VXLIB_accumulateImage.cpp.

◆ VXLIB_accumulateImage_init()

VXLIB_STATUS VXLIB_accumulateImage_init ( VXLIB_kernelHandle  handle,
VXLIB_bufParams2D_t bufParamsIn,
VXLIB_bufParams2D_t bufParamsOut,
const VXLIB_accumulateImage_InitArgs pKerInitArgs 
)

This function should be called before the VXLIB_accumulateImage_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine. The results of these operations are stored in the handle.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn: Pointer to the structure containing dimensional information of input image
[out]bufParamsOut: Pointer to the structure containing dimensional information of output image
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Remarks
Application is expected to provide a valid handle.

Definition at line 142 of file VXLIB_accumulateImage.cpp.

◆ VXLIB_accumulateImage_init_checkParams()

VXLIB_STATUS VXLIB_accumulateImage_init_checkParams ( VXLIB_kernelHandle  handle,
const VXLIB_bufParams2D_t bufParamsIn,
const VXLIB_bufParams2D_t bufParamsOut,
const VXLIB_accumulateImage_InitArgs pKerInitArgs 
)

This function checks the validity of the parameters passed to VXLIB_accumulateImage_init function. This function is called with the same parameters as the VXLIB_accumulateImage_init, and this function must be called before the VXLIB_accumulateImage_init is called.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsIn: Pointer to the structure containing dimensional information of input image
[out]bufParamsOut: Pointer to the structure containing dimensional information of output image
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Remarks
None

Definition at line 67 of file VXLIB_accumulateImage.cpp.

◆ VXLIB_accumulateImage_exec_checkParams()

VXLIB_STATUS VXLIB_accumulateImage_exec_checkParams ( VXLIB_kernelHandle  handle,
const void *restrict  pIn,
const void *restrict  pOut 
)

This function checks the validity of the parameters passed to VXLIB_accumulateImage_exec function. This function is called with the same parameters as the VXLIB_accumulateImage_init, and this function must be called before the VXLIB_accumulateImage_init is called.

Parameters
[in]handle: Active handle to the kernel
[in]pIn: Pointer to the structure input image
[out]pOut: Pointer to the output image
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Remarks
None

Definition at line 118 of file VXLIB_accumulateImage.cpp.

◆ VXLIB_accumulateImage_exec()

VXLIB_STATUS VXLIB_accumulateImage_exec ( VXLIB_kernelHandle  handle,
void *restrict  pIn,
void *restrict  pOut 
)

This function is the main kernel compute function.

Please refer to details under VXLIB_accumulateImage_exec

Parameters
[in]handle: Active handle to the kernel
[in]pIn: Pointer to the structure input image
[out]pOut: Pointer to the output image
Returns
Status value indicating success or failure. Refer to VXLIB_STATUS.
Assumptions:
  • None
Performance Considerations:
For best performance,
  • the input and output data buffers are expected to be in L2 memory
  • the buffer pointers are assumed to be 64-byte aligned
Remarks
Before calling this function, application is expected to call VXLIB_accumulateImage_init and VXLIB_accumulateImage_exec_checkParams functions. This ensures resource configuration and error checks are done only once for several invocations of this function.

Definition at line 223 of file VXLIB_accumulateImage.cpp.

◆ VXLIB_accumulateImage_perfEst()

void VXLIB_accumulateImage_perfEst ( VXLIB_kernelHandle  handle,
size_t *  archCycles,
size_t *  estCycles 
)

Definition at line 238 of file VXLIB_accumulateImage.cpp.