Commit 6a4e2dda authored by Yaowu Xu's avatar Yaowu Xu

Properly merge two different real time modes

--rt --cpu-used=-5 uses the progressive rtc mode
--rt --cpu-used=-6 uses the new super fast rtc mode

Change-Id: Id6469ca996100cdf794a0e42d76430161f22f976
parent e78c174e
......@@ -2787,7 +2787,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
cm->reference_mode = reference_mode;
cm->interp_filter = interp_filter;
if (cpi->oxcf.mode == MODE_REALTIME)
if (cpi->sf.super_fast_rtc)
encode_rtc_frame_internal(cpi);
else
encode_frame_internal(cpi);
......@@ -2868,7 +2868,10 @@ void vp9_encode_frame(VP9_COMP *cpi) {
}
}
} else {
encode_rtc_frame_internal(cpi);
if (cpi->sf.super_fast_rtc)
encode_rtc_frame_internal(cpi);
else
encode_frame_internal(cpi);
}
}
......@@ -2945,7 +2948,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
const int mi_height = num_8x8_blocks_high_lookup[bsize];
x->skip_recode = !x->select_txfm_size && mbmi->sb_type >= BLOCK_8X8 &&
(cpi->oxcf.aq_mode != COMPLEXITY_AQ) &&
cpi->oxcf.mode != MODE_REALTIME;
!cpi->sf.super_fast_rtc;
x->skip_optimize = ctx->is_coded;
ctx->is_coded = 1;
x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct;
......
......@@ -851,6 +851,9 @@ static void set_rt_speed_feature(VP9_COMMON *cm,
}
sf->use_fast_lpf_pick = 2;
}
if (speed >= 6) {
sf->super_fast_rtc = 1;
}
}
void vp9_set_speed_features(VP9_COMP *cpi) {
......@@ -908,6 +911,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->use_fast_coef_updates = 0;
sf->using_small_partition_info = 0;
sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set
sf->super_fast_rtc = 0;
switch (cpi->oxcf.mode) {
case MODE_BESTQUALITY:
......@@ -917,8 +921,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
case MODE_FIRSTPASS:
case MODE_GOODQUALITY:
case MODE_SECONDPASS:
set_good_speed_feature(cm, sf, speed);
break;
set_good_speed_feature(cm, sf, speed);
break;
case MODE_REALTIME:
set_rt_speed_feature(cm, sf, speed);
......@@ -2550,10 +2553,7 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
vpx_usec_timer_start(&timer);
if (cpi->oxcf.mode == MODE_REALTIME)
lf->filter_level = 4;
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);
vpx_usec_timer_mark(&timer);
cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer);
......@@ -2742,7 +2742,7 @@ static void encode_with_recode_loop(VP9_COMP *cpi,
if (cpi->sf.recode_loop != 0) {
vp9_save_coding_context(cpi);
cpi->dummy_packing = 1;
if (cpi->oxcf.mode != MODE_REALTIME)
if (!cpi->sf.super_fast_rtc)
vp9_pack_bitstream(cpi, dest, size);
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
// should be larger. Q of 0 is disabled because we force tx size to be
// 16x16...
if (cpi->oxcf.mode == MODE_REALTIME) {
if (cpi->sf.super_fast_rtc) {
if (cpi->common.current_video_frame == 0)
q /= 3;
......
......@@ -416,6 +416,9 @@ typedef struct {
// This feature limits the number of coefficients updates we actually do
// 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
// This flag control the use of the new super fast rtc mode
int super_fast_rtc;
} SPEED_FEATURES;
typedef struct VP9_COMP {
......
......@@ -296,7 +296,7 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi) {
fill_token_costs(x->token_costs, cm->fc.coef_probs);
if (cpi->oxcf.mode != MODE_REALTIME) {
if (!cpi->sf.super_fast_rtc) {
for (i = 0; i < PARTITION_CONTEXTS; i++)
vp9_cost_tokens(x->partition_cost[i], get_partition_probs(cm, i),
vp9_partition_tree);
......@@ -443,7 +443,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
if (i == 0)
x->pred_sse[ref] = sse;
if (cpi->oxcf.mode == MODE_REALTIME) {
if (cpi->sf.super_fast_rtc) {
dist_sum += (int)sse;
} else {
int rate;
......@@ -2489,7 +2489,6 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
for (i = 0; i < MAX_MB_PLANE; i++)
xd->plane[i].pre[0] = backup_yv12[i];
}
return;
}
static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
......
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