Commit 2c8c1f53 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Replacing cpu_used with speed in VP9_CONFIG.

Change-Id: I86b85b5c11388e84a48f8936330c0d920df5d1f0
parent 833ad89f
......@@ -911,7 +911,7 @@ static int get_twopass_worst_quality(const VP9_COMP *cpi,
const int num_mbs = cpi->common.MBs;
const double section_err = stats->coded_error / stats->count;
const double err_per_mb = section_err / num_mbs;
const double speed_term = 1.0 + 0.04 * cpi->speed;
const double speed_term = 1.0 + 0.04 * cpi->oxcf.speed;
const int target_norm_bits_per_mb = ((uint64_t)section_target_bandwidth <<
BPER_MB_NORMBITS) / num_mbs;
int q;
......
......@@ -38,8 +38,8 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
// Further step/diamond searches as necessary
int step_param = cpi->sf.reduce_first_step_size +
(cpi->speed < 8 ? (cpi->speed > 5 ? 1 : 0) : 2);
step_param = MIN(step_param, (cpi->sf.max_step_search_steps - 2));
(cpi->oxcf.speed > 5 ? 1 : 0);
step_param = MIN(step_param, cpi->sf.max_step_search_steps - 2);
vp9_set_mv_search_range(x, ref_mv);
......
......@@ -705,14 +705,10 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
cpi->oxcf = *oxcf;
if (cpi->oxcf.cpu_used == -6)
cpi->oxcf.play_alternate = 0;
switch (cpi->oxcf.mode) {
// Real time and one pass deprecated in test code base
case ONE_PASS_GOOD:
cpi->pass = 0;
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
break;
case ONE_PASS_BEST:
......@@ -725,7 +721,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
case TWO_PASS_SECOND_GOOD:
cpi->pass = 2;
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
break;
case TWO_PASS_SECOND_BEST:
......@@ -734,6 +729,7 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
case REALTIME:
cpi->pass = 0;
cpi->oxcf.play_alternate = 0;
break;
}
......@@ -833,8 +829,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
(int)cpi->oxcf.target_bandwidth);
}
cpi->speed = abs(cpi->oxcf.cpu_used);
#if CONFIG_MULTIPLE_ARF
vp9_zero(cpi->alt_ref_source);
#else
......
......@@ -196,7 +196,7 @@ typedef struct VP9_CONFIG {
int noise_sensitivity; // pre processing blur: recommendation 0
int sharpness; // sharpening output: recommendation 0:
int cpu_used;
int speed;
unsigned int rc_max_intra_bitrate_pct;
MODE mode;
......@@ -402,10 +402,6 @@ typedef struct VP9_COMP {
int mbgraph_n_frames; // number of frames filled in the above
int static_mb_pct; // % forced skip mbs by segmentation
// for real time encoding
int speed;
int cpu_used;
int pass;
int ref_frame_flags;
......
......@@ -451,7 +451,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
x->pred_sse[ref] = sse;
// Fast approximate the modelling function.
if (cpi->speed > 4) {
if (cpi->oxcf.speed > 4) {
int64_t rate;
int64_t dist;
int64_t square_error = sse;
......
......@@ -289,7 +289,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
SPEED_FEATURES *const sf = &cpi->sf;
VP9_COMMON *const cm = &cpi->common;
const VP9_CONFIG *const oxcf = &cpi->oxcf;
const int speed = cpi->speed < 0 ? -cpi->speed : cpi->speed;
int i;
// best quality defaults
......@@ -360,10 +359,10 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
case TWO_PASS_FIRST:
case ONE_PASS_GOOD:
case TWO_PASS_SECOND_GOOD:
set_good_speed_feature(cpi, cm, sf, speed);
set_good_speed_feature(cpi, cm, sf, oxcf->speed);
break;
case REALTIME:
set_rt_speed_feature(cm, sf, speed);
set_rt_speed_feature(cm, sf, oxcf->speed);
break;
}
......
......@@ -151,12 +151,8 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
xd->plane[0].pre[0].buf = frame_ptr_buf;
xd->plane[0].pre[0].stride = stride;
// Further step/diamond searches as necessary
if (cpi->speed < 8)
step_param = cpi->sf.reduce_first_step_size + ((cpi->speed > 5) ? 1 : 0);
else
step_param = cpi->sf.reduce_first_step_size + 2;
step_param = MIN(step_param, (cpi->sf.max_step_search_steps - 2));
step_param = cpi->sf.reduce_first_step_size + (cpi->oxcf.speed > 5 ? 1 : 0);
step_param = MIN(step_param, cpi->sf.max_step_search_steps - 2);
/*cpi->sf.search_method == HEX*/
// Ignore mv costing by sending NULL pointer instead of cost arrays
......
......@@ -356,7 +356,7 @@ static vpx_codec_err_t set_encoder_config(
oxcf->key_freq = cfg->kf_max_dist;
oxcf->cpu_used = extra_cfg->cpu_used;
oxcf->speed = clamp(abs(extra_cfg->cpu_used), 0, 7);
oxcf->encode_breakout = extra_cfg->static_thresh;
oxcf->play_alternate = extra_cfg->enable_auto_alt_ref;
oxcf->noise_sensitivity = extra_cfg->noise_sensitivity;
......
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