41 #include "VXLIB_types.h"
73 uint32_t dTypeIn = bufParamsIn->
data_type;
74 uint32_t widthIn = bufParamsIn->
dim_x;
75 uint32_t heightIn = bufParamsIn->
dim_y;
78 uint32_t dTypeOut = bufParamsOut->
data_type;
79 uint32_t widthOut = bufParamsOut->
dim_x;
80 uint32_t heightOut = bufParamsOut->
dim_y;
83 size_t padLeft = pKerInitArgs->
padLeft;
84 size_t padRight = pKerInitArgs->
padRight;
85 size_t padTop = pKerInitArgs->
padTop;
86 size_t padBottom = pKerInitArgs->
padBottom;
90 bool isNotPadded = (padLeft == 0) && (padRight == 0) && (padTop == 0) && (padBottom == 0);
106 else if (!isNotPadded) {
111 else if ((widthIn < widthOut) || (heightIn - filterDim + 1 != heightOut) || (strideInElements < widthIn) ||
112 (strideOutElements < widthOut) || (widthIn < filterDim) || (heightIn < filterDim)) {
135 printf(
"Enter VXLIB_box_exec_checkParams\n");
137 if ((handle == NULL) || (pIn == NULL) || (pOut == NULL)) {
174 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_box_init\n");
178 uint32_t dTypeIn = bufParamsIn->
data_type;
179 uint32_t dTypeOut = bufParamsOut->
data_type;
222 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_box_exec\n");
227 status = pKerPrivArgs->
execute(handle, pIn, pOut);
template VXLIB_STATUS VXLIB_box_init_ci< VXLIB_BOX_DTYPE_I8U_O8U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_box_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_box_exec_ci< VXLIB_BOX_TYPENAME_I8U_O8U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template VXLIB_STATUS VXLIB_box_exec_cn< VXLIB_BOX_TYPENAME_I8U_O8U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see VXLIB_box.
#define VXLIB_BOX_I8U_O8U
Macros that will be useful to check for datatype combinations.
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
@ VXLIB_ERR_NOT_IMPLEMENTED
@ VXLIB_ERR_INVALID_DIMENSION
static int32_t VXLIB_sizeof(uint32_t type)
Inline function returns number of bytes per element given a type of VXLIB_data_type_e.
VXLIB_STATUS VXLIB_box_init(VXLIB_kernelHandle handle, VXLIB_bufParams2D_t *bufParamsIn, VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_box_InitArgs *pKerInitArgs)
This function should be called before the VXLIB_box_exec function is called. This function takes care...
VXLIB_STATUS VXLIB_box_exec_checkParams(VXLIB_kernelHandle handle, const void *restrict pIn, const void *restrict pOut)
This function checks the validity of the parameters passed to VXLIB_box_exec function....
VXLIB_STATUS VXLIB_box_exec(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This function is the main kernel compute function.
VXLIB_STATUS VXLIB_box_init_checkParams(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_box_InitArgs *pKerInitArgs)
This function checks the validity of the parameters passed to VXLIB_box_init function....
int32_t VXLIB_box_getHandleSize(VXLIB_box_InitArgs *pKerInitArgs)
This is a query function to calculate the size of internal handle.
Structure containing the parameters to initialize the kernel.
int8_t filterSize
Width and height of filter
int32_t padLeft
Padding options
int8_t funcStyle
Variant of the function, refer to VXLIB_FUNCTION_STYLE
Structure that is reserved for internal use by the kernel.
size_t strideOutElements
Stride of output in elements.
size_t height
Height of image
VXLIB_box_InitArgs pKerInitArgs
Initargs of the kernel.
pFxnVXLIB_box_exec execute
Function pointer to point to the right execution variant between VXLIB_box_exec_cn and VXLIB_box_exec...
size_t strideInElements
Stride of input in elements.
size_t width
Width of image
A structure for a 2 dimensional buffer descriptor.
uint32_t dim_y
Height of buffer in Y dimension in elements.
uint32_t dim_x
Width of buffer in X dimension in elements.
uint32_t data_type
Values are of type VXLIB_data_type_e.
int32_t stride_y
Stride in Y dimension in bytes.