- 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] | dstOffsetX | Parameter 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] | dstOffsetY | Parameter 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