Custom AI Tensor Formats - Custom AI Tensor Formats - 6.2 English - XD056

Vitis Video Analytics SDK (VVAS) 6.2 User Guide (XD056)

Document_ID
XD056
Release_Date
2026-06-12
Version
6.2 English

VVAS plugin supports custom GStreamer video format strings for AI tensor buffers. These formats are registered in the patched GStreamer gst-plugins-base video library and can appear in gst-inspect-1.0 output, negotiated caps, and debug logs.

These formats describe the memory layout and precision of tensors exchanged between VVAS elements. Application pipelines normally do not need to set these formats directly unless they pass pre-processed tensor buffers between elements.

Naming Convention

The format name describes channel order, precision, and tensor layout:

Table 33 Tensor Format Naming

Name component

Meaning

RGB or BGR

Channel order of the tensor data.

BF16, FP16, or FLOAT

Tensor precision. FLOAT means FP32.

P suffix

Planar tensor data. For RGB and BGR this corresponds to three planes, such as R, G, B or B, G, R.

RGBX_*_C4

Packed 4-channel RGB tensor data with a padding channel, used for HCWNC4 layouts.

BGRx_*_C4

Packed 4-channel BGR tensor data with a padding channel, used for HCWNC4 layouts.

GRAY_*

Single-channel tensor data.

GStreamer Names and VVAS Names

There are two names for the same underlying format:

  • GStreamer caps and logs use GStreamer format strings such as RGBX_BF16_C4, RGB_FLOATP, and BGRx_FP16_C4.

  • VVAS APIs and image-processing configuration files use VvasVideoFormat names such as VVAS_VIDEO_FORMAT_RGBx_BF16 and VVAS_VIDEO_FORMAT_RGBP_FLOAT.

The VVAS helper libraries map between the two forms. For example, VVAS_VIDEO_FORMAT_RGBx_BF16 maps to the GStreamer caps string RGBX_BF16_C4.

Formats Used by vvas_xinfer

The vvas_xinfer element selects the tensor format from three values: model-format from the JSON configuration, the model tensor layout, and the tensor data type. GStreamer logs and caps use the names in the last column.

Table 34 vvas_xinfer Tensor Format Mapping

model-format

Tensor layout

Data type

GStreamer format

RGB

NCHW

FLOAT32

RGB_FLOATP

RGB

NHWC

FLOAT32

RGB_FLOAT

RGB

NCHW

INT8

RGBP

RGB

NHWC

INT8

RGB

RGB

HCWNC4

INT8

RGBx

RGB

NCHW

BF16

RGB_BF16P

RGB

NHWC

BF16

RGB_BF16

RGB

HCWNC4

BF16

RGBX_BF16_C4

RGB

NCHW

FP16

RGB_FP16P

RGB

NHWC

FP16

RGB_FP16

RGB

HCWNC4

FP16

RGBX_FP16_C4

BGR

NHWC

FLOAT32

BGR_FLOAT

BGR

NHWC

INT8

BGR

BGR

NCHW

BF16

BGR_BF16P

BGR

NHWC

BF16

BGR_BF16

BGR

HCWNC4

BF16

BGRx_BF16_C4

BGR

NCHW

FP16

BGR_FP16P

BGR

NHWC

FP16

BGR_FP16

BGR

HCWNC4

FP16

BGRx_FP16_C4

vvas_xinfer does not select BGR with NCHW for FLOAT32 or INT8 models. GRAY_BF16, GRAY_FP16, and GRAY_FLOAT may appear in caps for tensor compatibility, but they are not selected for RGB or BGR model configurations.

Formats Used by vvas_xabrscaler

The vvas_xabrscaler element is based on VvasImageProcess. The input and output format lists are independent:

  • Sink pad caps are built from the image-process library’s supported input formats.

  • Source pad caps are built from the image-process library’s supported output formats.

For the hardware image-process library, the input list normally contains integer pixel formats. The output list can include tensor formats such as RGB_FLOATP, RGBX_BF16_C4, or BGRx_FP16_C4 when the hardware configuration supports normalization and tensor output. This allows vvas_xabrscaler to act as an external pre-processing element before vvas_xinfer.

Supported Format Lists Are Configuration Dependent

The exact hardware vvas_xabrscaler caps depend on the deployed image_processing.cfg file.

