Estimated Output Buffer Size

Ascend 310 acldvpp API

Ascend 310P hi_mpi API

What You Need to Do

Estimate the output buffer size:

acldvppPngPredictDecSize

For decoding in the source format, the hi_mpi_png_get_image_info API can be called to obtain the size of the decoding output buffer.

In other scenarios, use the following formula to calculate the output buffer size: hi_img_info.width_stride x hi_img_info.height_stride.

You need to modify the code to use hi_mpi_png_get_image_info or the formula to obtain the size of the output buffer after image decoding.

Note: For details about the value requirements of width_stride and height_stride, see Restrictions on Image Formats, Width and Height Alignment, and Buffers.