Commit cbfc15b1 authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review

Merge "Properly set rate_nocoef when pallete mode is used" into nextgenv2

parents c28dbdf6 c96c3fa2
......@@ -1234,7 +1234,10 @@ static void update_state_supertx(VP10_COMP *cpi, ThreadData *td,
PICK_MODE_CONTEXT *ctx,
int mi_row, int mi_col, BLOCK_SIZE bsize,
int output_enabled) {
int i, y, x_idx;
int y, x_idx;
#if CONFIG_VAR_TX
int i;
#endif
VP10_COMMON *const cm = &cpi->common;
RD_COUNTS *const rdc = &td->rd_counts;
MACROBLOCK *const x = &td->mb;
......
......@@ -8402,6 +8402,9 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
if (cm->allow_screen_content_tools && !is_inter_mode(best_mbmode.mode)) {
PREDICTION_MODE mode_selected;
int rate2 = 0, rate_y = 0;
#if CONFIG_SUPERTX
int best_rate_nocoef;
#endif
int64_t distortion2 = 0, distortion_y = 0, dummy_rd = best_rd, this_rd;
int skippable = 0, rate_overhead = 0;
TX_SIZE best_tx_size, uv_tx;
......@@ -8471,8 +8474,14 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
if (skippable) {
rate2 -= (rate_y + rate_uv_tokenonly[uv_tx]);
#if CONFIG_SUPERTX
best_rate_nocoef = rate2;
#endif
rate2 += vp10_cost_bit(vp10_get_skip_prob(cm, xd), 1);
} else {
#if CONFIG_SUPERTX
best_rate_nocoef = rate2 - (rate_y + rate_uv_tokenonly[uv_tx]);
#endif
rate2 += vp10_cost_bit(vp10_get_skip_prob(cm, xd), 0);
}
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
......@@ -8482,6 +8491,9 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
mbmi->mv[0].as_int = 0;
max_plane = 1;
rd_cost->rate = rate2;
#if CONFIG_SUPERTX
*returnrate_nocoef = best_rate_nocoef;
#endif
rd_cost->dist = distortion2;
rd_cost->rdcost = this_rd;
best_rd = this_rd;
......
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