The VPC batch processing interface is used to reduce latency and improve performance.
Background
The media data processing section provides the following two types of APIs for operations such as image cropping and resizing:
- Processes one image at a time, for example, acldvppVpcCropAsync.
In this mode, if there are multiple input images, the for loop mode is used. acldvppVpcCropAsync is called for each image.
- Processes multiple images at a time (batch processing API), for example, acldvppVpcBatchCropAsync.
In this mode, if there are multiple input images, acldvppVpcBatchCropAsync needs to be called only once.
The following table lists the mapping between the preceding two types of interfaces.
Processing a Single Image |
Batch Image Processing APIs |
|---|---|
acldvppVpcCropAsync (Image Cropping) |
acldvppVpcBatchCropAsync (batch cropping) |
acldvppVpcCropResizeAsync (Image Cropping and Resizing) |
acldvppVpcBatchCropResizeAsync (Batch Cropping and Resizing) |
acldvppVpcCropAndPasteAsync (Image Cropping and Pasting) |
acldvppVpcBatchCropAndPasteAsync (Batch Cropping and Pasting) |
acldvppVpcCropResizePasteAsync (Cropping, Resizing, and Pasting) |
acldvppVpcBatchCropResizePasteAsync (Batch Cropping, Resizing, and Pasting) |
- |
acldvppVpcBatchCropResizeMakeBorderAsync (Batch Cropping, Resizing, and Filling) |
Principles
The AI processor has a built-in image processing unit DVPP (Digital Video Pre-Processing). In DVPP, there are multiple VPC (Vision Preprocessing Core) modules, which are used to process tasks such as image cropping, resizing, and format conversion.
When a batch processing API is called, batch tasks are evenly distributed to multiple VPC modules for parallel processing, reducing the processing delay and improving performance.