Functions and Restrictions
Function Description
Table 1 describes the functions of media data processing V1 (Digital Vision Pre-Processing, DVPP).
|
Function |
Description |
|---|---|
|
Vision Preprocessing Core (VPC) |
Processes images, including cropping, resizing, and format conversion. For details, see VPC Restrictions. |
|
JPEG Decoder (JPEGD) |
Decodes .jpg, .jpeg, .JPG, and .JPEG images into YUV images. For details, see Functions and Restrictions. |
|
JPEG Encoder (JPEGE) |
Encodes YUV images into .jpg images. For details, see Functions and Restrictions. |
|
Video Decoder (VDEC) |
Decodes videos. For details, see Functions and Restrictions. |
|
Video Encoder (VENC) |
Encodes videos. For details, see Functions and Restrictions. |
|
PNG Decoder (PNGD) |
Decodes PNG images. For details, see Functions and Restrictions. |
Functions Supported by Each Product Model
Table 2 describes the functions of media data processing V1 supported by each product model.
- √: Supported
- x: Not supported
|
Model |
VPC |
JPEGD |
JPEGE |
PNGD |
VDEC |
VENC |
|---|---|---|---|---|---|---|
|
|
√ |
√ |
√ |
√ |
√ |
x |
|
|
√ |
√ |
√ |
√ |
√ |
√ |
|
|
√ |
√ |
√ |
√ |
√ |
√ |
|
|
√ |
√ |
√ |
√ |
√ |
x |
|
|
√ |
√ |
√ |
√ |
√ |
x |
|
|
x |
x |
x |
x |
x |
x |
Restrictions
When using the APIs described in this chapter, pay attention to the following points:
- About asynchronous APIs
For the asynchronous APIs described in this section, a successful API call only indicates the success of the task delivery, regardless of the execution result. For dependent APIs, you are advised to specify the same stream for multiple APIs to ensure the task execution sequence, because tasks in the same stream are executed in accordance with the API call sequence. After an asynchronous API is called, do not destroy the allocations immediately. Call the synchronization API (for example, aclrtSynchronizeStream) to confirm that the requested tasks of the device have been completed. To ensure performance, it is recommended that aclrtSynchronizeStream be called once after multiple asynchronous API tasks are delivered to a stream.
- About memory allocation and deallocation
- If device memory is needed to store the input or output data before implementing the VPC, JPEGD, and JPEGE functions for media data processing, call acldvppMalloc to allocate memory and acldvppFree to free memory. If multiple functions are used in cascade and the same memory segment needs to be reused, allocate the maximum allowed memory.
- The memory allocated in 1 can be used for media data processing and other tasks. For example, the output of media data processing can be used as the input of model inference to implement memory reuse and reduce memory copy.
- The address space accessed by media data processing is limited. You are advised to call the other memory allocation APIs, such as aclrtMalloc, to allocate memory for other functions (for example, model loading) to ensure sufficient memory during media data processing.
- About channel requirements
Before implementing each function of media data processing, you must call APIs to create corresponding channels. For details, see Channel Creation and Destruction. Channel creation and destruction involve resource allocation and deallocation. Repeated channel creation and destruction affect service performance. Therefore, you are advised to manage channels based on your actual scenario. For example, to process VPC images continuously, create VPC channels, wait until all VPC functions are called, and then destroy the VPC channels.
Too many channels would affect the CPU usage and memory usage of the device. For details about the number of channels, see the performance specifications in the corresponding function sections.
The following table lists the maximum number of channels for each media data processing function.