Function: dvpp_png_predict_dec_size

C Prototype

aclError acldvppPngPredictDecSize(const void *data, uint32_t dataSize, acldvppPixelFormat outputPixelFormat, uint32_t *decSize)

Python Function

dec_size ,ret = acl.media.dvpp_png_predict_dec_size(data, data_size, output_pixel_format)

Function Usage

Predicts the output buffer allocation required for PNG decoding based on the memory of the input PNG image.

Input Description

data: int, pointer address of the memory location that stores the PNG image data.

data_size: int, buffer size, in bytes.

output_pixel_format: int, format of the decoded output image:

  • PIXEL_FORMAT_UNKNOWN: maximum buffer size calculated based on the PNG decoding output format.

  • PIXEL_FORMAT_RGB_888

  • PIXEL_FORMAT_RGBA_8888

Return Value

dec_size: int, output buffer size required for the decoded PNG image, in bytes.

ret: int, error code.

Reference

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