IMG_corr_3x3_i8_c8


Detailed Description


Functions

void IMG_corr_3x3_i8_c8 (const unsigned char *imgin_ptr, int *restrict imgout_ptr, short width, short pitch, const unsigned char *mask_ptr, short shift, int round)


Function Documentation

void IMG_corr_3x3_i8_c8 ( const unsigned char *  imgin_ptr,
int *restrict  imgout_ptr,
short  width,
short  pitch,
const unsigned char *  mask_ptr,
short  shift,
int  round 
)

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 32-bit sum. This 32-bit sum is rounded using the input rounding constant and shifted before being stored to the output array.
The mask is moved one column at a time, advancing the mask over the entire image until the entire 'width' is covered. When 'width' is larger than 'pitch', multiple rows are processed. An application may call this kernel once per row to calculate the correlation for an entire image, or the kernel may be invoked for multiple rows at simultaneously. In the latter case, the two outputs at the end of each row will have meaningless values and the application will have to account for this when interpreting the results.
The mask and input image are provided as 8-bit unsigned values. The output pixels will be 32-bit signed values. The mask chosen for correlation is typically part of the input image or another image.
Parameters:
imgin_ptr Pointer 8-bit input image
imgout_ptr Pointer 32-bit output image
width Number of output pixels
pitch Number of columns in the image
mask_ptr Pointer to 8-bit filter mask
shift User specified right shift on sum
round User specified round value
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 mask array has no alignment requirements
  • The input and output image arrays have no alignment requirements
  • The image pitch must must be a multiple of 2 greater than 2
  • The width parameter must be a non-zero multiple of 4
  • The image pitch must be greater than or equal to the width
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