Function: dvpp_png_decode_async

Applicable Products

Product

Supported (√/x)

Ascend 950PR&950DT products

x

Atlas A3 products

√

Atlas A2 products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Decodes PNG images. This API is asynchronous. For details about the supported formats, see Table 1.

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

Prototype

  • C Prototype
    1
    aclError acldvppPngDecodeAsync(acldvppChannelDesc *channelDesc,const void *data,uint32_t size,acldvppPicDesc *outputDesc,aclrtStream stream)
    
  • Python Function
    1
    ret = acl.media.dvpp_png_decode_async(dvpp_channel_desc, data, size, output_desc, stream)
    

Parameters

Parameter

Description

dvpp_channel_desc

Int, pointer address of the channel description. It must be the same as the dvpp_channel_desc 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 inputting it, you need to:

When it is used as an output, the user can obtain the decoded output from the buffer address.

stream

Int, stream.

Return Values

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Constraints

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 the API call sequence and examples, see PNGD.