ref: e609ab46a11f9add5350e91c767a3b7af8bf088f
parent: bb9b6a956852d77957f8aa946ce3163072e3e80c
parent: bbc8c9d29ab584482f7560e1f31a492d7c7c09b0
author: Alex Converse <[email protected]>
date: Wed Mar 5 06:57:04 EST 2014
Merge "Prune RT mode decisions for BLOCK_32x32 and up"
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -852,9 +852,15 @@
sf->intra_y_mode_mask[i] = INTRA_DC_H_V;
sf->intra_uv_mode_mask[i] = INTRA_DC_ONLY;
}
+ sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_ONLY;
sf->frame_parameter_update = 0;
sf->encode_breakout_thresh = 1000;
sf->search_method = FAST_HEX;
+ sf->disable_inter_mode_mask[BLOCK_32X32] = 1 << INTER_OFFSET(ZEROMV);
+ sf->disable_inter_mode_mask[BLOCK_32X64] = ~(1 << INTER_OFFSET(NEARESTMV));
+ sf->disable_inter_mode_mask[BLOCK_64X32] = ~(1 << INTER_OFFSET(NEARESTMV));
+ sf->disable_inter_mode_mask[BLOCK_64X64] = ~(1 << INTER_OFFSET(NEARESTMV));
+ sf->max_intra_bsize = BLOCK_32X32;
}
if (speed >= 6) {
sf->partition_search_type = VAR_BASED_FIXED_PARTITION;
@@ -933,6 +939,7 @@
sf->encode_breakout_thresh = 0;
for (i = 0; i < BLOCK_SIZES; ++i)
sf->disable_inter_mode_mask[i] = 0;
+ sf->max_intra_bsize = BLOCK_64X64;
switch (cpi->oxcf.mode) {
case MODE_BESTQUALITY:
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -424,6 +424,11 @@
// This feature controls whether we do the expensive context update and
// calculation in the rd coefficient costing loop.
int use_fast_coef_costing;
+
+ // This variable controls the maximum block size where intra blocks can be
+ // used in inter frames.
+ // TODO(aconverse): Fold this into one of the other many mode skips
+ BLOCK_SIZE max_intra_bsize;
} SPEED_FEATURES;
typedef struct {
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1704,6 +1704,7 @@
int mode_idx;
int subpelmv = 1, have_ref = 0;
const int has_second_rf = has_second_ref(mbmi);
+ const int disable_inter_mode_mask = cpi->sf.disable_inter_mode_mask[bsize];
vpx_memcpy(t_above, pd->above_context, sizeof(t_above));
vpx_memcpy(t_left, pd->left_context, sizeof(t_left));
@@ -1741,11 +1742,12 @@
mode_idx = INTER_OFFSET(this_mode);
bsi->rdstat[i][mode_idx].brdcost = INT64_MAX;
- if (cpi->sf.disable_inter_mode_mask[bsize] & (1 << mode_idx))
+ if (disable_inter_mode_mask & (1 << mode_idx))
continue;
// if we're near/nearest and mv == 0,0, compare to zeromv
- if ((this_mode == NEARMV || this_mode == NEARESTMV ||
+ if (!(disable_inter_mode_mask & (1 << INTER_OFFSET(ZEROMV))) &&
+ (this_mode == NEARMV || this_mode == NEARESTMV ||
this_mode == ZEROMV) &&
frame_mv[this_mode][mbmi->ref_frame[0]].as_int == 0 &&
(!has_second_rf ||
@@ -3184,6 +3186,7 @@
const int mode_search_skip_flags = cpi->sf.mode_search_skip_flags;
const int intra_y_mode_mask =
cpi->sf.intra_y_mode_mask[max_txsize_lookup[bsize]];
+ const int disable_inter_mode_mask = cpi->sf.disable_inter_mode_mask[bsize];
x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
@@ -3282,6 +3285,10 @@
mode_skip_mask |= new_modes_mask;
}
+ if (bsize > cpi->sf.max_intra_bsize) {
+ mode_skip_mask |= 0xFF30808;
+ }
+
for (mode_index = 0; mode_index < MAX_MODES; ++mode_index) {
int mode_excluded = 0;
int64_t this_rd = INT64_MAX;
@@ -3328,7 +3335,7 @@
this_mode = vp9_mode_order[mode_index].mode;
ref_frame = vp9_mode_order[mode_index].ref_frame[0];
if (ref_frame != INTRA_FRAME &&
- cpi->sf.disable_inter_mode_mask[bsize] & (1 << INTER_OFFSET(this_mode)))
+ disable_inter_mode_mask & (1 << INTER_OFFSET(this_mode)))
continue;
second_ref_frame = vp9_mode_order[mode_index].ref_frame[1];
@@ -3372,7 +3379,8 @@
}
} else {
// if we're near/nearest and mv == 0,0, compare to zeromv
- if ((this_mode == NEARMV || this_mode == NEARESTMV ||
+ if (!(disable_inter_mode_mask & (1 << INTER_OFFSET(ZEROMV))) &&
+ (this_mode == NEARMV || this_mode == NEARESTMV ||
this_mode == ZEROMV) &&
frame_mv[this_mode][ref_frame].as_int == 0 &&
!vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP) &&