Functions
VXLIB_halfScaleGaussian_5x5_br_i8u_o8u_o8u

Functions

VXLIB_STATUS VXLIB_halfScaleGaussian_5x5_br_i8u_o8u_o8u (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint8_t dst0[restrict], const VXLIB_bufParams2D_t *dst0_addr, uint8_t dst1[restrict], const VXLIB_bufParams2D_t *dst1_addr, int16_t dstOffsetX, int16_t dstOffsetY)
 
VXLIB_STATUS VXLIB_halfScaleGaussian_5x5_br_i8u_o8u_o8u_checkParams (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, const uint8_t dst0[restrict], const VXLIB_bufParams2D_t *dst0_addr, const uint8_t dst1[restrict], const VXLIB_bufParams2D_t *dst1_addr, int16_t dstOffsetX, int16_t dstOffsetY)
 

Detailed Description

Function Documentation

◆ VXLIB_halfScaleGaussian_5x5_br_i8u_o8u_o8u()

VXLIB_STATUS VXLIB_halfScaleGaussian_5x5_br_i8u_o8u_o8u ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
uint8_t  dst0[restrict],
const VXLIB_bufParams2D_t *  dst0_addr,
uint8_t  dst1[restrict],
const VXLIB_bufParams2D_t *  dst1_addr,
int16_t  dstOffsetX,
int16_t  dstOffsetY 
)
Description:
Computes a gaussian filter over the 5x5 neighborhood of each input pixel using "replicate border" mode, then half scales the image in both horizontal and vertical using nearest neighbor interpolation. Outputs the half scale image in dst0, and outputs same pixels in an interleaved fashion in a memory buffer of 4 time the size of the output buffer in dst1 (odd lines are not written to, and odd columns contain zeros in between pixels).
Method:
This filter uses the following convolution matrix:
         | 1  4  6  4  1 |
         | 4 16 24 16  4 |
    K =  | 6 24 36 24  6 | * 1/256
         | 4 16 24 16  4 |
         | 1  4  6  4  1 |

The output buffers are related to each other as in following diagram ('x' is memory which is not written to by the function. It is expected that the application can fill in this memory if necessary:

dst0:                        dst1:

a b c d                      a 0 b 0 c 0 d 0
e f g h                      x x x x x x x x
                             e 0 f 0 g 0 h 0
                             x x x x x x x x
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst0[]Pointer to array containing half scale output image (UQ8.0)
[in]dst0_addr[]Pointer to structure containing dimensional information of dst0
[out]dst1[]Pointer to array containing interleaved half scale output image (UQ8.0)
[in]dst1_addr[]Pointer to structure containing dimensional information of dst1
[in]dstOffsetXParameter indicating x offset of dst pointer relative to position of src pointer in the image (note that this is in units of pixels after gaussian filter but before half scale) (SQ15.0)
[in]dstOffsetYParameter indicating y offset of dst pointer relative to position of src pointer in the image (note that this is in units of pixels after gaussian filter but before half scale) (SQ15.0)
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • Input width should be >= (dst0 output width) * 2
  • Input height should be == (dst0 output height) * 2
  • When breaking input image processing into blocks, be sure to fetch enough overlap pixels from the input for interior edges for the rescale, or else the function may put a false border within the block edge of of the output image. For each dimension, the required fetch amount should be:

    • input block width to fetch = (output block width + 2) * 2
    • input block height to fetch = (output block height + 2) * 2

    And the amount of left/top overlap to refetch should be:

    • left edge overlap = 2
    • top edge overlap = 2

◆ VXLIB_halfScaleGaussian_5x5_br_i8u_o8u_o8u_checkParams()

VXLIB_STATUS VXLIB_halfScaleGaussian_5x5_br_i8u_o8u_o8u_checkParams ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
const uint8_t  dst0[restrict],
const VXLIB_bufParams2D_t *  dst0_addr,
const uint8_t  dst1[restrict],
const VXLIB_bufParams2D_t *  dst1_addr,
int16_t  dstOffsetX,
int16_t  dstOffsetY 
)
Description:
Checks the parameters for programming errors for the VXLIB_halfScaleGaussian_5x5_i8u_o8u function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • Input width should be >= (Output width) * 2
  • Input height should be == (Output height) * 2
  • The strides of each image shall be equal to or greater than the x dimension
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst0[]Pointer to array containing half scale output image (UQ8.0)
[in]dst0_addr[]Pointer to structure containing dimensional information of dst0
[out]dst1[]Pointer to array containing interleaved half scale output image (UQ8.0)
[in]dst1_addr[]Pointer to structure containing dimensional information of dst1
[in]dstOffsetXParameter indicating x offset of dst pointer relative to position of src pointer in the image (note that this is in units of pixels after gaussian filter but before half scale) (SQ15.0)
[in]dstOffsetYParameter indicating y offset of dst pointer relative to position of src pointer in the image (note that this is in units of pixels after gaussian filter but before half scale) (SQ15.0)

Copyright 2023, Texas Instruments Incorporated