Commit 18bdf708 authored by Jim Bankoski's avatar Jim Bankoski Committed by Gerrit Code Review
Browse files

adds a set partitioning to speed features

this feature lets you set a partitioning size to be used by the entire
frame.

Change-Id: I208a4c8c701375cbb054418266f677768b6f8f06
parent 476d73d2
......@@ -857,22 +857,14 @@ static void encode_sb(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int mi_col,
}
}
static void set_partitioning(VP9_COMP *cpi, MODE_INFO *m, BLOCK_SIZE_TYPE bsize) {
VP9_COMMON * const cm = &cpi->common;
static void set_partitioning(VP9_COMP *cpi, MODE_INFO *m,
BLOCK_SIZE_TYPE bsize) {
VP9_COMMON *const cm = &cpi->common;
const int mis = cm->mode_info_stride;
int bsl = b_width_log2(bsize);
int bs = (1 << bsl) / 2; //
int block_row, block_col;
int row, col;
// this test function sets the entire macroblock to the same bsize
for (block_row = 0; block_row < 8; block_row += bs) {
for (block_col = 0; block_col < 8; block_col += bs) {
for (row = 0; row < bs; row++) {
for (col = 0; col < bs; col++) {
m[(block_row + row) * mis + block_col + col].mbmi.sb_type = bsize;
}
}
for (block_row = 0; block_row < 8; ++block_row) {
for (block_col = 0; block_col < 8; ++block_col) {
m[block_row * mis + block_col].mbmi.sb_type = bsize;
}
}
}
......@@ -1500,12 +1492,18 @@ 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.partition_by_variance || cpi->sf.use_lastframe_partitioning) {
if (cpi->sf.partition_by_variance || cpi->sf.use_lastframe_partitioning ||
cpi->sf.use_one_partition_size_always ) {
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->sf.partition_by_variance) {
if (cpi->sf.use_one_partition_size_always) {
set_offsets(cpi, mi_row, mi_col, BLOCK_SIZE_SB64X64);
set_partitioning(cpi, m, cpi->sf.always_this_block_size);
rd_use_partition(cpi, m, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
&dummy_rate, &dummy_dist);
} else 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);
......@@ -1517,8 +1515,6 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, TOKENEXTRA **tp,
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);
......
......@@ -691,6 +691,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->skip_lots_of_modes = 0;
sf->adjust_thresholds_by_speed = 0;
sf->partition_by_variance = 0;
sf->use_one_partition_size_always = 0;
#if CONFIG_MULTIPLE_ARF
// Switch segmentation off.
......@@ -728,6 +729,12 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->partition_by_variance = 1;
sf->first_step = 0;
}
if (speed == 4) {
sf->first_step = 0;
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_SB8X8;
sf->use_one_partition_size_always = 1;
sf->always_this_block_size = BLOCK_SIZE_MB16X16;
}
break;
}; /* switch */
......
......@@ -223,6 +223,8 @@ typedef struct {
int skip_lots_of_modes;
int adjust_thresholds_by_speed;
int partition_by_variance;
int use_one_partition_size_always;
BLOCK_SIZE_TYPE always_this_block_size;
} 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