42 #include "VXLIB_types.h"
75 uint32_t dTypeIn = bufParamsIn->
data_type;
76 uint32_t widthIn = bufParamsIn->
dim_x;
77 uint32_t heightIn = bufParamsIn->
dim_y;
80 uint32_t dTypeFilter = bufParamsFilter->
data_type;
83 size_t scale = pKerInitArgs->
scale;
86 uint32_t dTypeOut = bufParamsOut->
data_type;
87 uint32_t widthOut = bufParamsOut->
dim_x;
88 uint32_t heightOut = bufParamsOut->
dim_y;
91 size_t padLeft = pKerInitArgs->
padLeft;
92 size_t padRight = pKerInitArgs->
padRight;
93 size_t padTop = pKerInitArgs->
padTop;
94 size_t padBottom = pKerInitArgs->
padBottom;
96 bool isNotPadded = (padLeft == 0) && (padRight == 0) && (padTop == 0) && (padBottom == 0);
102 if (handle == NULL) {
112 else if (scale > 31U) {
117 else if (!isNotPadded) {
122 else if ((widthIn < widthOut) || (heightIn - filterHeight + 1 != heightOut) || (strideInElements < widthIn) ||
123 (strideOutElements < widthOut) || (widthIn < filterWidth) || (heightIn < filterHeight)) {
143 const void *restrict pIn,
144 const void *restrict pFilter,
145 const void *restrict pOut)
150 printf(
"Enter VXLIB_convolve_exec_checkParams\n");
152 if ((handle == NULL) || (pIn == NULL) || (pFilter == NULL) || (pOut == NULL)) {
190 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_convolve_init\n");
194 uint32_t dTypeIn = bufParamsIn->
data_type;
195 uint32_t dTypeFilter = bufParamsFilter->
data_type;
196 uint32_t dTypeOut = bufParamsOut->
data_type;
221 bufParamsOut, pKerInitArgs);
227 bufParamsOut, pKerInitArgs);
252 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_convolve_exec\n");
257 status = pKerPrivArgs->
execute(handle, pIn, pFilter, pOut);
template VXLIB_STATUS VXLIB_convolve_exec_ci< VXLIB_CONVOLVE_TYPENAME_I8U_C16S_O16S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
template VXLIB_STATUS VXLIB_convolve_init_ci< VXLIB_CONVOLVE_DTYPE_I8U_C16S_O8U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsFilter, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_convolve_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_convolve_exec_ci< VXLIB_CONVOLVE_TYPENAME_I8U_C16S_O8U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
template VXLIB_STATUS VXLIB_convolve_init_ci< VXLIB_CONVOLVE_DTYPE_I8U_C16S_O16S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsFilter, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_convolve_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_convolve_exec_cn< VXLIB_CONVOLVE_TYPENAME_I8U_C16S_O8U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
template VXLIB_STATUS VXLIB_convolve_exec_cn< VXLIB_CONVOLVE_TYPENAME_I8U_C16S_O16S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see VXLIB_convolve.
#define VXLIB_CONVOLVE_I8U_C16S_O16S
#define VXLIB_CONVOLVE_I8U_C16S_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_CONVOLVE_INVALID_SHIFT
@ VXLIB_ERR_CONVOLVE_INVALID_DIMENSION
@ VXLIB_ERR_CONVOLVE_INVALID_TYPE_COMBINATION
@ VXLIB_ERR_CONVOLVE_PADDED_NOT_IMPLEMENTED
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_convolve_exec_checkParams(VXLIB_kernelHandle handle, const void *restrict pIn, const void *restrict pFilter, const void *restrict pOut)
This function checks the validity of the parameters passed to VXLIB_convolve_exec function....
VXLIB_STATUS VXLIB_convolve_init(VXLIB_kernelHandle handle, VXLIB_bufParams2D_t *bufParamsIn, VXLIB_bufParams2D_t *bufParamsFilter, VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_convolve_InitArgs *pKerInitArgs)
This function should be called before the VXLIB_convolve_exec function is called. This function takes...
VXLIB_STATUS VXLIB_convolve_exec(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
This function is the main kernel compute function.
VXLIB_STATUS VXLIB_convolve_init_checkParams(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsFilter, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_convolve_InitArgs *pKerInitArgs)
This function checks the validity of the parameters passed to VXLIB_convolve_init function....
int32_t VXLIB_convolve_getHandleSize(VXLIB_convolve_InitArgs *pKerInitArgs)
This is a query function to calculate the size of internal handle.
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.
Structure containing the parameters to initialize the kernel.
int32_t padLeft
Padding options
int32_t filterWidth
filter columns
int32_t filterHeight
filter rows
uint32_t scale
scale factor
int8_t funcStyle
Variant of the function, refer to VXLIB_FUNCTION_STYLE
Structure that is reserved for internal use by the kernel.
VXLIB_convolve_InitArgs pKerInitArgs
Initargs of the kernel.
pFxnVXLIB_convolve_exec execute
Function pointer to point to the right execution variant between VXLIB_convolve_exec_cn and VXLIB_con...
size_t width
Width of image
size_t strideInElements
Stride of input in elements.
size_t strideOutElements
Stride of output in elements.
size_t height
Height of image