Functions
VXLIB_histogram_i8u_o32u

Functions

VXLIB_STATUS VXLIB_histogram_i8u_o32u (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint32_t dist[restrict], uint32_t scratch[restrict], uint8_t offset, uint16_t range, uint16_t numBins, uint8_t lastBlock)
 
VXLIB_STATUS VXLIB_histogram_i8u_o32u_checkParams (const uint8_t src[], const VXLIB_bufParams2D_t *src_addr, const uint32_t dist[restrict], const uint32_t scratch[restrict], uint8_t offset, uint16_t range, uint16_t numBins, uint8_t lastBlock)
 

Detailed Description

Function Documentation

◆ VXLIB_histogram_i8u_o32u()

VXLIB_STATUS VXLIB_histogram_i8u_o32u ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
uint32_t  dist[restrict],
uint32_t  scratch[restrict],
uint8_t  offset,
uint16_t  range,
uint16_t  numBins,
uint8_t  lastBlock 
)
Description:
Generates a distribution from an image. This kernel counts the number of occurrences of each pixel value within the window size of a pre-calculated number of bins.
Parameters
[in]src[]Pointer to array containing first input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[in,out]dist[]Pointer to array containing the distribution (UQ32.0)
[in,out]scratch[]Pointer to array containing the intermediate distribution data (UQ32.0)
[in]offsetParameter indicating distribution offset
[in]rangeParameter indicating distribution range (<= 256)
[in]numBinsParameter indicating distribution number of bins (<= 256)
[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.
  • scratch buffer assumed to have 1024 entries
  • scratch buffer pointer assumed to be 8-byte aligned.
  • numBins is expected to be <= 256
  • (offset + range) is expected to be <= 256
  • PARAMETER INITIALIZATION:
    • All dist and 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 and dist 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 output of the function is 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_histogram_i8u_o32u_checkParams()

VXLIB_STATUS VXLIB_histogram_i8u_o32u_checkParams ( const uint8_t  src[],
const VXLIB_bufParams2D_t *  src_addr,
const uint32_t  dist[restrict],
const uint32_t  scratch[restrict],
uint8_t  offset,
uint16_t  range,
uint16_t  numBins,
uint8_t  lastBlock 
)
Description:
Checks the parameters for programming errors for the VXLIB_histogram_i8u_o32u function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • The strides of each image shall be equal to or greater than the x dimension
  • (offset + range) shall be <= 256
  • numBins is expected to be <= 256
  • lastBlock shall be either 0 or 1
Parameters
[in]src[]Pointer to array containing first input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[in,out]dist[]Pointer to array containing the distribution (UQ32.0)
[in,out]scratch[]Pointer to array containing the intermediate distribution data (UQ32.0)
[in]offsetParameter indicating distribution offset
[in]rangeParameter indicating distribution range (<= 256)
[in]numBinsParameter indicating distribution number of bins (<= 256)
[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