Commit d7338aa8 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Misc. clean ups / refactor of speed 1

With this patch, and the speed settings turned on for speed 1,
the coding efficiency of speed 1 in default configuration should be
only a little worse than speed 0, but it should roughly run at
double the speed.

Specifically, this patch makes various changes to make sure that
speed 1 behaves exactly the same as speed 0 except for speed settings
turned on or off in speed_features.c.

This will change the bitstream generated a little for speeds
1 or higher because of the following reasons:
1. Removes a hacky speed setting correction factor in firstpass.c
2. Fast cdef search is moved from speed 1+ to 2+, and a new speed
feature is added to control that.
3. Mesh search settings are pushed down one level so that speeds 0
and 1 use the same settings.
4. A disable_split_mask feature for animated content previously
turned on speeds 1+ is moved down to speeds 2+.

Change-Id: I0ec36556f157bdc42c5daa0cfb9518cf7ff65f6b
parent 6f77d081
......@@ -4594,7 +4594,7 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
} else {
// Find CDEF parameters
av1_cdef_search(cm->frame_to_show, cpi->source, cm, xd,
cpi->oxcf.speed > 0);
cpi->sf.fast_cdef_search);
// Apply the filter
av1_cdef_frame(cm->frame_to_show, cm, xd);
......
......@@ -1151,7 +1151,7 @@ static int get_twopass_worst_quality(const AV1_COMP *cpi,
: cpi->common.MBs;
const int active_mbs = AOMMAX(1, num_mbs - (int)(num_mbs * inactive_zone));
const double av_err_per_mb = section_err / active_mbs;
const double speed_term = 1.0 + 0.04 * oxcf->speed;
const double speed_term = 1.0;
double ediv_size_correction;
const int target_norm_bits_per_mb =
(int)((uint64_t)section_target_bandwidth << BPER_MB_NORMBITS) /
......
......@@ -28,19 +28,19 @@ static MESH_PATTERN
{ { 64, 16 }, { 24, 8 }, { 12, 4 }, { 7, 1 } },
};
static unsigned char good_quality_max_mesh_pct[MAX_MESH_SPEED + 1] = {
50, 25, 15, 5, 1, 1
50, 50, 25, 15, 5, 1
};
#if CONFIG_INTRABC
// TODO(aconverse@google.com): These settings are pretty relaxed, tune them for
// each speed setting
static MESH_PATTERN intrabc_mesh_patterns[MAX_MESH_SPEED + 1][MAX_MESH_STEP] = {
{ { 256, 1 }, { 256, 1 }, { 0, 0 }, { 0, 0 } },
{ { 256, 1 }, { 256, 1 }, { 0, 0 }, { 0, 0 } },
{ { 64, 1 }, { 64, 1 }, { 0, 0 }, { 0, 0 } },
{ { 64, 1 }, { 64, 1 }, { 0, 0 }, { 0, 0 } },
{ { 64, 4 }, { 16, 1 }, { 0, 0 }, { 0, 0 } },
{ { 64, 4 }, { 16, 1 }, { 0, 0 }, { 0, 0 } },
{ { 64, 4 }, { 16, 1 }, { 0, 0 }, { 0, 0 } },
};
static uint8_t intrabc_max_mesh_pct[MAX_MESH_SPEED + 1] = { 100, 100, 100,
25, 25, 10 };
......@@ -110,9 +110,9 @@ static void set_good_speed_feature_framesize_dependent(AV1_COMP *cpi,
}
// If this is a two pass clip that fits the criteria for animated or
// graphics content then reset disable_split_mask for speeds 1-4.
// graphics content then reset disable_split_mask for speeds 2+.
// Also if the image edge is internal to the coded area.
if ((speed >= 1) && (cpi->oxcf.pass == 2) &&
if ((speed >= 2) && (cpi->oxcf.pass == 2) &&
((cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) ||
(av1_internal_image_edge(cpi)))) {
sf->disable_split_mask = DISABLE_COMPOUND_SPLIT;
......@@ -156,6 +156,9 @@ static void set_good_speed_features_framesize_independent(AV1_COMP *cpi,
} else {
sf->use_square_partition_only = !frame_is_intra_only(cm);
}
#if CONFIG_CDEF
sf->fast_cdef_search = 1;
#endif // CONFIG_CDEF
sf->less_rectangular_check = 1;
......@@ -445,6 +448,9 @@ void av1_set_speed_features_framesize_independent(AV1_COMP *cpi) {
#if CONFIG_EXT_PARTITION_TYPES
sf->prune_ext_partition_types_search = 0;
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_CDEF
sf->fast_cdef_search = 0;
#endif // CONFIG_CDEF
// Set this at the appropriate speed levels
sf->use_transform_domain_distortion = 0;
......
......@@ -343,6 +343,10 @@ typedef struct SPEED_FEATURES {
int prune_ext_partition_types_search;
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_CDEF
int fast_cdef_search;
#endif // CONFIG_CDEF
// Skip rectangular partition test when partition type none gives better
// rd than partition type split.
int less_rectangular_check;
......
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