IMG_thr_gt2max_16


Detailed Description


Functions

void IMG_thr_gt2max_16 (const unsigned short *restrict in_data, unsigned short *restrict out_data, short cols, short rows, unsigned short threshold)


Function Documentation

void IMG_thr_gt2max_16 ( const unsigned short *restrict  in_data,
unsigned short *restrict  out_data,
short  cols,
short  rows,
unsigned short  threshold 
)

Description:
This kernel performs a thresholding operation on the input image "in_data" with dimensions as specified by the input arguments "cols" and "rows". The thresholded pixels are written to the output image pointed to by "out_data". The input and output images are of the same dimensions.
Pixels with values equal-to or below the threshold are passed out unmodified. Pixels with values greater than the threshold are set to the maximum unsigned 16-bit value (65535) in the output image.
Parameters:
in_data Input image pointer
out_data Output image pointer
cols Number of columns in the image
rows Number of rows in the image
threshold The (unsigned 16-bit) threshold
Algorithm:
The thresholding function is illustrated in the transfer function diagram below:

              65535_|          _________                               
                    |         |                                        
                    |         |                                        
           O        |         |                                        
           U        |         |                                        
           T    th _|. . . . .|                                        
           P        |        /.                                        
           U        |      /  .                                        
           T        |    /    .                                        
                    |  /      .                                        
                  0_|/________.__________                              
                    |         |        |                               
                    0        th       65535                            
                                                                       
                            INPUT                                      
   
The main thresholding loop is unrolled sixteen times. Packed-data processing techniques allow us to process all 16 pixels in parallel.
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
  • Both input and output arrays must be 64-bit aligned
  • The number of image pixels (cols x rows) must be a multiple of 16
Implementation Notes:
  • This code is fully interruptible
  • This code is compatible with C66x processors
  • This code is endian neutral
Benchmarks:
See IMGLIB_Test_Report.html for cycle and memory information.


Copyright 2012, Texas Instruments Incorporated