Commit 33e10dfa authored by Marco's avatar Marco
Browse files

ARF in 1 pass vbr: modify skip ref_frame in nonrd_pickmode.

Speedup of ~2-3% on 1080p clips speed 6.
Neutral/negligible loss in metrics on ytlive.

Change-Id: I7ac47a4d8b58c566920bae29a94a0e8d59c36dee
parent c8f6e7b9
......@@ -1567,7 +1567,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
}
#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;
......@@ -1581,6 +1582,15 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
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
......
......@@ -353,6 +353,7 @@ void vp9_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
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;
......@@ -1480,6 +1481,7 @@ void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) {
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;
}
......
......@@ -164,6 +164,7 @@ typedef struct {
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment