[mpp_enc]: Use qp config in rc to setup encoder

1. Unify H.264/H.265/vp8 qp config
2. H.264/H.265 encoder setup default rc qp config.
3. Move rc_cfg process all to mpp_enc module.
4. Fix some encoder config in encoder test.

Change-Id: I2a31c6abf904f1c16c2acd937c8d467d48db531d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2021-01-06 08:56:49 +08:00
parent f04fabc136
commit 17e3a2fefd
10 changed files with 341 additions and 608 deletions

View File

@@ -558,6 +558,12 @@ static MPP_RET mpi_rc_enc_init(MpiRc2TestCtx *ctx)
rc_cfg->fps_out_flex = 0;
rc_cfg->gop = 60;
rc_cfg->max_reenc_times = 1;
if (rc_cfg->rc_mode == MPP_ENC_RC_MODE_FIXQP) {
/* constant QP mode qp is fixed */
rc_cfg->qp_max = 26;
rc_cfg->qp_min = 26;
rc_cfg->qp_init = 26;
}
ret = enc_mpi->control(*enc_ctx, MPP_ENC_SET_RC_CFG, rc_cfg);
if (ret) {
@@ -587,14 +593,6 @@ static MPP_RET mpi_rc_enc_init(MpiRc2TestCtx *ctx)
codec_cfg->h264.entropy_coding_mode = 1;
codec_cfg->h264.cabac_init_idc = 0;
if (rc_cfg->rc_mode == MPP_ENC_RC_MODE_FIXQP) {
/* constant QP mode qp is fixed */
codec_cfg->h264.qp_max = 26;
codec_cfg->h264.qp_min = 26;
codec_cfg->h264.qp_init = 26;
codec_cfg->h264.change |= MPP_ENC_H264_CFG_CHANGE_QP_LIMIT;
}
ret = enc_mpi->control(*enc_ctx, MPP_ENC_SET_CODEC_CFG, codec_cfg);
if (ret) {
mpp_err("mpi control enc set codec cfg failed ret %d\n", ret);