diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index a05db60c6..c5eae6263 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -608,8 +608,8 @@ static void set_rt_speed_feature_framesize_independent( // For SVC: enable use of lower resolution partition for higher resolution, // only for 3 spatial layers and when config/top resolution is above VGA. // Enable only for non-base temporal layer frames. - if (cpi->use_svc && cpi->svc.number_spatial_layers == 3 && - cpi->svc.temporal_layer_id > 0 && + if (cpi->use_svc && cpi->svc.use_partition_reuse && + cpi->svc.number_spatial_layers == 3 && cpi->svc.temporal_layer_id > 0 && cpi->oxcf.width * cpi->oxcf.height > 640 * 480) sf->svc_use_lowres_part = 1; } diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c index a7fe36fca..aaacbcbcc 100644 --- a/vp9/encoder/vp9_svc_layercontext.c +++ b/vp9/encoder/vp9_svc_layercontext.c @@ -33,6 +33,7 @@ void vp9_init_layer_context(VP9_COMP *const cpi) { svc->rc_drop_superframe = 0; svc->force_zero_mode_spatial_ref = 0; svc->use_base_mv = 0; + svc->use_partition_reuse = 0; svc->scaled_temp_is_alloc = 0; svc->scaled_one_half = 0; svc->current_superframe = 0; @@ -611,7 +612,10 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) { int width = 0, height = 0; LAYER_CONTEXT *lc = NULL; cpi->svc.skip_enhancement_layer = 0; - if (cpi->svc.number_spatial_layers > 1) cpi->svc.use_base_mv = 1; + if (cpi->svc.number_spatial_layers > 1) { + cpi->svc.use_base_mv = 1; + cpi->svc.use_partition_reuse = 1; + } cpi->svc.force_zero_mode_spatial_ref = 1; cpi->svc.mi_stride[cpi->svc.spatial_layer_id] = cpi->common.mi_stride; @@ -675,8 +679,9 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) { if (lc->scaling_factor_num > (3 * lc->scaling_factor_den) >> 2) cpi->svc.downsample_filter_phase[cpi->svc.spatial_layer_id] = 0; - // The usage of use_base_mv assumes down-scale of 2x2. For now, turn off use - // of base motion vectors if spatial scale factors for any layers are not 2, + // The usage of use_base_mv or partition_reuse assumes down-scale of 2x2. + // For now, turn off use of base motion vectors and partition reuse if the + // spatial scale factors for any layers are not 2, // keep the case of 3 spatial layers with scale factor of 4x4 for base layer. // TODO(marpan): Fix this to allow for use_base_mv for scale factors != 2. if (cpi->svc.number_spatial_layers > 1) { @@ -688,6 +693,7 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) { !(lc->scaling_factor_num == lc->scaling_factor_den >> 2 && sl == 0 && cpi->svc.number_spatial_layers == 3)) { cpi->svc.use_base_mv = 0; + cpi->svc.use_partition_reuse = 0; break; } } diff --git a/vp9/encoder/vp9_svc_layercontext.h b/vp9/encoder/vp9_svc_layercontext.h index 87686fe59..1a581e093 100644 --- a/vp9/encoder/vp9_svc_layercontext.h +++ b/vp9/encoder/vp9_svc_layercontext.h @@ -89,6 +89,7 @@ typedef struct SVC { int current_superframe; int non_reference_frame; int use_base_mv; + int use_partition_reuse; // Used to control the downscaling filter for source scaling, for 1 pass CBR. // downsample_filter_phase: = 0 will do sub-sampling (no weighted average), // = 8 will center the target pixel and get a symmetric averaging filter.