Channel Extract
The xFextractChannel function splits a multi-channel array (32-bit
pixel-interleaved data) into several single-channel arrays and returns a single channel. The
channel to be extracted is specified by using the channel argument.
The value of the channel argument is specified by macros defined in the
xf_channel_extract_e enumerated data type. The following table summerizes
the possible values for the xf_channel_extract_e enumerated data type:
| Channel | Enumerated Type |
|---|---|
| Unknown | XF_EXTRACT_CH_0 |
| Unknown | XF_EXTRACT_CH_1 |
| Unknown | XF_EXTRACT_CH_2 |
| Unknown | XF_EXTRACT_CH_3 |
| RED | XF_EXTRACT_CH_R |
| GREEN | XF_EXTRACT_CH_G |
| BLUE | XF_EXTRACT_CH_B |
| ALPHA | XF_EXTRACT_CH_A |
| LUMA | XF_EXTRACT_CH_Y |
| Cb/U | XF_EXTRACT_CH_U |
| Cr/V/Value | XF_EXTRACT_CH_V |
API Syntax
template<int SRC_T, int DST_T, int ROWS, int COLS, int NPC=1>
void xFextractChannel(xF::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat, xF::Mat<DST_T, ROWS, COLS, NPC> & _dst_mat, uint16_t _channel)
Parameter Descriptions
The following table describes the template and the function parameters.
| Parameter | Description |
|---|---|
| SRC_T | Input pixel type. Only 8-bit, unsigned, 4channel is supported (XF_8UC4) |
| DST_T | Output pixel type. Only 8-bit, unsigned, 1 channel is supported (XF_8UC1) |
| ROWS | Maximum height of input and output image (must be a multiple of 8) |
| COLS | Maximum width of input and output image (must be a multiple of 8) |
| NPC | Number of pixels to be processed per cycle; possible options are XF_NPPC1 for 1 pixel operation. |
| _src_mat | Input multi-channel image |
| _dst_mat | Output single channel image |
| _channel | Channel to be extracted (See xf_channel_extract_e enumerated type in file xf_params.h for possible values.) |
Resource Utilization
The following table summarizes the resource utilization of the xfextractChannel function, generated using Vivado HLS 2017.1 tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA, to process a 4 channel HD (1080x1920) image.
| Operating Mode |
Operating Frequency (MHz) |
Utilization Estimate | ||||
|---|---|---|---|---|---|---|
| BRAM_18K | DSP_48Es | FF | LUT | CLB | ||
| 1 pixel | 300 | 0 | 8 | 508 | 354 | 96 |
Performance Estimate
The following table summarizes the performance in different configurations, as generated using Vivado HLS 2017.1 tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1, to process a 4 channel HD (1080x1920) image.
| Operating Mode | Latency Estimate |
|---|---|
| Max Latency (ms) | |
| 1 pixel operation (300 MHz) | 6.92 |