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;
}
// 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();
// 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)))
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;
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)) {