# qtimlvconverter
Source: [https://docs.qualcomm.com/doc/80-70020-50/topic/qtimlvconverter.html](https://docs.qualcomm.com/doc/80-70020-50/topic/qtimlvconverter.html)
The qtimlvconverter plugin transforms the incoming video buffers into neural-network
tensors while performing necessary format conversion and resizing in the process. To achieve
these operations, the plugin uses the GPU hardware and ION/DMA allocated
buffers.
For floating point tensors, the mean and sigma properties are required to transform the
8-bit unsigned integer images from the video source using the formula:
(channel - mean) × sigma where channel is the value
for Red, Green, Blue, or Alpha channels of the color converted input.
For example, the following table lists mean and sigma properties that impact the channel
transformation of an image:
| Properties | RGB image with channel transformation |
| --- | --- |
| R=255, G=127, B=0 | R=(255 - 128.0) x 0.75, G=(127 - 156.0)
x 0.34, B=(0 - 124.0) x 0.02 |
| mean="<128.0, 156.0, 124.0, 58.0>" | R=(255 - 128.0) x 0.75, G=(127 - 156.0)
x 0.34, B=(0 - 124.0) x 0.02 |
| sigma="<0.75, 0.34, 0.02, 0.07>" | R=(255 - 128.0) x 0.75, G=(127 - 156.0)
x 0.34, B=(0 - 124.0) x 0.02 |
| | |
| | |
The subpixel-layout property specifies the arrangement of the image pixels in the output
tensor.
The plugin uses Qualcomm IB2C library for all conversion operations. This library is
wrapped inside the custom GstGlesVideoConverter abstraction layer with APIs to create,
configure, and process the incoming and outgoing buffers.
GstMLBufferPool, a custom buffer pool class, can do the following:
- Assign the output buffers.
- Assign ION buffers through IOCTL commands to the kernel.
Figure : Gstbuffer workflow with qtimlvconverter
## Inheritance chain
[GObject](https://docs.gtk.org/gobject/) → [GstObject](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html?gi-language=c) → [GstElement](https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c) → [GstBaseTransform](https://gstreamer.freedesktop.org/documentation/base/gstbasetransform.html?gi-language=c) → GstMLVideoConverter
The following tables provide information on pad templates and element properties of
qtimlvconverter. For use cases, see [LiteRT use cases](https://docs.qualcomm.com/doc/80-70020-50/topic/tensorflow-lite-use-cases.html)
and [Qualcomm Neural Processing SDK use cases](https://docs.qualcomm.com/doc/80-70020-50/topic/qualcomm-neural-processing-sdk-use-cases.html).
## Pad configuration
| Pad Name | Capabilities | Capabilities | Capabilities |
| --- | --- | --- | --- |
| SINK template: 'sink'
*Availability:* Always
*Direction:* sink | video/x-raw | format: | { (string)RGBA, (string)BGRA, (string)ABGR, (string)ARGB,
(string)RGBx, (string)BGRx, (string)xRGB, (string)xBGR, (string)BGR,
(string)RGB, (string)GRAY8, (string)NV12, (string)NV21,
(string)YUY2, (string)UYVY } |
| SINK template: 'sink'
*Availability:* Always
*Direction:* sink | video/x-raw(memory:GBM) | format: | { (string)RGBA, (string)BGRA, (string)ABGR, (string)ARGB,
(string)RGBx, (string)BGRx, (string)xRGB, (string)xBGR, (string)BGR,
(string)RGB, (string)GRAY8, (string)NV12, (string)NV21,
(string)YUY2, (string)UYVY } |
| SRC template: 'src'
*Availability:* Always
*Direction:* source | neural-network/tensors | type: | { (string)UINT8, (string)INT32, (string)FLOAT16, (string)FLOAT32
} |
| | | | |
## Element configuration
Table : Element properties for qtimlvconverter
| Property | Description |
| --- | --- |
| name | The name of the object.
Enum "GstMLVideoPixelLayout" Default: 0, "regular"