IMG_corr_3x3_i16_c16


Detailed Description


Functions

void IMG_corr_3x3_i16_c16 (const unsigned short *imgin_ptr, unsigned int *restrict imgout_ptr, const unsigned short *mask_ptr, short pitch, short width)


Function Documentation

void IMG_corr_3x3_i16_c16 ( const unsigned short *  imgin_ptr,
unsigned int *restrict  imgout_ptr,
const unsigned short *  mask_ptr,
short  pitch,
short  width 
)

Description:
The convolution kernel accepts three rows of 'pitch' input pixels and produces one row of 'width' output pixels using the 3 pixel square filter mask provided on input.
The correlation sum is calculated as a point by point multiplication of the 3x3 mask with the input image. The 9 resulting multiplications are summed together to produce a 40-bit intermediate sum. This sum is used to produce the 32-bit output value that is subsequently stored in the output array. Overflow and saturation of the accumulated sum are not explicitly prevented, however assumptions may be made on filter gain to avoid them.
The mask is moved one column at a time, advancing the mask over the entire image until the entire 'width' is covered. The mask and the input image pixels are both provided as 16-bit unsigned values, while the output pixels are 32-bit signed. The mask chosen for correlation is typically part of the input image or another image.
Parameters:
imgin_ptr Pointer to an input image of 16-bit unsigned pixels
imgout_ptr Pointer to an output image of 32-bit pixels
mask_ptr Pointer to a 16-bit unsigned filter mask
pitch Number of columns in the image
width Number of output pixels
Algorithm:
The natural C implementation has no restrictions. The optimized intrinsic C code has restrictions as noted in Assumptions below.
Assumptions:
  • The input array and output array should not overlap
  • The input, output and mask arrays have no alignment requirements
  • The image pitch must be greater than or equal to the width
  • The width parameter must be a non-zero multiple of 4
Implementation Notes:
  • This code is fully interruptible
  • This code is compatible with C66x processors
Benchmarks:
See IMGLIB_Test_Report.html for cycle and memory information.


Copyright 2012, Texas Instruments Incorporated