Functions
VXLIB_histogramSimple_i8u_o32u

Functions

VXLIB_STATUS VXLIB_histogramSimple_i8u_o32u (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint32_t dist[restrict], uint32_t scratch[restrict], uint32_t *minValue, uint8_t lastBlock)
 
VXLIB_STATUS VXLIB_histogramSimple_i8u_o32u_checkParams (const uint8_t src[], const VXLIB_bufParams2D_t *src_addr, const uint32_t dist[], const uint32_t scratch[], const uint32_t *minValue, uint8_t lastBlock)
 

Detailed Description

Function Documentation

◆ VXLIB_histogramSimple_i8u_o32u()

VXLIB_STATUS VXLIB_histogramSimple_i8u_o32u ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
uint32_t  dist[restrict],
uint32_t  scratch[restrict],
uint32_t *  minValue,
uint8_t  lastBlock 
)
Description:
Generates a distribution from an image. This kernel counts the number of occurrences of each pixel value and populates the distribution array. It also returns the minimum value from the input image.
Parameters
[in]src[]Pointer to array containing first input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dist[]Pointer to array containing the distribution (UQ32.0)
[in,out]scratch[]Pointer to array containing the intermediate distribution data (UQ32.0)
[out]*minValuePointer to minimum input value in the image (UQ32.0)
[in]lastBlockFlag that indicates if the function call is the final call for the image (0: intermediate call, 1: Final call)
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • dist buffer assumed to have 256 entries
  • scratch buffer assumed to have 1024 entries
  • scratch buffer pointer assumed to be 8-byte aligned.
  • PARAMETER INITIALIZATION:
    • All scratch entries should be externally initialized to zero before calling the function for the first time since it is always read by the function regardless if the function is being called once per image, or multiple times per image.
      • Scratch entries should not be re-initialized for each block of an image, only for each new image.
      • If calling only once per full image, lastBlock can be set to 1 so that dist array is populated.
    • If a user wants to divide processing of the image into smaller blocks, then user should set lastBlock to 0 for all blocks except the final block in the image.
  • NOTE: The dist and minValue outputs of the function are only considered accurate for the whole image when the lastBlock parameter is set to 1.
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Set widths equal to strides
    • Align src pointer to 4 byte boundaries
    • Set all stride values to a multiple of 4
    • Set all width values to a multiple of 8

◆ VXLIB_histogramSimple_i8u_o32u_checkParams()

VXLIB_STATUS VXLIB_histogramSimple_i8u_o32u_checkParams ( const uint8_t  src[],
const VXLIB_bufParams2D_t *  src_addr,
const uint32_t  dist[],
const uint32_t  scratch[],
const uint32_t *  minValue,
uint8_t  lastBlock 
)
Description:
Checks the parameters for programming errors for the VXLIB_histogramSimple_i8u_o32u function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • The strides of the src image shall be equal to or greater than the x dimension
  • lastBlock shall be either 0 or 1
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dist[]Pointer to array containing the distribution (UQ32.0)
[in,out]scratch[]Pointer to array containing the distribution (UQ32.0)
[out]*minValuePointer to minimum input value in the image (UQ32.0)
[in]lastBlockFlag that indicates if the function call is the final call for the image (0: intermediate call, 1: Final call)

Copyright 2022, Texas Instruments Incorporated