41 int16_t diff = (int16_t) A - (int16_t) B;
42 uint8_t out = (diff < 0) ? -diff : diff;
50 diff = (diff < 0) ? -diff : diff;
51 int16_t out = (diff > INT16_MAX) ? INT16_MAX : diff;
56 template <
typename dataType>
67 int32_t height = pKerPrivArgs->
height;
68 int32_t width = pKerPrivArgs->
width;
74 printf(
"Enter VXLIB_absDiff_exec_cn\n");
78 printf(
"VXLIB_absDiff_exec_cn: height = %d, width = %d\n", height, width);
81 const dataType *restrict A = (
const dataType *) pIn0;
82 const dataType *restrict B = (
const dataType *) pIn1;
83 dataType *restrict C = (dataType *) pOut;
85 for (m = 0; m < height; m++) {
86 for (n = 0; n < width; n++) {
102 void *restrict pOut);
VXLIB_STATUS VXLIB_absDiff_exec_cn(VXLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut)
This function is the main execution function for the natural C implementation of the kernel....
dataType VXLIB_absDiff_calc_cn(dataType A, dataType B)
int16_t VXLIB_absDiff_calc_cn< int16_t >(int16_t A, int16_t B)
template VXLIB_STATUS VXLIB_absDiff_exec_cn< int16_t >(VXLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut)
uint8_t VXLIB_absDiff_calc_cn< uint8_t >(uint8_t A, uint8_t B)
template VXLIB_STATUS VXLIB_absDiff_exec_cn< uint8_t >(VXLIB_kernelHandle handle, void *restrict pIn0, void *restrict pIn1, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see VXLIB_absDiff.
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
Structure that is reserved for internal use by the kernel.
uint32_t height
Height of image
uint32_t strideIn1Elements
Stride of input1 in elements.
uint32_t strideIn0Elements
Stride of input0 in elements.
uint32_t width
Width of image
uint32_t strideOutElements
Stride of output in elements.