hi_vdec_video_attr

Description

Defines the video decoding attributes.

Prototype

typedef struct {
    hi_u32 ref_frame_num;  
    hi_bool temporal_mvp_en; 
    hi_u32 tmv_buf_size; 
}hi_vdec_video_attr;

Members

Member

Description

ref_frame_num

Number of reference frames, which is used to determine how many reference frames are required for decoding. This is a static attribute.

This parameter has a significant impact on video buffer (VB) memory block usage. Set this parameter based on actual requirements. If the set value is greater than the number of reference frames in the actual stream, the system adjusts the value based on the actual number to save the buffer. However, the adjusted value cannot be greater than the value of this parameter.

Value range: [0, 16], in frames.

temporal_mvp_en

Whether to support temporal motion vector prediction. 0 means supported, and 1 means not supported.

To skip decoding B-frames in H.264 streams, or to skip decoding H.265 streams with temporal MVP support (sps_temporal_mvp_enabled_flag = 1), set temporal_mvp_en to 0. When this attribute is set to 0, VB allocation for the temporal motion vector (TMV) output is spared, which is memory-saving.

Note: When calling hi_mpi_vdec_set_chn_param to set channel parameters, hi_video_dec_mode can only be set to HI_VIDEO_DEC_MODE_IPB (decoding I, P, and B frames). Therefore, when decoding H.264 streams, temporal_mvp_en can only be set to 1.

tmv_buf_size

Size of the TMV buffer for storing decoded video images (in bytes). This parameter is valid when temporal_mvp_en is set to 1. You can call hi_vdec_get_tmv_buf_size to obtain the size.