IMG_conv_11x11_i8_c8s


Detailed Description


Functions

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


Function Documentation

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

Description:
The convolution kernel accepts eleven rows of 'pitch' input pixels and produces one row of 'width' output pixels using the 11 pixel square filter mask provided on input.
The input mask is rotated 180 degrees prior to calculating the convolution sum. The convolution sum is calculated as a point by point multiplication of the rotated mask with the input image. The 121 resulting multiplications are summed together to produce a 32-bit intermediate sum. Overflow during accumulation is not prevented, though assumptions may be applied to filter gain to avoid overflow.
The user defined shift value is used to shift the convolution sum down to an 8-bit range prior to storing in the output array. The stored result is saturated as an unsigned 8-bit quantity. The mask is moved one column at a time, advancing the mask over the image until the entire 'width' is processed.
Parameters:
imgin_ptr Pointer to an input image of 8-bit pixels
imgout_ptr Pointer to an output image of 8-bit pixels
width Number of output pixels
pitch Number of columns in the image
mask_ptr Pointer to an 8-bit filter mask
shift User specified right shift on sum
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 32-bit aligned
  • 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