Using Multi-function APIs of VPC to Optimize System Scheduling

Background

AscendCL media data processing provides the following types of APIs for image cropping, resizing, pasting, and padding:

The following table lists the mapping between single-function APIs and multi-function APIs.

Single-function API

Multi-function API

acldvppVpcBatchCropResizeMakeBorderAsync (batch cropping, resizing, and padding)

Principles

One API requires several task interactions between the host and device, and each interaction has a delay. If APIs are called for multiple times for implementing multiple functions such as image cropping and resizing, the number of task interactions between the host and device increases, leading to more delay.

By comparison, using a multi-function API to implement multiple functions at once reduces the number of scheduling times between the host and device and the processing times on the device, greatly optimizing the system performance.

Sample

The following uses batch image cropping and resizing as an example to describe how to call the multi-function API acldvppVpcBatchCropResizeAsync. Click here to obtain the complete code.