Functions
VXLIB_convolve_i8u_c16s_o16s

Functions

VXLIB_STATUS VXLIB_convolve_i8u_c16s_o16s (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, int16_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, const int16_t conv_mat[restrict], int32_t conv_width, int32_t conv_height, uint32_t conv_scale)
 
VXLIB_STATUS VXLIB_convolve_i8u_c16s_o16s_checkParams (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, const int16_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, const int16_t conv_mat[restrict], int32_t conv_width, int32_t conv_height, uint32_t conv_scale)
 

Detailed Description

Function Documentation

◆ VXLIB_convolve_i8u_c16s_o16s()

VXLIB_STATUS VXLIB_convolve_i8u_c16s_o16s ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
int16_t  dst[restrict],
const VXLIB_bufParams2D_t *  dst_addr,
const int16_t  conv_mat[restrict],
int32_t  conv_width,
int32_t  conv_height,
uint32_t  conv_scale 
)
Description:
User-defined image convolution function of an 8 bit image, producing an 16 bit signed image
Method:
Convolve the input image with the convolution matrix, saturating the output to [0, 255]
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output image (SQ15.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]conv_mat[]Pointer to array containing convolution matrix (SQ15.0)
[in]conv_widthWidth of convoltion matrix
[in]conv_heightHeight of convolution matrix
[in]conv_scaleScale value to divide the final sum of products (power of 2)
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • Output height should be == (Input height - (conv_height-1))
  • Output width should be == (Input width - conv_width-1) OR (Input width)
  • conv_width should be an odd number in the range 3 <= conv_width <= 9
  • conv_height should be an odd number in the range 3 <= conv_width <= 9
  • conv_scale should be a positive power of 2
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Align all pointers to 8 byte boundaries
    • Set all stride values to a multiple of 8
    • Set output width values to a multiple of 16
    • Set widths equal to each other and equal to strides (allows processing over whole image in single loop)
    • Optimized for 3x3, 5x5, 7x7, 9x9 matrix sizes.

◆ VXLIB_convolve_i8u_c16s_o16s_checkParams()

VXLIB_STATUS VXLIB_convolve_i8u_c16s_o16s_checkParams ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
const int16_t  dst[restrict],
const VXLIB_bufParams2D_t *  dst_addr,
const int16_t  conv_mat[restrict],
int32_t  conv_width,
int32_t  conv_height,
uint32_t  conv_scale 
)
Description:
Checks the parameters for programming errors for the VXLIB_convolve_i8u_c16s_o16s function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • Output height should be == (Input height - (conv_height-1))
  • Output width should be <= Input width
  • The strides of each image shall be equal to or greater than the x dimension
  • conv_width should be an odd number in the range 3 <= conv_width <= 9
  • conv_height should be an odd number in the range 3 <= conv_width <= 9
  • conv_scale should be a positive power of 2
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output image (SQ15.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]conv_mat[]Pointer to array containing convolution matrix (SQ15.0)
[in]conv_widthWidth of convoltion matrix
[in]conv_heightHeight of convolution matrix
[in]conv_scaleScale value to divide the final sum of products (power of 2)

Copyright 2023, Texas Instruments Incorporated