Gaincontrol - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

The gain control modules improve the overall brightness of the input image. In this module, applying a multiplicative gain (weight) for red and blue channel of the input bayerized image.

API Syntax

template <int BFORMAT, int SRC_T, int ROWS, int COLS, int NPC = 1, int XFCVDEPTH_IN_1 = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT_1 = _XFCVDEPTH_DEFAULT>
         void gaincontrol(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN_1>& src,
                          xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_OUT_1>& dst,
                          unsigned short rgain,
                          unsigned short bgain)

The following table describes the template and the function parameters.

Table 508 Table gaincontrol Parameter Description
Parameter Description
BFORMAT Input Bayer pattern.
SRC_T Input and Output Pixel Type. (XF_8UC1, XF_16UC1) 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.
XFCVDEPTH_IN_1 Depth of the input image.
XFCVDEPTH_OUT_1 Depth of the output image.
src Input Bayer image
dst Output Bayer image
rgain gain value for red channel in Q9.7 format
bgain gain value for red channel in Q9.7 format

Resource Utilization

The following table summarizes the resource utilization of the kernel in different configurations, generated using Vivado HLS 2019.2 tool for the Xilinx xc7vx485t-ffg1157-1 FPGA, to process 4K image.

Table 509 Table gaincontrol Resource Utilization Summary
Operating Mode

Operating Frequency

(MHz)

Utilization Estimate        
BRAM_18K DSP_48Es FF LUT SLICE
1 pixel 300 0 3 233 95 59
2 pixel 300 0 3 235 95 59

Performance Estimate

The following table summarizes a performance estimate of the kernel in different configurations, as generated using Vivado HLS 2019.2 tool for the Xilinx xc7vx485t-ffg1157-1, to process a 4K image.

Operating Mode

Operating Frequency

(MHz)

Latency Estimate
Max (ms)
1 pixel 300 27.7
2 pixel 300 14.2