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:
Name component |
Meaning |
|---|---|
|
Channel order of the tensor data. |
|
Tensor precision. |
|
Planar tensor data. For RGB and BGR this corresponds to three planes, such as R, G, B or B, G, R. |
|
Packed 4-channel RGB tensor data with a padding channel, used for
|
|
Packed 4-channel BGR tensor data with a padding channel, used for
|
|
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, andBGRx_FP16_C4.VVAS APIs and image-processing configuration files use
VvasVideoFormatnames such asVVAS_VIDEO_FORMAT_RGBx_BF16andVVAS_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.
model-format |
Tensor layout |
Data type |
GStreamer format |
|---|---|---|---|
RGB |
NCHW |
FLOAT32 |
|
RGB |
NHWC |
FLOAT32 |
|
RGB |
NCHW |
INT8 |
|
RGB |
NHWC |
INT8 |
|
RGB |
HCWNC4 |
INT8 |
|
RGB |
NCHW |
BF16 |
|
RGB |
NHWC |
BF16 |
|
RGB |
HCWNC4 |
BF16 |
|
RGB |
NCHW |
FP16 |
|
RGB |
NHWC |
FP16 |
|
RGB |
HCWNC4 |
FP16 |
|
BGR |
NHWC |
FLOAT32 |
|
BGR |
NHWC |
INT8 |
|
BGR |
NCHW |
BF16 |
|
BGR |
NHWC |
BF16 |
|
BGR |
HCWNC4 |
BF16 |
|
BGR |
NCHW |
FP16 |
|
BGR |
NHWC |
FP16 |
|
BGR |
HCWNC4 |
FP16 |
|
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_RGBxVVAS_VIDEO_FORMAT_Y_UV8_420VVAS_VIDEO_FORMAT_RGBVVAS_VIDEO_FORMAT_GRAY8VVAS_VIDEO_FORMAT_BGRxVVAS_VIDEO_FORMAT_BGRVVAS_VIDEO_FORMAT_RGBPVVAS_VIDEO_FORMAT_BGRP
[output-color-formats]for formats produced by the hardware image-process library.VVAS_VIDEO_FORMAT_RGBxVVAS_VIDEO_FORMAT_Y_UV8_420VVAS_VIDEO_FORMAT_RGBVVAS_VIDEO_FORMAT_GRAY8VVAS_VIDEO_FORMAT_BGRxVVAS_VIDEO_FORMAT_BGRVVAS_VIDEO_FORMAT_RGBPVVAS_VIDEO_FORMAT_BGRPVVAS_VIDEO_FORMAT_RGB_FLOATVVAS_VIDEO_FORMAT_RGBP_FLOATVVAS_VIDEO_FORMAT_BGRP_FLOATVVAS_VIDEO_FORMAT_BGR_FLOATVVAS_VIDEO_FORMAT_GRAY32_FLOATVVAS_VIDEO_FORMAT_RGBx_BF16VVAS_VIDEO_FORMAT_BGRx_BF16VVAS_VIDEO_FORMAT_GRAY_BF16VVAS_VIDEO_FORMAT_RGB_BF16VVAS_VIDEO_FORMAT_BGR_BF16VVAS_VIDEO_FORMAT_GRAY_FP16VVAS_VIDEO_FORMAT_RGB_FP16VVAS_VIDEO_FORMAT_BGR_FP16VVAS_VIDEO_FORMAT_RGBx_FP16VVAS_VIDEO_FORMAT_BGRx_FP16VVAS_VIDEO_FORMAT_RGBP_FP16VVAS_VIDEO_FORMAT_RGBP_BF16VVAS_VIDEO_FORMAT_BGRP_FP16VVAS_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.
|
|
Format nick (caps string) |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|