Commit f3739f90 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Consistent mode names.

Change-Id: Icb4851d98c951506fe5d73d8d5a8ac7e53fecfd0
parent 07dddfa3
......@@ -376,7 +376,7 @@ static void update_reference_segmentation_map(VP9_COMP *cpi) {
}
}
static int is_slowest_mode(int mode) {
return (mode == MODE_SECONDPASS_BEST || mode == MODE_BESTQUALITY);
return (mode == TWO_PASS_SECOND_BEST || mode == ONE_PASS_BEST);
}
static void set_rd_speed_thresholds(VP9_COMP *cpi) {
......@@ -670,7 +670,7 @@ static void init_config(struct VP9_COMP *cpi, VP9_CONFIG *oxcf) {
if ((cpi->svc.number_temporal_layers > 1 &&
cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) ||
(cpi->svc.number_spatial_layers > 1 &&
cpi->oxcf.mode == MODE_SECONDPASS_BEST)) {
cpi->oxcf.mode == TWO_PASS_SECOND_BEST)) {
vp9_init_layer_context(cpi);
}
......@@ -710,29 +710,29 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
switch (cpi->oxcf.mode) {
// Real time and one pass deprecated in test code base
case MODE_GOODQUALITY:
case ONE_PASS_GOOD:
cpi->pass = 0;
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
break;
case MODE_BESTQUALITY:
case ONE_PASS_BEST:
cpi->pass = 0;
break;
case MODE_FIRSTPASS:
case TWO_PASS_FIRST:
cpi->pass = 1;
break;
case MODE_SECONDPASS:
case TWO_PASS_SECOND_GOOD:
cpi->pass = 2;
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
break;
case MODE_SECONDPASS_BEST:
case TWO_PASS_SECOND_BEST:
cpi->pass = 2;
break;
case MODE_REALTIME:
case REALTIME:
cpi->pass = 0;
break;
}
......
......@@ -142,33 +142,33 @@ typedef enum {
// Good Quality Fast Encoding. The encoder balances quality with the
// amount of time it takes to encode the output. (speed setting
// controls how fast)
MODE_GOODQUALITY = 1,
ONE_PASS_GOOD = 1,
// One Pass - Best Quality. The encoder places priority on the
// quality of the output over encoding speed. The output is compressed
// at the highest possible quality. This option takes the longest
// amount of time to encode. (speed setting ignored)
MODE_BESTQUALITY = 2,
ONE_PASS_BEST = 2,
// Two Pass - First Pass. The encoder generates a file of statistics
// for use in the second encoding pass. (speed setting controls how fast)
MODE_FIRSTPASS = 3,
TWO_PASS_FIRST = 3,
// Two Pass - Second Pass. The encoder uses the statistics that were
// generated in the first encoding pass to create the compressed
// output. (speed setting controls how fast)
MODE_SECONDPASS = 4,
TWO_PASS_SECOND_GOOD = 4,
// Two Pass - Second Pass Best. The encoder uses the statistics that
// were generated in the first encoding pass to create the compressed
// output using the highest possible quality, and taking a
// longer amount of time to encode. (speed setting ignored)
MODE_SECONDPASS_BEST = 5,
TWO_PASS_SECOND_BEST = 5,
// Realtime/Live Encoding. This mode is optimized for realtime
// encoding (for example, capturing a television signal or feed from
// a live camera). (speed setting controls how fast)
MODE_REALTIME = 6,
REALTIME = 6,
} MODE;
typedef enum {
......
......@@ -1806,8 +1806,8 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
if (best_rd < label_mv_thresh)
break;
if (cpi->oxcf.mode != MODE_SECONDPASS_BEST &&
cpi->oxcf.mode != MODE_BESTQUALITY) {
if (cpi->oxcf.mode != TWO_PASS_SECOND_BEST &&
cpi->oxcf.mode != ONE_PASS_BEST) {
// use previous block's result as next block's MV predictor.
if (i > 0) {
bsi->mvp.as_int = mi->bmi[i - 1].as_mv[0].as_int;
......@@ -1883,8 +1883,8 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
}
// Should we do a full search (best quality only)
if (cpi->oxcf.mode == MODE_BESTQUALITY ||
cpi->oxcf.mode == MODE_SECONDPASS_BEST) {
if (cpi->oxcf.mode == ONE_PASS_BEST ||
cpi->oxcf.mode == TWO_PASS_SECOND_BEST) {
int_mv *const best_mv = &mi->bmi[i].as_mv[0];
/* Check if mvp_full is within the range. */
clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max,
......
......@@ -346,16 +346,16 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->recode_tolerance = 25;
switch (oxcf->mode) {
case MODE_BESTQUALITY:
case MODE_SECONDPASS_BEST: // This is the best quality mode.
case ONE_PASS_BEST:
case TWO_PASS_SECOND_BEST: // This is the best quality mode.
cpi->diamond_search_sad = vp9_full_range_search;
break;
case MODE_FIRSTPASS:
case MODE_GOODQUALITY:
case MODE_SECONDPASS:
case TWO_PASS_FIRST:
case ONE_PASS_GOOD:
case TWO_PASS_SECOND_GOOD:
set_good_speed_feature(cpi, cm, sf, speed);
break;
case MODE_REALTIME:
case REALTIME:
set_rt_speed_feature(cm, sf, speed);
break;
}
......@@ -378,7 +378,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
cpi->mb.optimize = sf->optimize_coefficients == 1 && cpi->pass != 1;
if (cpi->encode_breakout && oxcf->mode == MODE_REALTIME &&
if (cpi->encode_breakout && oxcf->mode == REALTIME &&
sf->encode_breakout_thresh > cpi->encode_breakout)
cpi->encode_breakout = sf->encode_breakout_thresh;
......
......@@ -300,13 +300,13 @@ static vpx_codec_err_t set_encoder_config(
switch (cfg->g_pass) {
case VPX_RC_ONE_PASS:
oxcf->mode = MODE_GOODQUALITY;
oxcf->mode = ONE_PASS_GOOD;
break;
case VPX_RC_FIRST_PASS:
oxcf->mode = MODE_FIRSTPASS;
oxcf->mode = TWO_PASS_FIRST;
break;
case VPX_RC_LAST_PASS:
oxcf->mode = MODE_SECONDPASS_BEST;
oxcf->mode = TWO_PASS_SECOND_BEST;
break;
}
......@@ -591,7 +591,7 @@ static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx,
unsigned long duration,
unsigned long deadline) {
// Use best quality mode if no deadline is given.
MODE new_qc = MODE_BESTQUALITY;
MODE new_qc = ONE_PASS_BEST;
if (deadline) {
// Convert duration parameter from stream timebase to microseconds
......@@ -601,14 +601,14 @@ static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx,
// If the deadline is more that the duration this frame is to be shown,
// use good quality mode. Otherwise use realtime mode.
new_qc = (deadline > duration_us) ? MODE_GOODQUALITY : MODE_REALTIME;
new_qc = (deadline > duration_us) ? ONE_PASS_GOOD : REALTIME;
}
if (ctx->cfg.g_pass == VPX_RC_FIRST_PASS)
new_qc = MODE_FIRSTPASS;
new_qc = TWO_PASS_FIRST;
else if (ctx->cfg.g_pass == VPX_RC_LAST_PASS)
new_qc = (new_qc == MODE_BESTQUALITY) ? MODE_SECONDPASS_BEST
: MODE_SECONDPASS;
new_qc = (new_qc == ONE_PASS_BEST) ? TWO_PASS_SECOND_BEST
: TWO_PASS_SECOND_GOOD;
if (ctx->oxcf.mode != new_qc) {
ctx->oxcf.mode = new_qc;
......
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