Commit c8678fb7 authored by Marco's avatar Marco

Use adapt_partition for ARF in 1 pass.

For speed 6 real-time mode: use adapt_partition
on ARF frame instead of REFERENCE_PARTITION (which is slower).
This requires enabling compute_source_sad_onepass for no-show_frames.

Speedup of ~3-5% on some clips that heavily use ARF,
small loss (~0.2%) in quality on ytlive set.

Change-Id: Ib50acc97df06458244a6ac55d2bd882c30012536
parent fe7b8691
......@@ -4183,7 +4183,7 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi, ThreadData *td,
if (sf->adapt_partition_source_sad &&
(cpi->oxcf.rc_mode == VPX_VBR && !cpi->rc.is_src_frame_alt_ref &&
source_sad > sf->adapt_partition_thresh &&
cpi->refresh_golden_frame))
(cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)))
partition_search_type = REFERENCE_PARTITION;
}
......
......@@ -3438,8 +3438,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
// Flag to check if its valid to compute the source sad (used for
// scene detection and for superblock content state in CBR mode).
// The flag may get reset below based on SVC or resizing state.
cpi->compute_source_sad_onepass =
cpi->oxcf.mode == REALTIME && cm->show_frame;
cpi->compute_source_sad_onepass = cpi->oxcf.mode == REALTIME;
vpx_clear_system_state();
......@@ -3532,7 +3531,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
// For other cases (e.g., CBR mode) use it for 5 <= speed < 8 for now
// (need to check encoding time cost for doing this for speed 8).
cpi->rc.high_source_sad = 0;
if (cpi->compute_source_sad_onepass &&
if (cpi->compute_source_sad_onepass && cm->show_frame &&
(cpi->oxcf.rc_mode == VPX_VBR ||
cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
(cpi->oxcf.speed >= 5 && cpi->oxcf.speed < 8 && !cpi->use_svc)))
......
......@@ -527,12 +527,6 @@ static void set_rt_speed_feature_framesize_independent(
if (speed >= 6) {
sf->partition_search_type = VAR_BASED_PARTITION;
if (cpi->oxcf.rc_mode == VPX_VBR && cpi->oxcf.lag_in_frames > 0 &&
!is_keyframe) {
if (sf->use_altref_onepass && cpi->refresh_alt_ref_frame) {
sf->partition_search_type = REFERENCE_PARTITION;
}
}
// Turn on this to use non-RD key frame coding mode.
sf->use_nonrd_pick_mode = 1;
sf->mv.search_method = NSTEP;
......@@ -545,6 +539,8 @@ static void set_rt_speed_feature_framesize_independent(
sf->adapt_partition_source_sad = 1;
sf->adapt_partition_thresh =
(cm->width * cm->height <= 640 * 360) ? 40000 : 80000;
if (sf->use_altref_onepass && cpi->refresh_alt_ref_frame && !is_keyframe)
sf->adapt_partition_thresh = (3 * sf->adapt_partition_thresh) >> 2;
if (cpi->content_state_sb_fd == NULL &&
(!cpi->use_svc ||
cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)) {
......
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