hi_vdec_chn_attr

Description

Defines the decoding channel attributes.

Prototype

typedef struct {
    hi_payload_type type;          
    hi_vdec_send_mode mode;           
    hi_u32 pic_width;                  
    hi_u32 pic_height;                 
    hi_u32 stream_buf_size;          
    hi_u32 frame_buf_size;           
    hi_u32 frame_buf_cnt;           

    union {
        hi_vdec_video_attr video_attr; 
    };
}hi_vdec_chn_attr;

Members

Member

Description

type

Decoding protocol type.

This is a static attribute.

mode

Stream sending mode. This is a static attribute.

In the VDEC video decoding scenario, H.264/H.265 streams can be sent only by frame. In the JPEG image decoding scenario, this parameter is reserved.

In the VDEC video decoding scenario, H.264/H.265 streams can be sent only by frame. In the JPEG image decoding scenario, this parameter is reserved.

In the VDEC video decoding scenario, H.264/H.265 streams can be sent only by frame. In the JPEG image decoding scenario, this parameter is reserved.

In Atlas inference product, H.264/H.265/JPEG streams can be sent only by frame.

pic_width

Maximum decoded image width supported by the channel (in pixels). This is a static attribute.

This parameter is reserved for JPEG image decoding.

This parameter is reserved for JPEG image decoding.

This parameter is reserved for JPEG image decoding.

pic_height

Maximum decoded image height supported by the channel (in pixels). This is a static attribute.

This parameter is reserved for JPEG image decoding.

This parameter is reserved for JPEG image decoding.

This parameter is reserved for JPEG image decoding.

stream_buf_size

Buffer size for the input streams.

The value (in bytes) must be greater than or equal to 3/4 of the decoding channel size (Width x Height), that is, half of the YUV420 image size (Width x Height x 3/2 x 1/2), and less than or equal to 1024 x 1024 x 1024 (bytes).

Recommended value: size of a decoded YUV420 image, channel width x channel height x 1.5.

This is a static attribute.

frame_buf_size

Size of the frame buffer for storing decoded images, in bytes. This parameter does not need to be set for JPEGD image decoding.

Value range: ≥ 0.

When the value is 0, VDEC automatically allocates proper frame buffers based on the input stream. When the value is greater than 0, the following condition must be met; otherwise, decoding fails: Frame buffer size x Number of reference frames ≥ Required minimum frame buffer size x Number of required minimum reference frames. The required minimum frame buffer size can be obtained by the hi_vdec_get_pic_buf_size call, which takes arguments including the width, height, and bit width of the input stream as specified in the sequence parameter set (SPS) of the stream.

frame_buf_cnt

Number of frame buffers for decoded images. This parameter does not need to be set for JPEGD image decoding.

Value range: ≥ 0.

When this parameter is set to 0, the VDEC automatically allocates a proper number of frame buffers based on the actual stream information. If you want to limit the size of the VDEC decoding frame buffer, set this parameter to a value greater than 0. Ensure that the following condition is met: Frame buffer size x Number of reference frames > Required minimum frame buffer size x Required minimum number of reference frames. Otherwise, decoding fails. The number of reference frames is specified in the SPS of the stream. Number of required minimum reference frames for H.264/H.265 decoding = Number of reference frames + Number of display frames + 1.

video_attr

Attributes of the H.264/H.265 video decoding channel.

Precautions

Set the channel width and height to the actual values if possible. If the stream width and height are unknown, set them to the maximum, which is 8192 x 16384.