General Description
- About asynchronous interfaces
For the asynchronous interfaces described in this chapter, a successful interface call only indicates the success of the task delivery, regardless of the execution result. For dependent interfaces, you are advised to specify the same stream for multiple interfaces to ensure tasks execution sequence, because tasks in the same stream are executed in accordance with the interfaces calling sequence.
When asynchronous APIs are called to decode, crop, and resize images, if tasks depend on each other, call acl.rt.synchronize_stream to ensure that tasks in the stream are executed in order.
After an asynchronous API is called, resources cannot be released immediately. You need to call a synchronous API (for example, acl.rt.synchronize_stream) to confirm that the requested tasks of the device haven been completed.
- About memory allocation and release
If memory on the device is needed to store the input or output data before implementing the VPC, JPEGD, and JEPGE for media data processing, call acl.media.dvpp_malloc to allocate memory, and acl.media.dvpp_malloc to free memory.
- The following media data processing functions are provided:
- The vision preprocessing core (VPC): supports image cropping, resizing, overlaying, stitching, and format conversion. For details, see Functions and Restrictions.
- The JPEG decoder (JPEGD): decodes JPG, JPEG, JPG, and JPEG images into YUV images. For details, see Functions and Restrictions.
- The JPEG encoder (JPEGE): encodes YUV images into JPG images. For details, see Functions and Restrictions.
- The video decoder (VDEC): decodes videos. For details, see Functions and Restrictions.
- The video encoder (VENC): encodes videos. For details, see Functions and Restrictions.
- Except acl.media.dvpp_malloc and acld.media.dvpp_free, other APIs described in the Media Data Processing (media) chapter can be called only on the host side.