Functions
VXLIB_minMaxLoc_i16s

Functions

VXLIB_STATUS VXLIB_minMaxLoc_i16s (const int16_t src[restrict], const VXLIB_bufParams2D_t *src_addr, int16_t *pMinVal, int16_t *pMaxVal, uint32_t *pMinCount, uint32_t *pMaxCount, size_t minLocCapacity, size_t maxLocCapacity, uint32_t minLoc[restrict], uint32_t maxLoc[restrict], uint16_t startX, uint16_t startY)
 
VXLIB_STATUS VXLIB_minMaxLoc_i16s_checkParams (const int16_t src[], const VXLIB_bufParams2D_t *src_addr, const int16_t *pMinVal, const int16_t *pMaxVal)
 

Detailed Description

Function Documentation

◆ VXLIB_minMaxLoc_i16s()

VXLIB_STATUS VXLIB_minMaxLoc_i16s ( const int16_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
int16_t *  pMinVal,
int16_t *  pMaxVal,
uint32_t *  pMinCount,
uint32_t *  pMaxCount,
size_t  minLocCapacity,
size_t  maxLocCapacity,
uint32_t  minLoc[restrict],
uint32_t  maxLoc[restrict],
uint16_t  startX,
uint16_t  startY 
)
Description:
Finds the minimum and maximum values in an image and a location for each.
Method:
The minimum and maximum is found in a first pass through the image. The minCount and maxCounts are optionally found in a second pass through the image The minLoc and maxLoc list of pixel coordinates are optionally found in a third pass through the image.
 minVal = min(src(x',y')) where 0 <= x' < width, 0 <= y' < height
 maxVal = max(src(x',y')) where 0 <= x' < width, 0 <= y' < height
Parameters
[in]src[]Pointer to array containing input image (SQ15.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[in,out]*pMinValMinimum value in the image
[in,out]*pMaxValMaximum value in the image
[in,out]*pMinCountTotal number of detected minimum values in the image (optional)
[in,out]*pMaxCountTotal number of detected maximum values in the image (optional)
[in]minLocCapacityAllocated array size of minLoc array.
[in]maxLocCapacityAllocated array size of maxLoc array.
[in,out]minLoc[]Coordinates of minimum values in the image (x,y) (optional)
[in,out]maxLoc[]Coordinates of maximum values in the image (x,y) (optional)
[in]startXStarting x coordinate in the image corresponding to the src pointer
[in]startYStarting y coordinate in the image corresponding to the src pointer
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • PARAMETER INITIALIZATION:
    • pMinVal and pMaxVal should be externally initialized to 0x7fff and 0x8000, respectively, before calling the function for the first time for each image.
    • If the optional parameters pMinCount or pMaxCount are to be passed (not set to NULL), then they each need to be externally initialized to 0 before calling the function for the first time for each image.
    • The reason the above parameters are not internally initialized is in case a user wants to divide processing of the image into smaller pieces, and call this function for each piece. In this case, the external intitialization only needs to happen on the first block of the image, and the same parameters can be updated internally by subsequent blocks.
    • startX and startY may be non-zero when the user sets minLoc or maxLoc pointers to non-NULL values, AND divides the processing of the image into smaller pieces.
  • PARAMETER DEPENDENCIES:
    • if minLoc is non-NULL, then pMinCount should be non-NULL so that the user knows how much of the array was filled. If the pMinCount returned is > minLocCapacity, then there are only minLocCapacity items filled in the array.
    • if maxLoc is non-NULL, then pMaxCount should be non-NULL so that the user knows how much of the array was filled. If the pMaxCount returned is > maxLocCapacity, then there are only maxLocCapacity items filled in the array.
    • if minLoc is NULL, then minLocCapacity is ignored by the function
    • if maxLoc is NULL, then maxLocCapacity and startX parameters are ignored by the function
    • if minLoc and maxLoc are both NULL then startX and startY parameters are also ignored by the function
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Set widths equal to strides
    • Set all stride values to a multiple of 8
    • Set all width values to a multiple of 8
    • The highest performing mode is when all the "optional" parameters are set to NULL, such that only min and max values are found.
    • The second highest performing mode is when the minLoc and maxLoc pointers are set to NULL, such that only min and max values and counts are found, not the locations.

◆ VXLIB_minMaxLoc_i16s_checkParams()

VXLIB_STATUS VXLIB_minMaxLoc_i16s_checkParams ( const int16_t  src[],
const VXLIB_bufParams2D_t *  src_addr,
const int16_t *  pMinVal,
const int16_t *  pMaxVal 
)
Description:
Checks the parameters for programming errors for the VXLIB_minMaxLoc_i16s function.
Method:
The following checks are made:
  • src, pMinVal, and pMaxVal shall not have NULL pointers
  • The strides of each image shall be equal to or greater than the x dimension
Parameters
[in]src[]Pointer to array containing input image (SQ15.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[in]*pMinValMinimum value in the image
[in]*pMaxValMaximum value in the image

Copyright 2022, Texas Instruments Incorporated