Function: dvpp_jpeg_predict_enc_size

C Prototype

aclError acldvppJpegPredictEncSize(const acldvppPicDesc *inputDesc, const acldvppJpegeConfig *config, uint32_t *size)

Python Function

size, ret = acl.media.dvpp_jpeg_predict_enc_size(input_dvpp_pic_desc, config)

Function Usage

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

Input Description

input_dvpp_pic_desc: int, pointer address of the description of input images.
  • Call acl.media.dvpp_create_pic_desc to create an 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

size: int, predicted size of the output buffer required for the encoded JPEG image, in bytes.

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.

Reference

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