Channel Extract

ThexFextractChannelfunction 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 thexf_channel_extract_eenumerated data type. The following table summerizes the possible values for thexf_channel_extract_eenumerated data type:

Table 1.xf_channel_extract_e Enumerated Data Type Values
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 void xFextractChannel(xF::Mat & _src_mat, xF::Mat & _dst_mat, uint16_t _channel)

Parameter Descriptions

The following table describes the template and the function parameters.

Table 2.xFextractChannel Function Parameter Descriptions
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 filexf_params.hfor possible values.)

Resource Utilization

The following table summarizes the resource utilization of the xfextractChannel function, generated usingVivado HLS 2017.1tool for theXilinx Xczu9eg-ffvb1156-1-i-es1FPGA, to process a 4 channel HD (1080x1920) image.

Table 3.xFextractChannel Function Resource Utilization Summary
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 usingVivado HLS 2017.1tool for theXilinx Xczu9eg-ffvb1156-1-i-es1, to process a 4 channel HD (1080x1920) image.

Table 4.xFextractChannel Function Performance Estimate Summary
Operating Mode Latency Estimate
Max Latency (ms)
1 pixel operation (300 MHz) 6.92