Note

image_processing.cfg file is included as part of the overlay for the Vitis-AI 6.2 platform. For additional details refer to the Vitis-AI 6.2 release documentation.

The file has separate sections. The lists below match the hardware image_processing.cfg shipped with the Vitis-AI 6.2 platform overlay.

  • [input-color-formats] for formats accepted by the hardware image-process library.

    • VVAS_VIDEO_FORMAT_RGBx

    • VVAS_VIDEO_FORMAT_Y_UV8_420

    • VVAS_VIDEO_FORMAT_RGB

    • VVAS_VIDEO_FORMAT_GRAY8

    • VVAS_VIDEO_FORMAT_BGRx

    • VVAS_VIDEO_FORMAT_BGR

    • VVAS_VIDEO_FORMAT_RGBP

    • VVAS_VIDEO_FORMAT_BGRP

  • [output-color-formats] for formats produced by the hardware image-process library.

    • VVAS_VIDEO_FORMAT_RGBx

    • VVAS_VIDEO_FORMAT_Y_UV8_420

    • VVAS_VIDEO_FORMAT_RGB

    • VVAS_VIDEO_FORMAT_GRAY8

    • VVAS_VIDEO_FORMAT_BGRx

    • VVAS_VIDEO_FORMAT_BGR

    • VVAS_VIDEO_FORMAT_RGBP

    • VVAS_VIDEO_FORMAT_BGRP

    • VVAS_VIDEO_FORMAT_RGB_FLOAT

    • VVAS_VIDEO_FORMAT_RGBP_FLOAT

    • VVAS_VIDEO_FORMAT_BGRP_FLOAT

    • VVAS_VIDEO_FORMAT_BGR_FLOAT

    • VVAS_VIDEO_FORMAT_GRAY32_FLOAT

    • VVAS_VIDEO_FORMAT_RGBx_BF16

    • VVAS_VIDEO_FORMAT_BGRx_BF16

    • VVAS_VIDEO_FORMAT_GRAY_BF16

    • VVAS_VIDEO_FORMAT_RGB_BF16

    • VVAS_VIDEO_FORMAT_BGR_BF16

    • VVAS_VIDEO_FORMAT_GRAY_FP16

    • VVAS_VIDEO_FORMAT_RGB_FP16

    • VVAS_VIDEO_FORMAT_BGR_FP16

    • VVAS_VIDEO_FORMAT_RGBx_FP16

    • VVAS_VIDEO_FORMAT_BGRx_FP16

    • VVAS_VIDEO_FORMAT_RGBP_FP16

    • VVAS_VIDEO_FORMAT_RGBP_BF16

    • VVAS_VIDEO_FORMAT_BGRP_FP16

    • VVAS_VIDEO_FORMAT_BGRP_BF16

Entries in these sections use VVAS_VIDEO_FORMAT_* names. A format appears in GStreamer caps only when VVAS can map that VvasVideoFormat to a registered GStreamer video format string.

VVAS to GStreamer format strings

Conversions use gst_coreutils_get_gst_fmt_from_vvas() and vvas_format_gst_core_name_from_vvas() in gstvvascoreutils.c / gstvvascoreutils.h, with gst_video_format_from_string() for tensor format strings. The table lists each VvasVideoFormat with its GstVideoFormat and format nick.

Table 35 VvasVideoFormat to GstVideoFormat and format nick

VvasVideoFormat

GstVideoFormat

Format nick (caps string)

VVAS_VIDEO_FORMAT_Y_UV8_420

GST_VIDEO_FORMAT_NV12

NV12

VVAS_VIDEO_FORMAT_I420

GST_VIDEO_FORMAT_I420

I420

VVAS_VIDEO_FORMAT_BGR

GST_VIDEO_FORMAT_BGR

BGR

VVAS_VIDEO_FORMAT_RGB

GST_VIDEO_FORMAT_RGB

RGB

VVAS_VIDEO_FORMAT_YUY2

GST_VIDEO_FORMAT_YUY2

YUY2

VVAS_VIDEO_FORMAT_r210

GST_VIDEO_FORMAT_r210

r210

VVAS_VIDEO_FORMAT_v308

GST_VIDEO_FORMAT_v308

v308

VVAS_VIDEO_FORMAT_NV12_10LE32

GST_VIDEO_FORMAT_NV12_10LE32

