acl.himpi.vdec_get_pic_buf_size

C Prototype

hi_u32 hi_vdec_get_pic_buf_size(hi_payload_type type, hi_pic_buf_attr *buf_attr);

Python Function

ret = acl.himpi.vdec_get_pic_buf_size(type, buf_attr)

Function Usage

Obtains the requested output buffer allocation.

This function is used in the following scenarios: calculating the size of the internal buffer required for video decoding (configure the related channel parameters during initialization); calculating the output buffer for image decoding.

The Atlas 200/300/500 Inference Product does not support this API in the current version.

The Atlas Training Series Product does not support this API in the current version.

Input Description

type: int, decoded video type. Currently, HI_PT_H264, HI_PT_H265 and HI_PT_JPEG are supported. For details, see hi_payload_type.

buf_attr: dict, image parameter dictionary. For details, see hi_pic_buf_attr.

Return Value

ret: int, image size required for image storage.

  • A non-zero value indicates the size of the image to be stored.
  • For HI_PT_JPEG decoding (using JPEGD), if pixel_format is set to an unsupported format or HI_PIXEL_FORMAT_UNKNOWN, the value 0 is returned.

Restrictions

This API calculates the size of the output image buffer.