[rc]: Set statistic time to minimum 2s

NOTE: Gop is better to be integer multiples of output fps.

Change-Id: Id42e2e0c076d6c0a3f67756dc73dca7451b95ff6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2021-01-14 15:21:36 +08:00
parent b64d32cac8
commit 5569c2c68d

View File

@@ -900,7 +900,10 @@ static void set_rc_cfg(RcCfg *cfg, MppEncCfgSet *cfg_set)
cfg->bps_target = rc->bps_target; cfg->bps_target = rc->bps_target;
cfg->bps_max = rc->bps_max; cfg->bps_max = rc->bps_max;
cfg->bps_min = rc->bps_min; cfg->bps_min = rc->bps_min;
cfg->stat_times = 3; mpp_assert(rc->fps_out_num);
cfg->stat_times = rc->gop * rc->fps_out_denorm / rc->fps_out_num;
if (cfg->stat_times < 2)
cfg->stat_times = 2;
/* quality configure */ /* quality configure */
switch (codec->coding) { switch (codec->coding) {