NV12_10LE32

VVAS_VIDEO_FORMAT_I422_10LE

GST_VIDEO_FORMAT_I422_10LE

I422_10LE

VVAS_VIDEO_FORMAT_GRAY8

GST_VIDEO_FORMAT_GRAY8

GRAY8

VVAS_VIDEO_FORMAT_GRAY10_LE32

GST_VIDEO_FORMAT_GRAY10_LE32

GRAY10_LE32

VVAS_VIDEO_FORMAT_RGBx

GST_VIDEO_FORMAT_RGBx

RGBx

VVAS_VIDEO_FORMAT_BGRx

GST_VIDEO_FORMAT_BGRx

BGRx

VVAS_VIDEO_FORMAT_BGRA

GST_VIDEO_FORMAT_BGRA

BGRA

VVAS_VIDEO_FORMAT_RGBA

GST_VIDEO_FORMAT_RGBA

RGBA

VVAS_VIDEO_FORMAT_NV16

GST_VIDEO_FORMAT_NV16

NV16

VVAS_VIDEO_FORMAT_Y410

GST_VIDEO_FORMAT_Y410

Y410

VVAS_VIDEO_FORMAT_RGBP

GST_VIDEO_FORMAT_RGBP

RGBP

VVAS_VIDEO_FORMAT_BGRP

GST_VIDEO_FORMAT_BGRP

BGRP

VVAS_VIDEO_FORMAT_RGBx_BF16

GST_VIDEO_FORMAT_RGBX_BF16_C4

RGBX_BF16_C4

VVAS_VIDEO_FORMAT_BGRx_BF16

GST_VIDEO_FORMAT_BGRx_BF16_C4

BGRx_BF16_C4

VVAS_VIDEO_FORMAT_RGB_BF16

GST_VIDEO_FORMAT_RGB_BF16

RGB_BF16

VVAS_VIDEO_FORMAT_BGR_BF16

GST_VIDEO_FORMAT_BGR_BF16

BGR_BF16

VVAS_VIDEO_FORMAT_RGBP_BF16

GST_VIDEO_FORMAT_RGB_BF16P

RGB_BF16P

VVAS_VIDEO_FORMAT_BGRP_BF16

GST_VIDEO_FORMAT_BGR_BF16P

BGR_BF16P

VVAS_VIDEO_FORMAT_RGBx_FP16

GST_VIDEO_FORMAT_RGBX_FP16_C4

RGBX_FP16_C4

VVAS_VIDEO_FORMAT_BGRx_FP16

GST_VIDEO_FORMAT_BGRx_FP16_C4

BGRx_FP16_C4

VVAS_VIDEO_FORMAT_RGB_FP16

GST_VIDEO_FORMAT_RGB_FP16

RGB_FP16

VVAS_VIDEO_FORMAT_BGR_FP16

GST_VIDEO_FORMAT_BGR_FP16

BGR_FP16

VVAS_VIDEO_FORMAT_RGBP_FP16

GST_VIDEO_FORMAT_RGB_FP16P

RGB_FP16P

VVAS_VIDEO_FORMAT_BGRP_FP16

GST_VIDEO_FORMAT_BGR_FP16P

BGR_FP16P

VVAS_VIDEO_FORMAT_RGBP_FLOAT

GST_VIDEO_FORMAT_RGB_FLOATP

RGB_FLOATP

VVAS_VIDEO_FORMAT_BGRP_FLOAT

GST_VIDEO_FORMAT_BGR_FLOATP

BGR_FLOATP

VVAS_VIDEO_FORMAT_RGB_FLOAT

GST_VIDEO_FORMAT_RGB_FLOAT

RGB_FLOAT

VVAS_VIDEO_FORMAT_BGR_FLOAT

GST_VIDEO_FORMAT_BGR_FLOAT

BGR_FLOAT

VVAS_VIDEO_FORMAT_GRAY_BF16

GST_VIDEO_FORMAT_GRAY_BF16

GRAY_BF16

VVAS_VIDEO_FORMAT_GRAY_FP16

GST_VIDEO_FORMAT_GRAY_FP16

GRAY_FP16

VVAS_VIDEO_FORMAT_GRAY32_FLOAT

GST_VIDEO_FORMAT_GRAY_FLOAT

GRAY_FLOAT