Functions
VXLIB_convertDepth_i16s_o8u

Functions

VXLIB_STATUS VXLIB_convertDepth_i16s_o8u (const int16_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint8_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, uint32_t shift, uint8_t policy)
 
VXLIB_STATUS VXLIB_convertDepth_i16s_o8u_checkParams (const int16_t src[], const VXLIB_bufParams2D_t *src_addr, const uint8_t dst[], const VXLIB_bufParams2D_t *dst_addr, uint32_t shift, uint8_t policy)
 

Detailed Description

Function Documentation

◆ VXLIB_convertDepth_i16s_o8u()

VXLIB_STATUS VXLIB_convertDepth_i16s_o8u ( const int16_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
uint8_t  dst[restrict],
const VXLIB_bufParams2D_t *  dst_addr,
uint32_t  shift,
uint8_t  policy 
)
Description:
Converts image bit depth.
Method:
Convert Bit Depth is computed by using the following equation:
 For Wrap Policy:
 dst(x,y) = ((uint8)(src(x,y) >> shift));

 For Saturate Policy:
 int16 value = src(x,y) >> shift;
 value = value < 0 ? 0 : value;
 value = value > 255 ? 255 : value;
 dst(x,y) = (uint8)value;
Parameters
[in]src[]Pointer to array containing first input image (SQ15.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output image (UQ8.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]shiftParameter indicating shift value; valid for 0 <= shift < 8
[in]policyParameter indicating overflow policy
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Set widths equal to strides
    • Align all pointers to 8 byte boundaries
    • Set all stride values to a multiple of 8
    • Set all width values to a multiple of 16

◆ VXLIB_convertDepth_i16s_o8u_checkParams()

VXLIB_STATUS VXLIB_convertDepth_i16s_o8u_checkParams ( const int16_t  src[],
const VXLIB_bufParams2D_t *  src_addr,
const uint8_t  dst[],
const VXLIB_bufParams2D_t *  dst_addr,
uint32_t  shift,
uint8_t  policy 
)
Description:
Checks the parameters for programming errors for the VXLIB_convertDepth_i16s_o8u function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • All images shall have the same x and y dimensions
  • The strides of each image shall be equal to or greater than the x dimension
  • 'shift' value shall conform to range: 0 <= shift < 8
  • The policy is either VXLIB_CONVERT_POLICY_WRAP or VXLIB_CONVERT_POLICY_SATURATE
Parameters
[in]src[]Pointer to array containing first input image (SQ15.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output image (UQ8.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]shiftParameter indicating shift value; valid for 0 <= shift < 8
[in]policyParameter indicating overflow policy

Copyright 2023, Texas Instruments Incorporated