dist_breakout_thr >>= 8 - (b_width_log2(bsize) +
b_height_log2(bsize));
+ rate_breakout_thr *= num_pels_log2_lookup[bsize];
+
// If all y, u, v transform blocks in this partition are skippable, and
// the dist & rate are within the thresholds, the partition search is
// terminated for current branch of the partition search tree.
int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS],
int skippable) {
MACROBLOCKD *const xd = &x->e_mbd;
+ int plane, has_high_freq_coeff = 0;
+ BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type;
+
+ if (bsize >= BLOCK_8X8)
+ for (plane = 0; plane < MAX_MB_PLANE; ++plane)
+ has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane);
// Take a snapshot of the coding context so it can be
// restored if we decide to encode this way
ctx->skip = x->skip;
- ctx->skippable = skippable;
+ ctx->skippable = skippable || !has_high_freq_coeff;
ctx->best_mode_index = mode_index;
ctx->mic = *xd->mi[0].src_mi;
ctx->single_pred_diff = (int)comp_pred_diff[SINGLE_REFERENCE];
sf->partition_search_breakout_dist_thr = (1 << 23);
else
sf->partition_search_breakout_dist_thr = (1 << 21);
- sf->partition_search_breakout_rate_thr = 500;
+ sf->partition_search_breakout_rate_thr = 80;
}
if (speed >= 2) {
sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT
: DISABLE_ALL_INTER_SPLIT;
sf->adaptive_pred_interp_filter = 0;
+ sf->partition_search_breakout_dist_thr = (1 << 24);
+ sf->partition_search_breakout_rate_thr = 120;
} else {
sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY;
+ sf->partition_search_breakout_dist_thr = (1 << 22);
+ sf->partition_search_breakout_rate_thr = 100;
}
sf->reference_masking = 1;
sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
sf->auto_min_max_partition_size = CONSTRAIN_NEIGHBORING_MIN_MAX;
- if (MIN(cm->width, cm->height) >= 720)
- sf->partition_search_breakout_dist_thr = (1 << 24);
- else
- sf->partition_search_breakout_dist_thr = (1 << 22);
- sf->partition_search_breakout_rate_thr = 700;
-
sf->allow_partition_search_skip = 1;
}
sf->disable_split_mask = DISABLE_ALL_SPLIT;
sf->schedule_mode_search = cm->base_qindex < 220 ? 1 : 0;
sf->partition_search_breakout_dist_thr = (1 << 25);
+ sf->partition_search_breakout_rate_thr = 200;
} else {
sf->max_intra_bsize = BLOCK_32X32;
sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
sf->schedule_mode_search = cm->base_qindex < 175 ? 1 : 0;
sf->partition_search_breakout_dist_thr = (1 << 23);
+ sf->partition_search_breakout_rate_thr = 120;
}
sf->mv.subpel_search_method = SUBPEL_TREE_PRUNED;
sf->adaptive_pred_interp_filter = 0;
sf->intra_y_mode_mask[TX_32X32] = INTRA_DC;
sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC;
sf->adaptive_interp_filter_search = 1;
- sf->partition_search_breakout_rate_thr = 1000;
}
if (speed >= 4) {
sf->partition_search_breakout_dist_thr = (1 << 26);
else
sf->partition_search_breakout_dist_thr = (1 << 24);
- sf->partition_search_breakout_rate_thr = 1500;
+ sf->partition_search_breakout_rate_thr = 300;
}
if (speed >= 5) {
return result;
}
+static void has_high_freq_coeff(int plane, int block,
+ BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
+ void *argv) {
+ struct is_skippable_args *args = argv;
+ int eobs = (tx_size == TX_4X4) ? 3 : 10;
+ (void) plane_bsize;
+
+ *(args->skippable) |= (args->x->plane[plane].eobs[block] > eobs);
+}
+
+int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
+ int result = 0;
+ struct is_skippable_args args = {x, &result};
+ vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane,
+ has_high_freq_coeff, &args);
+ return result;
+}
+
void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
BLOCK_SIZE bsize) {
VP9_COMMON *const cm = &cpi->common;
extern struct vp9_token vp9_coef_encodings[];
int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
+int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
struct VP9_COMP;