Index: source/libvpx/vp9/encoder/vp9_speed_features.c |
=================================================================== |
--- source/libvpx/vp9/encoder/vp9_speed_features.c (revision 290053) |
+++ source/libvpx/vp9/encoder/vp9_speed_features.c (working copy) |
@@ -110,21 +110,23 @@ |
if (speed >= 3) { |
sf->tx_size_search_method = frame_is_intra_only(cm) ? USE_FULL_RD |
: USE_LARGESTALL; |
- if (MIN(cm->width, cm->height) >= 720) |
+ if (MIN(cm->width, cm->height) >= 720) { |
sf->disable_split_mask = DISABLE_ALL_SPLIT; |
- else |
+ } else { |
+ sf->max_intra_bsize = BLOCK_32X32; |
sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT; |
- |
+ } |
sf->adaptive_pred_interp_filter = 0; |
+ sf->cb_partition_search = frame_is_boosted(cpi) ? 0 : 1; |
sf->cb_pred_filter_search = 1; |
- |
+ sf->motion_field_mode_search = frame_is_boosted(cpi) ? 0 : 1; |
sf->lf_motion_threshold = LOW_MOTION_THRESHOLD; |
sf->last_partitioning_redo_frequency = 3; |
sf->recode_loop = ALLOW_RECODE_KFMAXBW; |
sf->adaptive_rd_thresh = 3; |
sf->mode_skip_start = 6; |
- sf->use_fast_coef_updates = ONE_LOOP_REDUCED; |
- sf->use_fast_coef_costing = 1; |
+ sf->intra_y_mode_mask[TX_32X32] = INTRA_DC; |
+ sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC; |
} |
if (speed >= 4) { |
@@ -137,6 +139,8 @@ |
sf->disable_filter_search_var_thresh = 200; |
sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL; |
sf->use_lp32x32fdct = 1; |
+ sf->use_fast_coef_updates = ONE_LOOP_REDUCED; |
+ sf->use_fast_coef_costing = 1; |
} |
if (speed >= 5) { |
@@ -158,7 +162,7 @@ |
} |
static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, |
- int speed) { |
+ int speed, vp9e_tune_content content) { |
VP9_COMMON *const cm = &cpi->common; |
const int frames_since_key = |
cm->frame_type == KEY_FRAME ? 0 : cpi->rc.frames_since_key; |
@@ -179,6 +183,7 @@ |
sf->disable_split_mask = DISABLE_COMPOUND_SPLIT; |
sf->use_rd_breakout = 1; |
+ |
sf->adaptive_motion_search = 1; |
sf->adaptive_pred_interp_filter = 1; |
sf->mv.auto_mv_step_size = 1; |
@@ -273,13 +278,19 @@ |
} |
if (speed >= 6) { |
+ if (content == VP9E_CONTENT_SCREEN) { |
+ int i; |
+ // Allow fancy modes at all sizes since SOURCE_VAR_BASED_PARTITION is used |
+ for (i = 0; i < BLOCK_SIZES; ++i) |
+ sf->inter_mode_mask[i] = INTER_ALL; |
+ } |
+ |
// Adaptively switch between SOURCE_VAR_BASED_PARTITION and FIXED_PARTITION. |
sf->partition_search_type = SOURCE_VAR_BASED_PARTITION; |
sf->search_type_check_frequency = 50; |
sf->tx_size_search_method = (cm->frame_type == KEY_FRAME) ? |
USE_LARGESTALL : USE_TX_8X8; |
- sf->max_intra_bsize = BLOCK_8X8; |
// This feature is only enabled when partition search is disabled. |
sf->reuse_inter_pred_sby = 1; |
@@ -334,6 +345,8 @@ |
sf->adaptive_motion_search = 0; |
sf->adaptive_pred_interp_filter = 0; |
sf->cb_pred_filter_search = 0; |
+ sf->cb_partition_search = 0; |
+ sf->motion_field_mode_search = 0; |
sf->use_quant_fp = 0; |
sf->reference_masking = 0; |
sf->partition_search_type = SEARCH_PARTITION; |
@@ -349,7 +362,6 @@ |
sf->mode_search_skip_flags = 0; |
sf->force_frame_boost = 0; |
sf->max_delta_qindex = 0; |
- sf->disable_split_var_thresh = 0; |
sf->disable_filter_search_var_thresh = 0; |
for (i = 0; i < TX_SIZES; i++) { |
sf->intra_y_mode_mask[i] = INTRA_ALL; |
@@ -378,28 +390,26 @@ |
sf->recode_tolerance = 25; |
sf->default_interp_filter = SWITCHABLE; |
- switch (oxcf->mode) { |
- case ONE_PASS_BEST: |
- case TWO_PASS_SECOND_BEST: // This is the best quality mode. |
- cpi->diamond_search_sad = vp9_full_range_search; |
- break; |
- case TWO_PASS_FIRST: |
- case ONE_PASS_GOOD: |
- case TWO_PASS_SECOND_GOOD: |
+ if (oxcf->mode == REALTIME) { |
+ set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content); |
+ } else { |
+ if (!is_best_mode(oxcf->mode)) |
set_good_speed_feature(cpi, cm, sf, oxcf->speed); |
- break; |
- case REALTIME: |
- set_rt_speed_feature(cpi, sf, oxcf->speed); |
- break; |
} |
+ cpi->full_search_sad = vp9_full_search_sad; |
+ cpi->diamond_search_sad = is_best_mode(oxcf->mode) ? vp9_full_range_search |
+ : vp9_diamond_search_sad; |
+ cpi->refining_search_sad = vp9_refining_search_sad; |
+ |
+ |
// Slow quant, dct and trellis not worthwhile for first pass |
// so make sure they are always turned off. |
- if (cpi->pass == 1) |
+ if (oxcf->pass == 1) |
sf->optimize_coefficients = 0; |
// No recode for 1 pass. |
- if (cpi->pass == 0) { |
+ if (oxcf->pass == 0) { |
sf->recode_loop = DISALLOW_RECODE; |
sf->optimize_coefficients = 0; |
} |
@@ -408,7 +418,7 @@ |
cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree; |
} |
- cpi->mb.optimize = sf->optimize_coefficients == 1 && cpi->pass != 1; |
+ cpi->mb.optimize = sf->optimize_coefficients == 1 && oxcf->pass != 1; |
if (sf->disable_split_mask == DISABLE_ALL_SPLIT) |
sf->adaptive_pred_interp_filter = 0; |