remove confusing compressor_speed
use mode instead Change-Id: I419d7a2dc4b0714ca6ff723c5e824521c150c460
This commit is contained in:
@@ -2787,7 +2787,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
|||||||
cm->reference_mode = reference_mode;
|
cm->reference_mode = reference_mode;
|
||||||
cm->interp_filter = interp_filter;
|
cm->interp_filter = interp_filter;
|
||||||
|
|
||||||
if (cpi->compressor_speed == 3)
|
if (cpi->oxcf.mode == MODE_REALTIME)
|
||||||
encode_rtc_frame_internal(cpi);
|
encode_rtc_frame_internal(cpi);
|
||||||
else
|
else
|
||||||
encode_frame_internal(cpi);
|
encode_frame_internal(cpi);
|
||||||
@@ -2945,7 +2945,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
|
|||||||
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
||||||
x->skip_recode = !x->select_txfm_size && mbmi->sb_type >= BLOCK_8X8 &&
|
x->skip_recode = !x->select_txfm_size && mbmi->sb_type >= BLOCK_8X8 &&
|
||||||
(cpi->oxcf.aq_mode != COMPLEXITY_AQ) &&
|
(cpi->oxcf.aq_mode != COMPLEXITY_AQ) &&
|
||||||
cpi->compressor_speed != 3;
|
cpi->oxcf.mode != MODE_REALTIME;
|
||||||
x->skip_optimize = ctx->is_coded;
|
x->skip_optimize = ctx->is_coded;
|
||||||
ctx->is_coded = 1;
|
ctx->is_coded = 1;
|
||||||
x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct;
|
x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct;
|
||||||
|
|||||||
@@ -455,14 +455,17 @@ static void update_reference_segmentation_map(VP9_COMP *cpi) {
|
|||||||
cache_ptr += cm->mi_cols;
|
cache_ptr += cm->mi_cols;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static int is_slowest_mode(int mode) {
|
||||||
|
return (mode == MODE_SECONDPASS_BEST || mode == MODE_BESTQUALITY);
|
||||||
|
}
|
||||||
|
|
||||||
static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode) {
|
static void set_rd_speed_thresholds(VP9_COMP *cpi) {
|
||||||
SPEED_FEATURES *sf = &cpi->sf;
|
SPEED_FEATURES *sf = &cpi->sf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Set baseline threshold values
|
// Set baseline threshold values
|
||||||
for (i = 0; i < MAX_MODES; ++i)
|
for (i = 0; i < MAX_MODES; ++i)
|
||||||
sf->thresh_mult[i] = mode == 0 ? -500 : 0;
|
sf->thresh_mult[i] = is_slowest_mode(cpi->oxcf.mode) ? -500 : 0;
|
||||||
|
|
||||||
sf->thresh_mult[THR_NEARESTMV] = 0;
|
sf->thresh_mult[THR_NEARESTMV] = 0;
|
||||||
sf->thresh_mult[THR_NEARESTG] = 0;
|
sf->thresh_mult[THR_NEARESTG] = 0;
|
||||||
@@ -538,12 +541,12 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi, int mode) {
|
static void set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi) {
|
||||||
SPEED_FEATURES *sf = &cpi->sf;
|
SPEED_FEATURES *sf = &cpi->sf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_REFS; ++i)
|
for (i = 0; i < MAX_REFS; ++i)
|
||||||
sf->thresh_mult_sub8x8[i] = mode == 0 ? -500 : 0;
|
sf->thresh_mult_sub8x8[i] = is_slowest_mode(cpi->oxcf.mode) ? -500 : 0;
|
||||||
|
|
||||||
sf->thresh_mult_sub8x8[THR_LAST] += 2500;
|
sf->thresh_mult_sub8x8[THR_LAST] += 2500;
|
||||||
sf->thresh_mult_sub8x8[THR_GOLD] += 2500;
|
sf->thresh_mult_sub8x8[THR_GOLD] += 2500;
|
||||||
@@ -853,7 +856,6 @@ static void set_rt_speed_feature(VP9_COMMON *cm,
|
|||||||
void vp9_set_speed_features(VP9_COMP *cpi) {
|
void vp9_set_speed_features(VP9_COMP *cpi) {
|
||||||
SPEED_FEATURES *sf = &cpi->sf;
|
SPEED_FEATURES *sf = &cpi->sf;
|
||||||
VP9_COMMON *cm = &cpi->common;
|
VP9_COMMON *cm = &cpi->common;
|
||||||
int mode = cpi->compressor_speed;
|
|
||||||
int speed = cpi->speed;
|
int speed = cpi->speed;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -907,22 +909,25 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
|
|||||||
sf->using_small_partition_info = 0;
|
sf->using_small_partition_info = 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
|
||||||
|
|
||||||
switch (mode) {
|
switch (cpi->oxcf.mode) {
|
||||||
case 0: // This is the best quality mode.
|
case MODE_BESTQUALITY:
|
||||||
|
case MODE_SECONDPASS_BEST: // This is the best quality mode.
|
||||||
cpi->diamond_search_sad = vp9_full_range_search;
|
cpi->diamond_search_sad = vp9_full_range_search;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MODE_FIRSTPASS:
|
||||||
|
case MODE_GOODQUALITY:
|
||||||
|
case MODE_SECONDPASS:
|
||||||
set_good_speed_feature(cm, sf, speed);
|
set_good_speed_feature(cm, sf, speed);
|
||||||
break;
|
break;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MODE_REALTIME:
|
||||||
set_rt_speed_feature(cm, sf, speed);
|
set_rt_speed_feature(cm, sf, speed);
|
||||||
break;
|
break;
|
||||||
}; /* switch */
|
}; /* switch */
|
||||||
|
|
||||||
// Set rd thresholds based on mode and speed setting
|
// Set rd thresholds based on mode and speed setting
|
||||||
set_rd_speed_thresholds(cpi, mode);
|
set_rd_speed_thresholds(cpi);
|
||||||
set_rd_speed_thresholds_sub8x8(cpi, mode);
|
set_rd_speed_thresholds_sub8x8(cpi);
|
||||||
|
|
||||||
// Slow quant, dct and trellis not worthwhile for first pass
|
// Slow quant, dct and trellis not worthwhile for first pass
|
||||||
// so make sure they are always turned off.
|
// so make sure they are always turned off.
|
||||||
@@ -1243,29 +1248,24 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
|
|||||||
// Real time and one pass deprecated in test code base
|
// Real time and one pass deprecated in test code base
|
||||||
case MODE_GOODQUALITY:
|
case MODE_GOODQUALITY:
|
||||||
cpi->pass = 0;
|
cpi->pass = 0;
|
||||||
cpi->compressor_speed = 2;
|
|
||||||
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
|
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_FIRSTPASS:
|
case MODE_FIRSTPASS:
|
||||||
cpi->pass = 1;
|
cpi->pass = 1;
|
||||||
cpi->compressor_speed = 1;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_SECONDPASS:
|
case MODE_SECONDPASS:
|
||||||
cpi->pass = 2;
|
cpi->pass = 2;
|
||||||
cpi->compressor_speed = 1;
|
|
||||||
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
|
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_SECONDPASS_BEST:
|
case MODE_SECONDPASS_BEST:
|
||||||
cpi->pass = 2;
|
cpi->pass = 2;
|
||||||
cpi->compressor_speed = 0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_REALTIME:
|
case MODE_REALTIME:
|
||||||
cpi->pass = 0;
|
cpi->pass = 0;
|
||||||
cpi->compressor_speed = 3;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2550,7 +2550,7 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
|
|||||||
|
|
||||||
vpx_usec_timer_start(&timer);
|
vpx_usec_timer_start(&timer);
|
||||||
|
|
||||||
if (cpi->compressor_speed == 3)
|
if (cpi->oxcf.mode == MODE_REALTIME)
|
||||||
lf->filter_level = 4;
|
lf->filter_level = 4;
|
||||||
else
|
else
|
||||||
vp9_pick_filter_level(cpi->Source, cpi, cpi->sf.use_fast_lpf_pick);
|
vp9_pick_filter_level(cpi->Source, cpi, cpi->sf.use_fast_lpf_pick);
|
||||||
@@ -2742,7 +2742,7 @@ static void encode_with_recode_loop(VP9_COMP *cpi,
|
|||||||
if (cpi->sf.recode_loop != 0) {
|
if (cpi->sf.recode_loop != 0) {
|
||||||
vp9_save_coding_context(cpi);
|
vp9_save_coding_context(cpi);
|
||||||
cpi->dummy_packing = 1;
|
cpi->dummy_packing = 1;
|
||||||
if (cpi->compressor_speed != 3)
|
if (cpi->oxcf.mode != MODE_REALTIME)
|
||||||
vp9_pack_bitstream(cpi, dest, size);
|
vp9_pack_bitstream(cpi, dest, size);
|
||||||
|
|
||||||
cpi->rc.projected_frame_size = (*size) << 3;
|
cpi->rc.projected_frame_size = (*size) << 3;
|
||||||
@@ -3101,7 +3101,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
|
|||||||
// JBB : This is realtime mode. In real time mode the first frame
|
// JBB : This is realtime mode. In real time mode the first frame
|
||||||
// should be larger. Q of 0 is disabled because we force tx size to be
|
// should be larger. Q of 0 is disabled because we force tx size to be
|
||||||
// 16x16...
|
// 16x16...
|
||||||
if (cpi->compressor_speed == 3) {
|
if (cpi->oxcf.mode == MODE_REALTIME) {
|
||||||
if (cpi->common.current_video_frame == 0)
|
if (cpi->common.current_video_frame == 0)
|
||||||
q /= 3;
|
q /= 3;
|
||||||
|
|
||||||
|
|||||||
@@ -551,7 +551,6 @@ typedef struct VP9_COMP {
|
|||||||
|
|
||||||
// for real time encoding
|
// for real time encoding
|
||||||
int speed;
|
int speed;
|
||||||
int compressor_speed;
|
|
||||||
|
|
||||||
int cpu_used;
|
int cpu_used;
|
||||||
int pass;
|
int pass;
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi) {
|
|||||||
|
|
||||||
fill_token_costs(x->token_costs, cm->fc.coef_probs);
|
fill_token_costs(x->token_costs, cm->fc.coef_probs);
|
||||||
|
|
||||||
if (cpi->compressor_speed != 3) {
|
if (cpi->oxcf.mode != MODE_REALTIME) {
|
||||||
for (i = 0; i < PARTITION_CONTEXTS; i++)
|
for (i = 0; i < PARTITION_CONTEXTS; i++)
|
||||||
vp9_cost_tokens(x->partition_cost[i], get_partition_probs(cm, i),
|
vp9_cost_tokens(x->partition_cost[i], get_partition_probs(cm, i),
|
||||||
vp9_partition_tree);
|
vp9_partition_tree);
|
||||||
@@ -427,7 +427,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
|
|||||||
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
x->pred_sse[ref] = sse;
|
x->pred_sse[ref] = sse;
|
||||||
if (cpi->compressor_speed > 2) {
|
if (cpi->oxcf.mode == MODE_REALTIME) {
|
||||||
dist_sum += (int)sse;
|
dist_sum += (int)sse;
|
||||||
} else {
|
} else {
|
||||||
int rate;
|
int rate;
|
||||||
@@ -1761,7 +1761,8 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
if (best_rd < label_mv_thresh)
|
if (best_rd < label_mv_thresh)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (cpi->compressor_speed) {
|
if (cpi->oxcf.mode != MODE_SECONDPASS_BEST &&
|
||||||
|
cpi->oxcf.mode != MODE_BESTQUALITY) {
|
||||||
// use previous block's result as next block's MV predictor.
|
// use previous block's result as next block's MV predictor.
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
bsi->mvp.as_int = mi->bmi[i - 1].as_mv[0].as_int;
|
bsi->mvp.as_int = mi->bmi[i - 1].as_mv[0].as_int;
|
||||||
@@ -1825,7 +1826,8 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Should we do a full search (best quality only)
|
// Should we do a full search (best quality only)
|
||||||
if (cpi->compressor_speed == 0) {
|
if (cpi->oxcf.mode == MODE_BESTQUALITY ||
|
||||||
|
cpi->oxcf.mode == MODE_SECONDPASS_BEST) {
|
||||||
/* Check if mvp_full is within the range. */
|
/* Check if mvp_full is within the range. */
|
||||||
clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max,
|
clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max,
|
||||||
x->mv_row_min, x->mv_row_max);
|
x->mv_row_min, x->mv_row_max);
|
||||||
|
|||||||
Reference in New Issue
Block a user