Function: dvpp_png_decode_async

C Prototype

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

Python Function

ret = acl.media.dvpp_png_decode_async(dvpp_channel_desc, data, size, output_desc, stream)

Function Usage

Asynchronous API for decoding PNG images. For details about the supported formats, see Table 1.

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_desc: int, pointer address of the output image information.

When this argument is used as an input, the user needs to:

When this argument is used as an output, the user can obtain the decoding output from the buffer address.

stream: int, stream.

Return Value

ret: int, error code.

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 PNGD.

Table 1 Supported formats

Function

Input Format

Output Format

Set the output format to PIXEL_FORMAT_UNKNOWN.

That is, the output image has the same format as the input image.

RGB/GRAY

RGB

Set the output format to PIXEL_FORMAT_UNKNOWN.

That is, the output image has the same format as the input image.

RGBA/AGRAY

RGBA

Set the output format to PIXEL_FORMAT_RGB_888. That is, the input image is converted to a specified format for output.

RGB/RGBA/GRAY/AGRAY

RGB