cpi->common.buffer_pool = pool;
cpi->rc.high_source_sad = 0;
+ cpi->rc.count_last_scene_change = 0;
init_config(cpi, oxcf);
vp9_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc);
else
rc->high_source_sad = 0;
if (avg_sad > 0 || cpi->oxcf.rc_mode == VPX_CBR)
- rc->avg_source_sad = (rc->avg_source_sad + avg_sad) >> 1;
+ rc->avg_source_sad = (3 * rc->avg_source_sad + avg_sad) >> 2;
// For VBR, under scene change/high content change, force golden refresh.
if (cpi->oxcf.rc_mode == VPX_VBR &&
rc->high_source_sad &&
+ rc->count_last_scene_change > 4 &&
cpi->ext_refresh_frame_flags_pending == 0) {
int target;
cpi->refresh_golden_frame = 1;
rc->frames_till_gf_update_due = rc->frames_to_key;
target = calc_pframe_target_size_one_pass_vbr(cpi);
vp9_rc_set_frame_target(cpi, target);
+ rc->count_last_scene_change = 0;
+ } else {
+ rc->count_last_scene_change++;
}
}
}