IMG_boundary_16s


Detailed Description


Functions

void IMG_boundary_16s (const short *restrict i_data, int rows, int cols, unsigned int *restrict o_coord, short *restrict o_grey)


Function Documentation

void IMG_boundary_16s ( const short *restrict  i_data,
int  rows,
int  cols,
unsigned int *restrict  o_coord,
short *restrict  o_grey 
)

Description:
This routine scans an image looking for non-zero pixels. The locations of those pixels are stored out to the o_coord array as packed Y/X pairs, with Y in the upper 16-bits, and X in the lower 16-bits. The associated grey levels are stored in the o_grey array in parallel.
Parameters:
i_data Input image of size cols-by-rows
rows Height of the input image
cols Width of the input image
o_coord Array to write output coordinates to
o_grey Array to write output grey levels to
Algorithm:
Outer and inner loops are merged.
"Inner loop" is unrolled to process four pixels per iteration.
Packed coordinate value is updated directly, rather than by repacking x, y every time it's needed.
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
  • Both output arrays must be 32-bit aligned
  • The input image must be 64-bit aligned.
  • The cols parameter must be a non-zero multiple of 4 less than 32767
  • The rows parameter must be non-zero and less than or equal to 32767
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