[legacy]: fix bitrate config error

When rc mode changed from CQP to CBR, bitrate configed from outside of
mpp maybe keeped the same, but bitrate value at mpp_rc should be
changed.

Change-Id: I845c05977ed53f664a70d1310684ba8ebfe5ee2b
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:
Johnson Ding
2020-04-13 16:36:01 +08:00
parent 50a9655531
commit 794b8e6150

View File

@@ -143,9 +143,9 @@ static MPP_RET vpu_api_set_enc_cfg(MppCtx mpp_ctx, MppApi *mpi,
/* 0 - constant qp mode: fixed qp */ /* 0 - constant qp mode: fixed qp */
rc_cfg->rc_mode = MPP_ENC_RC_MODE_FIXQP; rc_cfg->rc_mode = MPP_ENC_RC_MODE_FIXQP;
rc_cfg->quality = MPP_ENC_RC_QUALITY_MEDIUM; rc_cfg->quality = MPP_ENC_RC_QUALITY_MEDIUM;
rc_cfg->bps_target = -1; rc_cfg->bps_target = bps;
rc_cfg->bps_max = -1; rc_cfg->bps_max = bps * 17 / 16;
rc_cfg->bps_min = -1; rc_cfg->bps_min = bps * 15 / 16;
} else if (rc_mode == 1) { } else if (rc_mode == 1) {
/* 1 - constant bitrate: small bps range */ /* 1 - constant bitrate: small bps range */
rc_cfg->rc_mode = MPP_ENC_RC_MODE_CBR; rc_cfg->rc_mode = MPP_ENC_RC_MODE_CBR;