hi_venc_rc_param
Description
Defines the advanced RC parameters of an encoding channel.
Prototype
typedef struct {
hi_u32 threshold_i[HI_VENC_TEXTURE_THRESHOLD_SIZE];
hi_u32 threshold_p[HI_VENC_TEXTURE_THRESHOLD_SIZE];
hi_u32 threshold_b[HI_VENC_TEXTURE_THRESHOLD_SIZE];
hi_u32 direction;
hi_u32 row_qp_delta;
hi_s32 first_frame_start_qp;
hi_venc_scene_chg_detect scene_chg_detect;
union {
hi_venc_h264_cbr_param h264_cbr_param;
hi_venc_h264_vbr_param h264_vbr_param;
hi_venc_h264_avbr_param h264_avbr_param;
hi_venc_h264_qvbr_param h264_qvbr_param;
hi_venc_h264_cvbr_param h264_cvbr_param;
hi_venc_h265_cbr_param h265_cbr_param;
hi_venc_h265_vbr_param h265_vbr_param;
hi_venc_h265_avbr_param h265_avbr_param;
hi_venc_h265_qvbr_param h265_qvbr_param;
hi_venc_h265_cvbr_param h265_cvbr_param;
hi_venc_mjpeg_cbr_param mjpeg_cbr_param;
hi_venc_mjpeg_vbr_param mjpeg_vbr_param;
};
}hi_venc_rc_param;
Members
Member |
Description |
|---|---|
threshold_i |
MADi threshold for the macroblock-level bit rate of I-frames, used to measure the spatial texture complexity of the current frame. Value range: [0, 255] Default value: [0, 0, 0, 0, 3, 3, 5, 5, 8, 8, 8, 15, 15, 20, 25, 25] If the value of the subtraction direction is set to 0 or the value of the addition direction is set to 255, the current profile is disabled. |
threshold_p |
MADi threshold for the macroblock-level bit rate of P-frames. Value range: [0, 255] Default value: [0, 0, 0, 0, 3, 3, 5, 5, 8, 8, 8, 15, 15, 20, 25, 25] If the value of the subtraction direction is set to 0 or the value of the addition direction is set to 255, the current profile is disabled. |
threshold_b |
MADi threshold for the macroblock-level bit rate of B-frames. Value range: [0, 255] Default value: [0, 0, 0, 0, 3, 3, 5, 5, 8, 8, 8, 15, 15, 20, 25, 25] If the value of the subtraction direction is set to 0 or the value of the addition direction is set to 255, the current profile is disabled. |
direction |
Addition or subtraction direction control during texture-based macroblock-level bit rate control Value range: [0, 16] Default value: 8 For example, direction=7 indicates that the first seven parameters including threshold_i, threshold_p, and threshold_b are used for QP subtraction, and the last nine parameters are used for QP addition. |
row_qp_delta |
Indicates the maximum row-level adjustment range within one frame. The unit is the macroblock row. A larger adjustment amplitude indicates that the allowed QP row-level adjustment range is larger and the bit rate is more stable. In the scenarios where the picture complexity is unevenly distributed, the picture quality may be uneven if the value of this parameter is too large. Value range: [0, 10]. The value 0 indicates that row-based macroblock-level bit rate control is disabled. Default value: 1 |
first_frame_start_qp |
Start QP of the first frame. Valid in CBR, VBR, AVBR, QVBR, or CVBR mode. The "first frame" here indicates the upcoming first IDR frame when a channel is created, the GOP mode is updated, the RC mode is updated, or the resolution is updated. first_frame_start_qp has no effect on a re-encoded frame, which is not considered as the "first frame". Must be –1 or in the range of [MinIQP, MaxIQP]. MinIQP and MaxIQP are set in the advanced RC parameter struct of the corresponding RC mode. Defaults to –1, indicating that the start QP of the first frame is internally calculated by the encoder. In the scenario with a low bit rate and a few moving objects, you can reduce the value of this parameter to improve the encoding quality. For example, in the scenario where the resolution is 352 x 288, the frame rate is 25 FPS, and the GOP is 50, you can set first_frame_start_qp to 32 and max_reencode_times to 0, indicating that re-encoding is not performed. |
scene_chg_detect |
Adaptive scene detection enable, which helps stabilize the bit rate during encoding scene transitions. Valid in VBR, AVBR, QVBR, or CVBR mode. Also enable adaptively inserting IDR frames so that IDR frames can be encoded during scene transitions. Note that scene detection becomes invalid when re-encoding is disabled. It is recommended using this parameter in SCENE_0 mode. |
h264_cbr_param |
Advanced CBR parameter of an H.264 channel. |
h264_vbr_param |
Advanced VBR parameter an H.264 channel. |
h264_avbr_param |
Advanced AVBR parameter of an H.264 channel. |
h264_qvbr_param |
Advanced QVBR parameter of an H.264 channel. |
h264_cvbr_param |
Advanced CVBR parameter of an H.264 channel. |
h265_cbr_param |
Advanced CBR parameter of an H.265 channel. |
h265_vbr_param |
Advanced VBR parameter an H.265 channel. |
h265_avbr_param |
Advanced AVBR parameter of an H.265 channel. |
h265_qvbr_param |
Advanced QVBR parameter of an H.265 channel. |
h265_cvbr_param |
Advanced CVBR parameter of an H.265 channel. |
mjpeg_cbr_param |
Advanced parameter of the CBR control mode for an MJPEG channel. Reserved. |
mjpeg_vbr_param |
Advanced parameter of the VBR control mode of an MJPEG channel. Reserved. |