[h264e]: fix bps check failed when mpi setup to fix_qp mode

mpp codec will check bps, but bps will be set to -1 when choose fix qp mode.

Change-Id: I570769b09d2f432cf5a11337dddc923027a7afc2
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
This commit is contained in:
leo.ding
2017-07-19 11:47:15 +08:00
committed by Herman Chen
parent 62beb899cf
commit b7bb1de233

View File

@@ -239,6 +239,8 @@ MPP_RET h264e_config(void *ctx, RK_S32 cmd, void *param)
rc->quality); rc->quality);
ret = MPP_ERR_VALUE; ret = MPP_ERR_VALUE;
} }
if (rc->rc_mode != MPP_ENC_RC_MODE_VBR ||
rc->quality != MPP_ENC_RC_QUALITY_CQP) {
if ((rc->bps_target >= 100 * SZ_1M || rc->bps_target <= 1 * SZ_1K) || if ((rc->bps_target >= 100 * SZ_1M || rc->bps_target <= 1 * SZ_1K) ||
(rc->bps_max >= 100 * SZ_1M || rc->bps_max <= 1 * SZ_1K) || (rc->bps_max >= 100 * SZ_1M || rc->bps_max <= 1 * SZ_1K) ||
(rc->bps_min >= 100 * SZ_1M || rc->bps_min <= 1 * SZ_1K)) { (rc->bps_min >= 100 * SZ_1M || rc->bps_min <= 1 * SZ_1K)) {
@@ -246,6 +248,7 @@ MPP_RET h264e_config(void *ctx, RK_S32 cmd, void *param)
rc->bps_target, rc->bps_min, rc->bps_max); rc->bps_target, rc->bps_min, rc->bps_max);
ret = MPP_ERR_VALUE; ret = MPP_ERR_VALUE;
} }
}
if (!ret) { if (!ret) {
mpp_log_f("MPP_ENC_SET_RC_CFG bps %d [%d : %d]\n", mpp_log_f("MPP_ENC_SET_RC_CFG bps %d [%d : %d]\n",