Function: dvpp_png_predict_dec_size

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

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

Prototype

  • C Prototype
    1
    aclError acldvppPngPredictDecSize(const void *data,uint32_t dataSize,acldvppPixelFormat outputPixelFormat,uint32_t *decSize)
    
  • Python Function
    1
    dec_size ,ret = acl.media.dvpp_png_predict_dec_size(data, data_size, output_pixel_format)
    

Parameter Description

Parameter

Description

data

Int, pointer address of the buffer 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: the format that requires the maximum allocation.

  • PIXEL_FORMAT_RGB_888

  • PIXEL_FORMAT_RGBA_8888

Return Value Description

Return Value

Description

dec_size

Int, output buffer size in bytes required for the decoded PNG image.

ret

Int, error code: 0 on success; else, failure.

Reference

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