74 if ((handle == NULL) || (bufParamsIn == NULL) || (bufParamsMask == NULL) || (bufParamsOut == NULL) ||
75 (bufParamsScratch == NULL) || (pKerInitArgs == NULL)) {
82 uint32_t widthIn = bufParamsIn->
dim_x;
83 uint32_t heightIn = bufParamsIn->
dim_y;
84 uint32_t strideIn = bufParamsIn->
stride_y;
87 uint32_t widthMask = bufParamsMask->
dim_x;
88 uint32_t heightMask = bufParamsMask->
dim_y;
89 uint32_t strideMask = bufParamsMask->
stride_y;
92 uint32_t widthOut = bufParamsOut->
dim_x;
93 uint32_t heightOut = bufParamsOut->
dim_y;
94 uint32_t strideOut = bufParamsOut->
stride_y;
96 uint32_t strideInElements = strideIn /
VXLIB_sizeof(dType);
97 uint32_t strideMaskElements = strideMask /
VXLIB_sizeof(dType);
98 uint32_t strideOutElements = strideOut /
VXLIB_sizeof(dType);
100 if (strideInElements < widthIn || strideMaskElements < widthMask || strideOutElements < widthOut) {
106 else if ((widthOut != (widthIn - (widthMask - 1u))) || (heightOut != (heightIn - (heightMask - 1u)))) {
109 else if (heightMask < 1u || widthMask < 1u) {
112 else if (heightMask > 9u || widthMask > 9u) {
132 const void *restrict pIn,
133 const void *restrict pMask,
134 const void *restrict pOut,
135 const void *restrict pScratch)
140 printf(
"Enter VXLIB_median_exec_checkParams\n");
142 if ((handle == NULL) || (pIn == NULL) || (pMask == NULL) || (pOut == NULL) || (pScratch == NULL)) {
175 pKerPrivArgs->
M = bufParamsMask->
dim_y;
176 pKerPrivArgs->
N = bufParamsMask->
dim_x;
189 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_median_init\n");
224 bufParamsOut, bufParamsScratch, pKerInitArgs);
229 bufParamsOut, bufParamsScratch, pKerInitArgs);
234 bufParamsOut, bufParamsScratch, pKerInitArgs);
239 bufParamsOut, bufParamsScratch, pKerInitArgs);
249 bufParamsOut, bufParamsScratch, pKerInitArgs);
254 bufParamsOut, bufParamsScratch, pKerInitArgs);
259 bufParamsOut, bufParamsScratch, pKerInitArgs);
264 bufParamsOut, bufParamsScratch, pKerInitArgs);
284 void *restrict pMask,
286 void *restrict pScratch)
291 printf(
"VXLIB_DEBUGPRINT Enter VXLIB_median_exec\n");
296 status = pKerPrivArgs->
execute(handle, pIn, pMask, pOut, pScratch);
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
@ VXLIB_ERR_INVALID_DIMENSION
#define VXLIB_DEBUGPRINTFN(N, fmt,...)
static int32_t VXLIB_sizeof(uint32_t type)
Inline function returns number of bytes per element given a type of VXLIB_data_type_e.
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.