The Flip function converts input image into output image which is a horizontal flip or vertical flip or both of input image, based on user input.
API Syntax
template <int PTR_WIDTH, int TYPE, int ROWS, int COLS, int NPC>
void flip(ap_uint<PTR_WIDTH>* SrcPtr,
ap_uint<PTR_WIDTH>* DstPtr,
int Rows,
int Cols,
int Direction)
The following table describes the template and the function parameters.
Parameter | Description |
---|---|
PTR_WIDTH | Pixel Width of Input and Output Pointer |
TYPE | Input pixel type. XF_8UC1 ,XF_8UC3 are supported |
ROWS | Maximum height of input and output image (Must be multiple of NPC) |
COLS | Maximum width of input and output image (Must be multiple of NPC) |
NPC | Number of pixels to be processed per cycle; possible options are XF_NPPC1,XF_NPPC2,XF_NPPC4 and XF_NPPC8 for 1,2,4 pixel and 8 pixel operations respectively. |
SrcPtr | Input Image pointer. |
DstPtr | Output Image pointer. |
Rows | Height of the image |
Cols | Width of the image |
Direction | Direction of flip, possible values are horizontal (0), vertical (1) and both (-1) |
Resource Utilization
The following table summarizes the resource utilization in different configurations, generated using Vitis HLS 2021.1 tool for the xczu7ev-ffvc1156-2-e, to process a grayscale 4k (2160x3840) image.
Operating Mode | Direction of flip | Operating Frequency (MHz) |
Utilization Estimate | ||||
---|---|---|---|---|---|---|---|
BRAM_18K | DSP | FF | LUT | URAM | |||
1 Pixel | Horizontal | 300 | 12 | 5 | 5888 | 7787 | 0 |
Vertical | 300 | 12 | 5 | 5888 | 7787 | 0 | |
Both | 300 | 12 | 5 | 5888 | 7787 | 0 | |
4 Pixel | Horizontal | 300 | 16 | 5 | 7180 | 9794 | 0 |
Vertical | 300 | 16 | 5 | 7180 | 9794 | 0 | |
Both | 300 | 16 | 5 | 7180 | 9794 | 0 |
The following table summarizes the resource utilization in different configurations, generated using Vitis HLS 2021.1 tool for the xczu7ev-ffvc1156-2-e, to process a 4k (2160x3840) 3 channel image.
Operating Mode | Direction of flip | Operating Frequency (MHz) |
Utilization Estimate | ||||
---|---|---|---|---|---|---|---|
BRAM_18K | DSP | FF | LUT | URAM | |||
1 Pixel | Horizontal | 300 | 32 | 5 | 6355 | 9005 | 0 |
Vertical | 300 | 32 | 5 | 6355 | 9005 | 0 | |
Both | 300 | 32 | 5 | 6355 | 9005 | 0 | |
4 Pixel | Horizontal | 300 | 56 | 5 | 8798 | 15409 | 0 |
Vertical | 300 | 56 | 5 | 8798 | 15409 | 0 | |
Both | 300 | 56 | 5 | 8798 | 15409 | 0 |
Performance Estimate
The following table summarizes the resource utilization in different configurations, generated using Vitis HLS 2021.1 tool for the xczu7ev-ffvc1156-2-e, to process a 4k (2160x3840) 3 channel image.
Operating Mode | Operating Frequency (MHz) |
Latency Estimate |
---|---|---|
Max (ms) | ||
1 pixel | 300 | 28.5 |
4 pixel | 300 | 7.7 |