diff options
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_mbgraph.c | 4 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 8 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_int.h | 6 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_speed_features.c | 5 | ||||
-rw-r--r-- | vp9/encoder/vp9_temporal_filter.c | 8 | ||||
-rw-r--r-- | vp9/vp9_cx_iface.c | 2 |
8 files changed, 11 insertions, 26 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index b155fd39e..16f5cb1b5 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -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; diff --git a/vp9/encoder/vp9_mbgraph.c b/vp9/encoder/vp9_mbgraph.c index a9da7283a..2f63a13a0 100644 --- a/vp9/encoder/vp9_mbgraph.c +++ b/vp9/encoder/vp9_mbgraph.c @@ -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); diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 0d6b62509..5a7257338 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -694,14 +694,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: @@ -714,7 +710,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: @@ -723,6 +718,7 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) { case REALTIME: cpi->pass = 0; + cpi->oxcf.play_alternate = 0; break; } @@ -822,8 +818,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 diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h index 571afaa35..a9ae7b3a8 100644 --- a/vp9/encoder/vp9_onyx_int.h +++ b/vp9/encoder/vp9_onyx_int.h @@ -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; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 5d53aaaa2..8766de66a 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -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; diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 6e0effae3..f79ded5f9 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -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; } diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c index 041027354..c98c9d415 100644 --- a/vp9/encoder/vp9_temporal_filter.c +++ b/vp9/encoder/vp9_temporal_filter.c @@ -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 diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index 95b3500c7..87d4bb7c1 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -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; |