}
#endif
- if (cpi->rc.frames_since_golden == 0 && !cpi->use_svc) {
+ if (cpi->rc.frames_since_golden == 0 && !cpi->use_svc &&
+ !cpi->rc.alt_ref_gf_group && !cpi->rc.last_frame_is_src_altref) {
usable_ref_frame = LAST_FRAME;
} else {
usable_ref_frame = GOLDEN_FRAME;
skip_ref_find_pred[LAST_FRAME] = 1;
skip_ref_find_pred[GOLDEN_FRAME] = 1;
}
+ if (cm->show_frame == 0) {
+ usable_ref_frame = GOLDEN_FRAME;
+ skip_ref_find_pred[ALTREF_FRAME] = 1;
+ if (cpi->rc.frames_since_key == 1) {
+ usable_ref_frame = LAST_FRAME;
+ skip_ref_find_pred[GOLDEN_FRAME] = 1;
+ skip_ref_find_pred[ALTREF_FRAME] = 1;
+ }
+ }
}
// For svc mode, on spatial_layer_id > 0: if the reference has different scale
rc->reset_high_source_sad = 0;
rc->high_source_sad_lagindex = -1;
rc->alt_ref_gf_group = 0;
+ rc->last_frame_is_src_altref = 0;
rc->fac_active_worst_inter = 150;
rc->fac_active_worst_gf = 100;
rc->force_qpmin = 0;
compute_frame_low_motion(cpi);
if (cpi->sf.use_altref_onepass) update_altref_usage(cpi);
}
+ cpi->rc.last_frame_is_src_altref = cpi->rc.is_src_frame_alt_ref;
}
if (cm->frame_type != KEY_FRAME) rc->reset_high_source_sad = 0;
}
uint64_t prev_avg_source_sad_lag;
int high_source_sad_lagindex;
int alt_ref_gf_group;
+ int last_frame_is_src_altref;
int high_source_sad;
int count_last_scene_change;
int avg_frame_low_motion;