acldvppJpegEncodeAsync

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

Encodes a YUV image into a JPG image. This API is asynchronous.

Prototype

1
2
3
4
5
6
aclError acldvppJpegEncodeAsync(acldvppChannelDesc *channelDesc,
acldvppPicDesc *inputDesc,
const void *data,
uint32_t *size,
acldvppJpegeConfig *config,
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.

inputDesc

Input

Pointer to the input image description.

data

Output

Pointer to the output buffer address for storing encoded data.

size

Input/Output

Pointer to the output buffer size in bytes.

When size is used as an input, call acldvppJpegPredictEncSize to estimate the output buffer size in advance.

When size is used as an output, it indicates the actual output buffer size, which may be different from that estimated by the acldvppJpegPredictEncSize call. The actual output buffer size should apply.

config

Input

Pointer to the image encoding configuration.

Call acldvppCreateJpegeConfig to create an image encoding configuration, and call acldvppSetJpegeConfigLevel to set the encoding configuration.

stream

Input

Stream. For details, see aclrtStream.

Returns

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

Reference

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