IMG_conv_3x3_i16_c16s


Detailed Description


Functions

void IMG_conv_3x3_i16_c16s (const unsigned short *restrict imgin_ptr, unsigned short *restrict imgout_ptr, int width, const short *restrict mask_ptr, int shift)


Function Documentation

void IMG_conv_3x3_i16_c16s ( const unsigned short *restrict  imgin_ptr,
unsigned short *restrict  imgout_ptr,
int  width,
const short *restrict  mask_ptr,
int  shift 
)

Description:
The convolution kernel accepts three rows of 'width' input pixels and produces one row of 'width' output pixels using the three 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 9 resulting multiplications are summed together to produce a 40-bit intermediate sum.
The user defined shift value is used to shift the convolution sum down to a 16-bit range prior to storing in the output array. The mask is moved one column at a time, advancing the mask over the image until the entire 'width' is covered.
Parameters:
imgin_ptr Pointer to input image of unsigned 16-bit pixels
imgout_ptr Pointer to output image of unsigned 16-bit pixels
width Number of output pixels
mask_ptr Pointer to a 16-bit signed 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 and output arrays should not overlap
  • The mask and input/output image arrays must be 16-bit aligned.
  • 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