Overview
API Differences Between Versions
- V2 has more functions than V1. For example:
- JPEGE: The APIs in the V2 version support advanced parameter configuration, such as Huffman table configuration.
- VENC: The APIs in the V2 version support more refined configuration of bit rate control parameters and effect tuning, such as the QP of I-/P-frames and macroblock bit rate control.
- VDEC: The APIs in the V2 version support more refined memory control, such as the setting of the input stream buffer.
- Video data obtaining (ISP system control, MIPI command, and VI function): supported only by the APIs in the V2 version.
- VPSS video processing: supported only by the APIs in the V2 version.
- Audio-related functions, including recording, playing, and volume adjustment: supported only by the APIs in the V2 version.
- Video data display (VO function and HDMI peripheral): supported only by the APIs in the V2 version.
- V2 APIs are recommended, which guarantee continuous evolution of API functions and services in later versions.
- V1 APIs are retained for backward compatibility considerations, but will be deprecated in later versions.
Typical Functions
The following table describes the functions. For details about the functions of different media data processing versions supported by each product model, see Function Support. AIPP is supported by all versions.
Function Support
The following table describes the functions of media data processing V2 supported by each product model.
- √: Yes
- x: Not supported
|
Model |
VPC |
JPEGD |
JPEGE |
PNGD |
VDEC |
VENC |
Video Data Obtaining |
VPSS Video Processing |
Audio Functions (Recording/Playing/Volume Adjustment) |
Video Data Display |
Region Management |
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
|
|
√ |
√ |
√ |
√ |
√ |
√ |
x |
x |
x |
x |
x |
|
|
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
|
|
√ |
√ |
√ |
√ |
√ |
x |
x |
x |
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 memory allocation and deallocation:
- Before implementing some media data processing functions such as VPC, JPEGD, and JPEGE, you need to allocate memory to store the input or output data. The media data processing functions have higher requirements on the memory for storing the input and output data. Therefore, you need to call dedicated memory allocation APIs. For details, see the restrictions in sections that describe the functions. 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. See the channel creation and destruction APIs in Vision Preprocessing Core (VPC), Video Decoder (VDEC) and JPEG Decoder (JPEGD), Video Encoding (VENC) and JPEG Encoder (JPEGE), and PNG Decoder (PNGD) to learn about the API descriptions and the maximum number of channels.
Channel creation and destruction involve resource allocation and release. Repeated channel creation and destruction, however, 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.
- This section describes the structs and enumerations. The reserved fields must be manually set to 0 to avoid incompatibility with future versions.
The reserved fields in the structs and enumerations contain a _BUTT suffix, for example, HI_COMPRESS_MODE_BUTT.