Function: dvpp_jpeg_predict_enc_size

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

Predicts the output buffer size required for the encoded image based on the input image description and image encoding configuration data.

Prototype

  • C Prototype
    1
    aclError acldvppJpegPredictEncSize(const acldvppPicDesc *inputDesc, const acldvppJpegeConfig *config, uint32_t *size)
    
  • Python Function
    1
    size, ret = acl.media.dvpp_jpeg_predict_enc_size(input_dvpp_pic_desc, config)
    

Parameters

Parameter

Description

input_dvpp_pic_desc

Int, pointer address of the description of input images.
  • Call the acl.media.dvpp_create_pic_desc API to create the image description.
  • Call the acl.media.dvpp_set_pic_desc APIs to set image description parameters (such as the image format, width, and height).

config

Int, pointer address of the image encoding configuration.

Call acl.media.dvpp_create_jpege_config to create image encoding configuration data.

Return Value

Return Value

Description

size

Int, predicted allocation in bytes for the output image.

The predicted size is greater than what is actually needed, which can be obtained from the size parameter returned by the acl.media.dvpp_jpeg_encode_async call.

ret

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

Reference

For details about the API call sequence and examples, see JPEGD.