acldvppJpegDecodeAsync
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
☓ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Function Description
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. The value must be the same as that of channelDesc specified when the acldvppCreateChannel API is called to create a channel. |
|
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 description. 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 about the type definition, see aclrtStream. |
Returns
If the return value is 0, the task is successfully delivered. If the return value is not 0, the task fails to be delivered. For details, see aclError.
Restrictions
If the decoded output image data needs to be used in subsequent operations (for example, cropping and resizing with VPC), you are advised to call acldvppGetPicDesc series APIs to obtain the width and height of the output image after decoding, because the width and height may be aligned during decoding. For example, if a JPEG (444) source image is decoded into a YUV420SP output image and the width and height of the JPEG (444) source image are odd numbers, theoretically, the width and height of the decoded YUV420SP output image should be odd numbers. However, the YUV420SP format requires that the width and height of the image be even numbers. In this case, the JPEGD rounds down the odd width and height to the nearest multiple of 2.
This restriction applies to the following product models: