Flip - 2023.1 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.1 English

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.

Table 504 Table Flip Parameter Description
Parameter Description
PTR_WIDTH Pixel Width of Input and Output Pointer
TYPE Input and Output Pixel type
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.
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.

Table 505 Table flip Resource Utilization Summary
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.

Table 506 Table flip Resource Utilization Summary
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.

Table 507 Table flip Resource Utilization Summary
Operating Mode

Operating Frequency

(MHz)

Latency Estimate
Max (ms)
1 pixel 300 28.5
4 pixel 300 7.7