Functions | |
VXLIB_STATUS | VXLIB_scaleImageBilinear_i8u_o8u (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint8_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, VXLIB_F32 xScale, VXLIB_F32 yScale, int16_t srcOffsetX, int16_t srcOffsetY, int16_t dstOffsetX, int16_t dstOffsetY) |
VXLIB_STATUS | VXLIB_scaleImageBilinear_i8u_o8u_checkParams (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint8_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, VXLIB_F32 xScale, VXLIB_F32 yScale, int16_t srcOffsetX, int16_t srcOffsetY, int16_t dstOffsetX, int16_t dstOffsetY) |
VXLIB_STATUS VXLIB_scaleImageBilinear_i8u_o8u | ( | const uint8_t | src[restrict], |
const VXLIB_bufParams2D_t * | src_addr, | ||
uint8_t | dst[restrict], | ||
const VXLIB_bufParams2D_t * | dst_addr, | ||
VXLIB_F32 | xScale, | ||
VXLIB_F32 | yScale, | ||
int16_t | srcOffsetX, | ||
int16_t | srcOffsetY, | ||
int16_t | dstOffsetX, | ||
int16_t | dstOffsetY | ||
) |
Performs image rescale from input image (8-bit) to output image (8-bit) using bilinear interpolation. No border handling in done in this function, so it is expected that appropriate padding is done to the input buffer.
[in] | src[] | Pointer to array containing first input image (UQ8.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] | xScale | Parameter indicating x scale factor from output to input (F32) |
[in] | yScale | Parameter indicating y scale factor from output to input (F32) |
[in] | srcOffsetX | Parameter indicating x offset of src pointer relative to start of valid data in broader image (SQ15.0) |
[in] | srcOffsetY | Parameter indicating y offset of src pointer relative to start of valid data in broader image (SQ15.0) |
[in] | dstOffsetX | Parameter indicating x offset of dst pointer relative to start of output valid data in broader image (SQ15.0) |
[in] | dstOffsetY | Parameter indicating y offset of dst pointer relative to start of output valid data in broader image (SQ15.0) |
Be sure to allocate padding around the border (or fetch enough pad pixels from the input for interior edges when breaking into blocks), for the rescale, or else the function may fetch from an out-of-bounds memory location. For each dimension, the required fetch amount should be:
And the amount of left/top overlap to refetch should be:
VXLIB_STATUS VXLIB_scaleImageBilinear_i8u_o8u_checkParams | ( | const uint8_t | src[restrict], |
const VXLIB_bufParams2D_t * | src_addr, | ||
uint8_t | dst[restrict], | ||
const VXLIB_bufParams2D_t * | dst_addr, | ||
VXLIB_F32 | xScale, | ||
VXLIB_F32 | yScale, | ||
int16_t | srcOffsetX, | ||
int16_t | srcOffsetY, | ||
int16_t | dstOffsetX, | ||
int16_t | dstOffsetY | ||
) |
[in] | src[] | Pointer to array containing first input image (UQ8.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] | xScale | Parameter indicating x scale factor from output to input (F32) |
[in] | yScale | Parameter indicating y scale factor from output to input (F32) |
[in] | srcOffsetX | Parameter indicating x offset of src pointer relative to start of valid data in broader image (SQ15.0) |
[in] | srcOffsetY | Parameter indicating y offset of src pointer relative to start of valid data in broader image (SQ15.0) |
[in] | dstOffsetX | Parameter indicating x offset of dst pointer relative to start of output valid data in broader image (SQ15.0) |
[in] | dstOffsetY | Parameter indicating y offset of dst pointer relative to start of output valid data in broader image (SQ15.0) |