48 #define VXLIB_HALF_SCALE_GAUSSIAN_NUMERIC_MIN(x) std::numeric_limits<x>::min()
49 #define VXLIB_HALF_SCALE_GAUSSIAN_NUMERIC_MAX(x) std::numeric_limits<x>::max()
57 template <
typename dTypeIn,
typename dTypeOut>
64 printf(
"Enter VXLIB_halfScaleGaussian_exec_cn\n");
71 size_t widthOut = pKerPrivArgs->
widthOut;
72 size_t heightOut = pKerPrivArgs->
heightOut;
80 bool isNotPadded = (padLeft == 0) && (padRight == 0) && (padTop == 0) && (padBottom == 0);
85 dTypeIn *restrict pInLocal = (dTypeIn *) pIn;
86 dTypeOut *restrict pOutLocal = (dTypeOut *) pOut;
89 printf(
"In VXLIB_halfScaleGaussian_exec_cn, width: %d, height: %d\n", width, height);
100 int16_t gaussianFilter5x5[5][5] = {
101 {1, 4, 6, 4, 1}, {4, 16, 24, 16, 4}, {6, 24, 36, 24, 6}, {4, 16, 24, 16, 4}, {1, 4, 6, 4, 1}};
103 for (y = 0; y < heightOut; y++) {
104 for (x = 0; x < widthOut; x++) {
108 for (j = 0; j < filterDim; j++) {
109 for (i = 0; i < filterDim; i++) {
110 sum += (pInLocal[((y * 2) + j) * strideInElements + ((x * 2) + i)]) * gaussianFilter5x5[j][i];
113 pOutLocal[y * strideOutElements + x] = (dTypeOut)((uint64_t)sum >> 8LLU);
139 void *restrict pOut);
VXLIB_STATUS VXLIB_halfScaleGaussian_exec_cn(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This function is the main execution function for the natural C implementation of the kernel....
template VXLIB_STATUS VXLIB_halfScaleGaussian_exec_cn< VXLIB_HALF_SCALE_GAUSSIAN_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_halfScaleGaussian...
#define VXLIB_HALF_SCALE_GAUSSIAN_FILTER_5x5
Macros for 5x5 filter dimension.
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
@ VXLIB_ERR_NOT_IMPLEMENTED
int32_t padLeft
Padding options
int8_t filterSize
Width and height of filter
Structure that is reserved for internal use by the kernel.
size_t widthOut
Width of output image
VXLIB_halfScaleGaussian_InitArgs pKerInitArgs
Initargs of the kernel.
size_t strideInElements
Stride of input in elements.
size_t strideOutElements
Stride of output in elements.
size_t heightOut
Height of output image