vdec_get_pic_buf_size

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

x

Atlas inference product

Atlas 200I/500 A2 inference product

Description

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.

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)
    

Parameters

Parameter

Description

type

int, decoding 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

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 details about the API call sequence, see JPEGE and VENC.