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

Video type to decode.

This is a static attribute.

mode

Stream feeding mode. This is a static attribute.

pic_width

Maximum channel width in pixels. This is a static attribute.

pic_height

Maximum channel height in pixels. This is a static attribute.

stream_buf_size

Buffer size for the input streams (in bytes).

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, that is, Width x Height x 1.5.

This is a static attribute.

frame_buf_size

Frame buffer size in bytes, for storing the decoded images. Invalid for JPEGD.

Must be at least 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. Invalid for JPEGD.

Value range: ≥ 0.

  • Generally, if this parameter is set to 0, VDEC automatically allocates an appropriate number of frame buffers based on the actual stream information.
  • If you want to limit the frame buffer size for VDEC decoding, set this parameter to a value greater than 0. Ensure that (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.

Considerations

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 4096 x 4096.