vdec_set_protocol_param

Function Usage

Sets protocol-specific memory allocation parameters of a channel, such as the slice, picture parameter set (PPS), and sequence parameter set (SPS).

This API is not supported in the current version. The function does not take effect. If this API is called, the return value is 0.

Prototype

  • C Prototype
    1
    hi_s32 hi_mpi_vdec_set_protocol_param(hi_vdec_chn chn, const hi_vdec_protocol_param* protocol_param);
    
  • Python Function
    1
    ret = acl.himpi.vdec_set_protocol_param(chn, protocol_param)
    

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.

protocol_param

Dict, dictionary of decoding channel parameters. For details, see hi_vdec_protocol_param.

Return Value Description

Return Value

Description

ret

Int, error code.

Restrictions

  • Ensure that a channel has been created. Otherwise, the error code HI_ERR_VDEC_UNEXIST is returned.
  • Ensure that the channel has stopped receiving streams. Otherwise, the error code HI_ERR_VDEC_NOT_PERM is returned.
  • When protocol parameters are updated, the decoder automatically resets the decoding channel.
  • The memory required by protocol parameters is dynamically allocated by the decoder using vmalloc based on the actual number of VPSs, SPSs, PPSs, or slices in the current stream. The maximum number of memories must be no greater than the maximum number of VPSs, SPSs, PPSs, or slices configured by this API.