Commit 107929dc authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Adding FAST_COEFF_UPDATE enum.

Change-Id: I75ad328c6d719df81cc24f3ae21c152af4ebdacc
parent 9848d67b
...@@ -521,7 +521,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi, ...@@ -521,7 +521,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
const int entropy_nodes_update = UNCONSTRAINED_NODES; const int entropy_nodes_update = UNCONSTRAINED_NODES;
int i, j, k, l, t; int i, j, k, l, t;
switch (cpi->sf.use_fast_coef_updates) { switch (cpi->sf.use_fast_coef_updates) {
case 0: { case TWO_LOOP: {
/* dry run to see if there is any udpate at all needed */ /* dry run to see if there is any udpate at all needed */
int savings = 0; int savings = 0;
int update[2] = {0, 0}; int update[2] = {0, 0};
...@@ -596,14 +596,14 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi, ...@@ -596,14 +596,14 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
return; return;
} }
case 1: case ONE_LOOP:
case 2: { case ONE_LOOP_REDUCED: {
const int prev_coef_contexts_to_update = const int prev_coef_contexts_to_update =
cpi->sf.use_fast_coef_updates == 2 ? COEFF_CONTEXTS >> 1 cpi->sf.use_fast_coef_updates == ONE_LOOP_REDUCED ?
: COEFF_CONTEXTS; COEFF_CONTEXTS >> 1 : COEFF_CONTEXTS;
const int coef_band_to_update = const int coef_band_to_update =
cpi->sf.use_fast_coef_updates == 2 ? COEF_BANDS >> 1 cpi->sf.use_fast_coef_updates == ONE_LOOP_REDUCED ?
: COEF_BANDS; COEF_BANDS >> 1 : COEF_BANDS;
int updates = 0; int updates = 0;
int noupdates_before_first = 0; int noupdates_before_first = 0;
for (i = 0; i < PLANE_TYPES; ++i) { for (i = 0; i < PLANE_TYPES; ++i) {
......
...@@ -111,7 +111,7 @@ static void set_good_speed_feature(VP9_COMP *cpi, ...@@ -111,7 +111,7 @@ static void set_good_speed_feature(VP9_COMP *cpi,
sf->adaptive_rd_thresh = 3; sf->adaptive_rd_thresh = 3;
sf->mode_skip_start = 6; sf->mode_skip_start = 6;
sf->use_fast_coef_updates = 2; sf->use_fast_coef_updates = ONE_LOOP_REDUCED;
sf->use_fast_coef_costing = 1; sf->use_fast_coef_costing = 1;
} }
// Additions or changes for speed 3 and above // Additions or changes for speed 3 and above
...@@ -220,7 +220,7 @@ static void set_rt_speed_feature(VP9_COMMON *cm, ...@@ -220,7 +220,7 @@ static void set_rt_speed_feature(VP9_COMMON *cm,
sf->use_uv_intra_rd_estimate = 1; sf->use_uv_intra_rd_estimate = 1;
sf->skip_encode_sb = 1; sf->skip_encode_sb = 1;
sf->subpel_iters_per_step = 1; sf->subpel_iters_per_step = 1;
sf->use_fast_coef_updates = 2; sf->use_fast_coef_updates = ONE_LOOP_REDUCED;
sf->adaptive_rd_thresh = 4; sf->adaptive_rd_thresh = 4;
sf->mode_skip_start = 6; sf->mode_skip_start = 6;
sf->allow_skip_recode = 0; sf->allow_skip_recode = 0;
...@@ -328,7 +328,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) { ...@@ -328,7 +328,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->use_uv_intra_rd_estimate = 0; sf->use_uv_intra_rd_estimate = 0;
sf->allow_skip_recode = 0; sf->allow_skip_recode = 0;
sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE; sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE;
sf->use_fast_coef_updates = 0; sf->use_fast_coef_updates = TWO_LOOP;
sf->use_fast_coef_costing = 0; sf->use_fast_coef_costing = 0;
sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set
sf->use_nonrd_pick_mode = 0; sf->use_nonrd_pick_mode = 0;
......
...@@ -113,6 +113,19 @@ typedef enum { ...@@ -113,6 +113,19 @@ typedef enum {
VAR_BASED_PARTITION VAR_BASED_PARTITION
} PARTITION_SEARCH_TYPE; } PARTITION_SEARCH_TYPE;
typedef enum {
// Does a dry run to see if any of the contexts need to be updated or not,
// before the final run.
TWO_LOOP = 0,
// No dry run conducted.
ONE_LOOP = 1,
// No dry run, also only half the coef contexts and bands are updated.
// The rest are not updated at all.
ONE_LOOP_REDUCED = 2
} FAST_COEFF_UPDATE;
typedef struct { typedef struct {
// Frame level coding parameter update // Frame level coding parameter update
int frame_parameter_update; int frame_parameter_update;
...@@ -291,7 +304,7 @@ typedef struct { ...@@ -291,7 +304,7 @@ typedef struct {
// This feature limits the number of coefficients updates we actually do // This feature limits the number of coefficients updates we actually do
// by only looking at counts from 1/2 the bands. // by only looking at counts from 1/2 the bands.
int use_fast_coef_updates; // 0: 2-loop, 1: 1-loop, 2: 1-loop reduced FAST_COEFF_UPDATE use_fast_coef_updates;
// This flag controls the use of non-RD mode decision. // This flag controls the use of non-RD mode decision.
int use_nonrd_pick_mode; int use_nonrd_pick_mode;
......
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