Function: dvpp_jpeg_decode_async

C Prototype

aclError acldvppJpegDecodeAsync(acldvppChannelDesc *channelDesc, const void *data, uint32_t size, acldvppPicDesc *outputDesc, aclrtStream stream)

Python Function

ret = acl.media.dvpp_jpeg_decode_async(dvpp_channel_desc, data, size, output_dvpp_pic_desc, stream)

Function Usage

Decodes a .jpg, .jpeg, .JPG, or .JPEG image. This API is asynchronous.

Input Description

dvpp_channel_desc: int, pointer address of the channel description. It must be the same as the dvpp_channel_desc argument passed to the acl.media.dvpp_create_channel call.

data: int, pointer address of the memory address of the input image.

size: int, actual size of the input image, in bytes.

output_dvpp_pic_desc: int, pointer address of the output image information.

When this argument is used as an output, the user can obtain the decoding output from the buffer address and call the acl.media.dvpp_get_pic_desc APIs to obtain the width and height of the output image.

stream: int, stream object.

Return Value

ret: int, error code.

  • 0 indicates the success of task delivery.
  • Other values indicate the failure of task delivery.

Restrictions

This API is asynchronous. The API call delivers a task rather than executes a task. After this API is called, call the synchronization API (for example, acl.rt.synchronize_stream) to ensure that the task is complete.

Reference

For details about the API call sequence and example, see JPEGD.