mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-14 21:25:42 +08:00
[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:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user