acldvppJpegDecodeAsync

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

x

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

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

Prototype

1
2
3
4
5
aclError acldvppJpegDecodeAsync(acldvppChannelDesc *channelDesc,
const void *data,
uint32_t size,
acldvppPicDesc *outputDesc,
aclrtStream stream)

Parameters

Parameter

Input/Output

Description

channelDesc

Input

Pointer to the channel description.

Must be the same as the channelDesc argument passed to the acldvppCreateChannel call.

data

Input

Pointer to the input buffer address.

size

Input

Actual size of the input image, in bytes.

outputDesc

Input/Output

Pointer to the output image information.

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

When outputDesc is used as an output, you can obtain the decoding output from the buffer address and call the acldvppGetPicDesc series to obtain the width and height of the output image.

stream

Input

Stream. For details, see aclrtStream.

Returns

0 on successful task delivery; else, failure. For details, see aclError.

Restrictions

If the decoding output will be further processed (for example, cropped and resized by VPC), use the acldvppGetPicDesc calls to obtain the width and height of the output image, in case that the image width and height have been adjusted due to alignment requirements. For example, for JPEG (444) to YUV420SP decoding, if the input width and height are odd numbers, the output width and height are theoretically odd numbers. However, JPEGD will round down the output width and height to multiples of 2, as required by the YUV420SP format.

This restriction applies to the following product models:

Atlas inference products

Atlas 200I/500 A2 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas A3 training products / Atlas A3 inference products

Reference

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