Merge "Image size restriction to rd auto partition search."

This commit is contained in:
paulwilkins 2015-05-07 14:12:13 +00:00 коммит произвёл Gerrit Code Review
Родитель 92b199061a 4a7dcf8eb2
Коммит aecb1770d5
3 изменённых файлов: 29 добавлений и 2 удалений

Просмотреть файл

@ -2198,7 +2198,7 @@ static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
max_size = find_partition_size(max_size, max_size = find_partition_size(max_size,
row8x8_remaining, col8x8_remaining, row8x8_remaining, col8x8_remaining,
&bh, &bw); &bh, &bw);
min_size = MIN(min_size, max_size); min_size = MIN(cpi->sf.rd_auto_partition_min_limit, MIN(min_size, max_size));
// When use_square_partition_only is true, make sure at least one square // When use_square_partition_only is true, make sure at least one square
// partition is allowed by selecting the next smaller square size as // partition is allowed by selecting the next smaller square size as

Просмотреть файл

@ -72,6 +72,29 @@ static void set_good_speed_feature_framesize_dependent(VP9_COMMON *cm,
} }
} }
// Sets a partition size down to which the auto partition code will always
// search (can go lower), based on the image dimensions. The logic here
// is that the extent to which ringing artefacts are offensive, depends
// partly on the screen area that over which they propogate. Propogation is
// limited by transform block size but the screen area take up by a given block
// size will be larger for a small image format stretched to full screen.
static BLOCK_SIZE set_partition_min_limit(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
unsigned int screen_area = (cm->width * cm->height);
// Select block size based on image format size.
if (screen_area < 1280 * 720) {
// Formats smaller in area than 720P
return BLOCK_4X4;
} else if (screen_area < 1920 * 1080) {
// Format >= 720P and < 1080P
return BLOCK_8X8;
} else {
// Formats 1080P and up
return BLOCK_16X16;
}
}
static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm, static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
SPEED_FEATURES *sf, int speed) { SPEED_FEATURES *sf, int speed) {
const int boosted = frame_is_boosted(cpi); const int boosted = frame_is_boosted(cpi);
@ -116,7 +139,7 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
sf->disable_filter_search_var_thresh = 100; sf->disable_filter_search_var_thresh = 100;
sf->comp_inter_joint_search_thresh = BLOCK_SIZES; sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX; sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
sf->rd_auto_partition_min_limit = set_partition_min_limit(cpi);
sf->allow_partition_search_skip = 1; sf->allow_partition_search_skip = 1;
} }
@ -420,6 +443,7 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
sf->less_rectangular_check = 0; sf->less_rectangular_check = 0;
sf->use_square_partition_only = 0; sf->use_square_partition_only = 0;
sf->auto_min_max_partition_size = NOT_IN_USE; sf->auto_min_max_partition_size = NOT_IN_USE;
sf->rd_auto_partition_min_limit = BLOCK_4X4;
sf->default_max_partition_size = BLOCK_64X64; sf->default_max_partition_size = BLOCK_64X64;
sf->default_min_partition_size = BLOCK_4X4; sf->default_min_partition_size = BLOCK_4X4;
sf->adjust_partitioning_from_last_frame = 0; sf->adjust_partitioning_from_last_frame = 0;

Просмотреть файл

@ -271,6 +271,9 @@ typedef struct SPEED_FEATURES {
// Sets min and max partition sizes for this 64x64 region based on the // Sets min and max partition sizes for this 64x64 region based on the
// same 64x64 in last encoded frame, and the left and above neighbor. // same 64x64 in last encoded frame, and the left and above neighbor.
AUTO_MIN_MAX_MODE auto_min_max_partition_size; AUTO_MIN_MAX_MODE auto_min_max_partition_size;
// Ensures the rd based auto partition search will always
// go down at least to the specified level.
BLOCK_SIZE rd_auto_partition_min_limit;
// Min and max partition size we enable (block_size) as per auto // Min and max partition size we enable (block_size) as per auto
// min max, but also used by adjust partitioning, and pick_partitioning. // min max, but also used by adjust partitioning, and pick_partitioning.