vdec_release_frame

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

Destroys allocations after decoding is complete.

Prototype

  • C Prototype
    1
    hi_s32 hi_mpi_vdec_release_frame(hi_vdec_chn chn, const hi_video_frame_info *frame_info);
    
  • Python Function
    1
    ret = acl.himpi.vdec_release_frame(chn, frame_info)
    

Parameter Description

Parameter

Description

chn

Int, decoding channel ID.

  • Atlas inference products : The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256.
  • Atlas A2 training products / Atlas A2 inference products : The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256. Among them, a maximum of 256 JPEGD decoding channels and 32 VDEC decoding channels are supported.
  • Atlas 200I/500 A2 inference products : The value range of this parameter is [0, 128). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 128.
  • Atlas A3 training products / Atlas A3 inference products : The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256. Among them, a maximum of 256 JPEGD decoding channels and 32 VDEC decoding channels are supported.

frame_info

Dict, dictionary of decoded image information, which is obtained by calling vdec_get_frame. For details, see hi_video_frame_info.

Return Value Description

Return Value

Description

ret

Int, error code.

  • 0: success.
  • Other values: failures. For details, see VDEC/JPEGD Return Codes.
    • If no channel is created during image decoding, the error code HI_ERR_VDEC_UNEXIST is returned.
    • If the channel is destroyed when decoded images are being obtained, the error code HI_ERR_VDEC_UNEXIST is returned.
    • If the channel is reset when decoded images are being obtained, the error code HI_ERR_VDEC_UNEXIST is returned.
    • When decoded images are obtained in non-blocking mode, HI_ERR_VDEC_BUF_EMPTY is returned if there are no images in the buffer.
    • In timeout mode, if no hardware decoding result is fetched within the specified timeout interval, the error code HI_ERR_VDEC_BUF_EMPTY is returned. In this case, increase the timeout period or call this API repeatedly to obtain the decoding result.

Restrictions

  • Use this API in pair with acl.himpi.vdec_get_frame. Free the obtained data in a timely manner; otherwise, the decoding process will be blocked to wait for resources.
  • The data to be freed is that obtained by the acl.himpi.vdec_get_frame call without any change.

Reference

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