vdec_get_pic_buf_size

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas training products

x

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Obtains the buffer size required for image decoding.

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.

Prototype

  • C Prototype
    1
    hi_u32 hi_vdec_get_pic_buf_size(hi_payload_type type, hi_pic_buf_attr *buf_attr);
    
  • Python Function
    1
    ret = acl.himpi.vdec_get_pic_buf_size(type, buf_attr)
    

Parameter Description

Parameter

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 Description

Return Value

Description

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.

Reference

For the API call sequence, see JPEGE, and VENC.