Merge "Moving mi configuration loop from vp9_read_mode_info to set_offsets."
diff --git a/test/borders_test.cc b/test/borders_test.cc
index dcdedcf..5071541 100644
--- a/test/borders_test.cc
+++ b/test/borders_test.cc
@@ -67,7 +67,7 @@
cfg_.g_lag_in_frames = 25;
cfg_.rc_2pass_vbr_minsection_pct = 5;
- cfg_.rc_2pass_vbr_minsection_pct = 2000;
+ cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 200;
cfg_.rc_min_quantizer = 40;
diff --git a/vp9/encoder/vp9_block.h b/vp9/encoder/vp9_block.h
index 0088338..737fad4 100644
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -59,6 +59,7 @@
// motion vector cache for adaptive motion search control in partition
// search loop
int_mv pred_mv[MAX_REF_FRAMES];
+ int pred_filter_type;
// Bit flag for each mode whether it has high error in comparison to others.
unsigned int modes_with_high_error;
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 21cace6..5f9d0c9 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1686,6 +1686,10 @@
*get_sb_index(x, subsize) = i;
if (cpi->sf.adaptive_motion_search)
load_pred_mv(x, get_block_context(x, bsize));
+ if (cpi->sf.adaptive_pred_filter_type && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_filter_type =
+ get_block_context(x, bsize)->mic.mbmi.interp_filter;
rd_pick_partition(cpi, tile, tp, mi_row + y_idx, mi_col + x_idx, subsize,
&this_rate, &this_dist, i != 3, best_rd - sum_rd);
@@ -1733,6 +1737,10 @@
*get_sb_index(x, subsize) = 0;
if (cpi->sf.adaptive_motion_search)
load_pred_mv(x, get_block_context(x, bsize));
+ if (cpi->sf.adaptive_pred_filter_type && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_filter_type =
+ get_block_context(x, bsize)->mic.mbmi.interp_filter;
pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
get_block_context(x, subsize), best_rd);
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
@@ -1744,6 +1752,10 @@
*get_sb_index(x, subsize) = 1;
if (cpi->sf.adaptive_motion_search)
load_pred_mv(x, get_block_context(x, bsize));
+ if (cpi->sf.adaptive_pred_filter_type && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_filter_type =
+ get_block_context(x, bsize)->mic.mbmi.interp_filter;
pick_sb_modes(cpi, tile, mi_row + ms, mi_col, &this_rate,
&this_dist, subsize, get_block_context(x, subsize),
best_rd - sum_rd);
@@ -1778,6 +1790,10 @@
*get_sb_index(x, subsize) = 0;
if (cpi->sf.adaptive_motion_search)
load_pred_mv(x, get_block_context(x, bsize));
+ if (cpi->sf.adaptive_pred_filter_type && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_filter_type =
+ get_block_context(x, bsize)->mic.mbmi.interp_filter;
pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
get_block_context(x, subsize), best_rd);
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
@@ -1788,6 +1804,10 @@
*get_sb_index(x, subsize) = 1;
if (cpi->sf.adaptive_motion_search)
load_pred_mv(x, get_block_context(x, bsize));
+ if (cpi->sf.adaptive_pred_filter_type && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_filter_type =
+ get_block_context(x, bsize)->mic.mbmi.interp_filter;
pick_sb_modes(cpi, tile, mi_row, mi_col + ms, &this_rate,
&this_dist, subsize, get_block_context(x, subsize),
best_rd - sum_rd);
@@ -1889,6 +1909,18 @@
int dummy_rate;
int64_t dummy_dist;
+ BLOCK_SIZE i;
+ MACROBLOCK *x = &cpi->mb;
+ for (i = BLOCK_4X4; i < BLOCK_8X8; ++i) {
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[i];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[i];
+ const int num_4x4_blk = MAX(4, num_4x4_w * num_4x4_h);
+ for (x->sb_index = 0; x->sb_index < 4; ++x->sb_index)
+ for (x->mb_index = 0; x->mb_index < 4; ++x->mb_index)
+ for (x->b_index = 0; x->b_index < 16 / num_4x4_blk; ++x->b_index)
+ get_block_context(x, i)->pred_filter_type = SWITCHABLE;
+ }
+
vp9_zero(cpi->mb.pred_mv);
if (cpi->sf.reference_masking)
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 578fb42..e010c09 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -654,6 +654,7 @@
sf->tx_size_search_method = USE_FULL_RD;
sf->use_lp32x32fdct = 0;
sf->adaptive_motion_search = 0;
+ sf->adaptive_pred_filter_type = 0;
sf->use_avoid_tested_higherror = 0;
sf->reference_masking = 0;
sf->use_one_partition_size_always = 0;
@@ -717,6 +718,7 @@
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_filter_type = 1;
sf->auto_mv_step_size = 1;
sf->adaptive_rd_thresh = 2;
sf->recode_loop = 2;
@@ -744,6 +746,7 @@
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_filter_type = 2;
sf->auto_mv_step_size = 1;
sf->disable_filter_search_var_thresh = 16;
@@ -779,6 +782,7 @@
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_filter_type = 2;
sf->auto_mv_step_size = 1;
sf->disable_filter_search_var_thresh = 16;
@@ -812,6 +816,7 @@
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_filter_type = 2;
sf->auto_mv_step_size = 1;
sf->disable_filter_search_var_thresh = 16;
diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h
index 13ab753..8f2ffc9 100644
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -270,6 +270,7 @@
int using_small_partition_info;
// TODO(jingning): combine the related motion search speed features
int adaptive_motion_search;
+ int adaptive_pred_filter_type;
// Implements various heuristics to skip searching modes
// The heuristics selected are based on flags
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 9bade98..b813f06 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3811,8 +3811,6 @@
int skip_uv[TX_SIZES];
MB_PREDICTION_MODE mode_uv[TX_SIZES] = { 0 };
struct scale_factors scale_factor[4];
- unsigned int ref_frame_mask = 0;
- unsigned int mode_mask = 0;
int intra_cost_penalty = 20 * vp9_dc_quant(cpi->common.base_qindex,
cpi->common.y_dc_delta_q);
int_mv seg_mvs[4][MAX_REF_FRAMES];
@@ -3842,15 +3840,6 @@
*returnrate = INT_MAX;
- // Create a mask set to 1 for each reference frame used by a smaller
- // resolution.
- if (cpi->sf.use_avoid_tested_higherror) {
- ref_frame_mask = 0;
- mode_mask = 0;
- ref_frame_mask = ~ref_frame_mask;
- mode_mask = ~mode_mask;
- }
-
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
if (cpi->ref_frame_flags & flag_list[ref_frame]) {
setup_buffer_inter(cpi, x, tile, idx_list[ref_frame], ref_frame,
@@ -4075,6 +4064,14 @@
cpi->sf.disable_filter_search_var_thresh) {
tmp_best_filter = EIGHTTAP;
vp9_zero(cpi->rd_filter_cache);
+ } else if (cpi->sf.adaptive_pred_filter_type == 1 &&
+ ctx->pred_filter_type < SWITCHABLE) {
+ tmp_best_filter = ctx->pred_filter_type;
+ vp9_zero(cpi->rd_filter_cache);
+ } else if (cpi->sf.adaptive_pred_filter_type == 2) {
+ tmp_best_filter = ctx->pred_filter_type < SWITCHABLE ?
+ ctx->pred_filter_type : 0;
+ vp9_zero(cpi->rd_filter_cache);
} else {
for (switchable_filter_index = 0;
switchable_filter_index < SWITCHABLE_FILTERS;
@@ -4141,7 +4138,7 @@
}
}
- if (tmp_best_rdu == INT64_MAX)
+ if (tmp_best_rdu == INT64_MAX && pred_exists)
continue;
mbmi->interp_filter = (cm->mcomp_filter_type == SWITCHABLE ?