IMG_corr_3x3_i8_c16s


Detailed Description


Functions

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


Function Documentation

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

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 stored in the output array. Overflow of the accumulated sum is not possible.
The mask is moved one column at a time, advancing the mask over the entire image until the entire 'width' is covered. The mask is provided as 16-bit signed values and the input image pixels are 8-bit unsigned. 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 to an input image of 16-bit pixels
imgout_ptr Pointer to an output image of 32-bit pixels
width Number of output pixels
pitch Number of columns in the image
mask_ptr Pointer to a 16-bit filter mask
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 output array must be 64-bit aligned
  • The mask array must be 16-bit aligned
  • The input image array has 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 2
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