Commit 476d73d2 authored by Jim Bankoski's avatar Jim Bankoski Committed by Gerrit Code Review
Browse files

partition by variance using var from last frame

This uses variance to split partition. Variance is calculated using
nearest mv,  always from last ref frame.

Change-Id: Idd015b4a9aa3bc82591759eac239680c07496896
parent 1f94b976
......@@ -1130,7 +1130,7 @@ static void choose_partitioning(VP9_COMP *cpi, MODE_INFO *m, int mi_row,
setup_pre_planes(xd, ref_fb, second_ref_fb, mi_row, mi_col,
xd->scale_factor, xd->scale_factor_uv);
m->mbmi.ref_frame[0] = LAST_FRAME;
xd->mode_info_context->mbmi.ref_frame[0] = LAST_FRAME;
xd->mode_info_context->mbmi.sb_type = BLOCK_SIZE_SB64X64;
vp9_find_best_ref_mvs(xd, m->mbmi.ref_mvs[m->mbmi.ref_frame[0]], &nearest,
&near);
......@@ -1500,28 +1500,33 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, TOKENEXTRA **tp,
for (mi_col = cm->cur_tile_mi_col_start; mi_col < cm->cur_tile_mi_col_end;
mi_col += 64 / MI_SIZE) {
int dummy_rate, dummy_dist;
if (!cpi->sf.use_lastframe_partitioning) {
rd_pick_partition(cpi, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
&dummy_rate, &dummy_dist);
} else {
if (cpi->sf.partition_by_variance || cpi->sf.use_lastframe_partitioning) {
const int idx_str = cm->mode_info_stride * mi_row + mi_col;
MODE_INFO *m = cm->mi + idx_str;
MODE_INFO *p = cm->prev_mi + idx_str;
if ((cpi->common.current_video_frame & 1) == 0 || cm->prev_mi == 0
|| cpi->common.show_frame == 0 || cpi->common.frame_type == KEY_FRAME
|| cpi->is_src_frame_alt_ref) {
rd_pick_partition(cpi, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
&dummy_rate, &dummy_dist);
} else {
// set_partitioning(cpi, m, BLOCK_SIZE_SB64X64);
// choose_partitioning(cpi, cm->mi, mi_row, mi_col);
copy_partitioning(cpi, m, p);
if (cpi->sf.partition_by_variance) {
choose_partitioning(cpi, cm->mi, mi_row, mi_col);
rd_use_partition(cpi, m, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
&dummy_rate, &dummy_dist);
} else {
if ((cpi->common.current_video_frame & 1) == 0 || cm->prev_mi == 0
|| cpi->common.show_frame == 0
|| cpi->common.frame_type == KEY_FRAME
|| cpi->is_src_frame_alt_ref) {
rd_pick_partition(cpi, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
&dummy_rate, &dummy_dist);
} else {
// set_partitioning(cpi, m, BLOCK_SIZE_SB64X64);
copy_partitioning(cpi, m, p);
rd_use_partition(cpi, m, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
&dummy_rate, &dummy_dist);
}
}
} else {
rd_pick_partition(cpi, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
&dummy_rate, &dummy_dist);
}
}
}
......
......@@ -539,9 +539,6 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) {
int speed_multiplier = speed + 1;
int i;
if (speed == 2)
speed_multiplier = 1;
// Set baseline threshold values
for (i = 0; i < MAX_MODES; ++i)
sf->thresh_mult[i] = mode == 0 ? -500 : 0;
......@@ -693,6 +690,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->use_avoid_tested_higherror = 0;
sf->skip_lots_of_modes = 0;
sf->adjust_thresholds_by_speed = 0;
sf->partition_by_variance = 0;
#if CONFIG_MULTIPLE_ARF
// Switch segmentation off.
......@@ -725,7 +723,11 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->use_lastframe_partitioning = 1;
sf->first_step = 0;
}
if (speed == 3) {
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_SB8X8;
sf->partition_by_variance = 1;
sf->first_step = 0;
}
break;
}; /* switch */
......
......@@ -222,6 +222,7 @@ typedef struct {
int use_avoid_tested_higherror;
int skip_lots_of_modes;
int adjust_thresholds_by_speed;
int partition_by_variance;
} SPEED_FEATURES;
enum BlockSize {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment