hi_venc_h264_qvbr_param
Description
Defines the advanced QVBR parameters of an H.264 encoding channel.
Definition
typedef struct {
hi_u32 max_i_proportion;
hi_u32 min_i_proportion;
hi_s32 max_reencode_times;
hi_bool qpmap_en;
hi_u32 max_qp;
hi_u32 min_qp;
hi_u32 max_i_qp;
hi_u32 min_i_qp;
hi_s32 max_bit_percent;
hi_s32 min_bit_percent;
hi_s32 max_psnr_fluctuate;
hi_s32 min_psnr_fluctuate;
} hi_venc_h264_qvbr_param;
Members
When the real-time PSNR is less than max_psnr_fluctuate, increase the target bit rate. The maximum bit rate is target_bit_rate * max_bit_percent.
When the real-time PSNR is greater than max_psnr_fluctuate, decrease the target bit rate. The minimum bit rate is target_bit_rate * min_bit_percent.
The target bit rate is adjusted between the maximum bit rate and the minimum bit rate based on the current PSNR. When the PSNR value range exceeds [min_psnr_fluctuate – 4, max_psnr_fluctuate + 4] ∩ [20, 40], the PSNR does not take effect.
max_qp and min_qp are used to control the image quality. The bit rate control takes the QP clamping as the highest priority, and bit rate control becomes invalid if the range of [min_qp, max_qp] is exceeded.
The priority of the upper and lower bit rate limits is higher than the priority of the PSNR. For example, if the bit rate reaches the upper limit but still fails to meet the PSNR requirement, the bit rate stops increasing.
target_bit_rate is a member variable in the hi_venc_chn_attr.rc_attr struct and is set during VENC channel creation.
Member |
Description |
|---|---|
min_i_proportion |
Reserved. |
max_i_proportion |
Maximum ratio of bits allocated to I-frames and P-frames. Value range: [1, 100] Default value: 100 |
max_reencode_times |
Number of times that each frame is re-encoded. If set to 0, disables re-encoding. Value range: [0, 3] Default value: 2 |
qpmap_en |
Reserved. |
max_qp |
Maximum QP of P-frames and B-frames. Value range: [min_qp, 51] Default value: 51 |
min_qp |
Minimum QP of P-frames and B-frames. Value range: [0, 51] Default value: 16 |
max_i_qp |
Maximum QP of I-frames. Value range: [min_i_qp, 51] Default value: 51 |
min_i_qp |
Minimum QP of I-frames. Value range: [0, 51] Default value: 16 |
max_bit_percent |
Upper limit of the bit rate percentage. Value range: [min_bit_percent, 180] Default value: 110 |
min_bit_percent |
Lower limit of the bit rate percentage. Value range: [30, 180] Default value: 45 |
max_psnr_fluctuate |
Upper limit of the PSNR. Value range: [min_psnr_fluctuate, 40] Default value: 40 |
min_psnr_fluctuate |
Lower limit of the PSNR. Value range: [18, 40] Default value: 23 |