Manipulating Data Type - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

Based on the number of pixels to process per clock cycle and the type parameter, there are different possible data types. The Vitis Vision library uses these datatypes for internal processing and inside the xf::cv::Mat class. The following are a few supported types:

  • XF_TNAME(TYPE,NPPC) resolves to the unsigned data type (number of bits * number of channels * NPPC) of the data member of the xf::cv::Mat object. For instance, XF_TNAME(XF_8UC1,XF_NPPC8) resolves to ap_uint<64>.
  • XF_CTUNAME(TYPE,NPPC) resolves to the data type specified in the TYPE (number of bits) of the data member of the xf::cv::Mat object. For instance, XF_TNAME(XF_16SC3,XF_NPPC8) resolves to ap_int<16>.
  • Word width = pixel depth * number of channels * number of pixels to process per             cycle (NPPC).
  • XF_DTUNAME(TYPE,NPPC) resolves to the unsigned data type of the pixel (number of bits * number of channels). For instance, XF_DTUNAME(XF_32FC1,XF_NPPC1) resolves to float , XF_DTUNAME(XF_16SC3,XF_NPPC4) resolves to ap_uint<48>.
  • XF_PTSNAME(TYPE,NPPC) resolves to the ‘C’ data type of the pixel. For instance, XF_PTSNAME             (XF_16UC1,XF_NPPC2) resolves to unsigned             short.
  • XF_DTPIXELDEPTH(TYPE,NPPC) returns the bitdepth of a individual channel of the declared xf::cv::Mat object. For instance XF_DTPIXELDEPTH(8UC3,XF_NPPC4) resolves to 8.
  • XF_PIXELWIDTH(TYPE,NPPC) returns the pixeldepth (combined bitdepth of all channels) of the declared xf::cv::Mat object. For instance XF_PIXELWIDTH(8UC3,XF_NPPC4) resolves to 24.

Note

ap_uint<>, ap_int<>, ap_fixed<>, and ap_ufixed<> types belong to the high-level synthesis (HLS) library.

For more information, see the Vitis HLS User Guide: High-Level Synthesis (UG1399 ).