Commit 883e3b84 authored by Yue Chen's avatar Yue Chen Committed by Gerrit Code Review
Browse files

Merge "(Cosmetics) Remove unnecessary new parameters in obmc experiment" into nextgenv2

parents 78842b28 02596589
......@@ -107,9 +107,6 @@ struct macroblock {
unsigned int max_mv_context[MAX_REF_FRAMES];
unsigned int source_variance;
unsigned int recon_variance;
#if CONFIG_OBMC
unsigned int pred_variance;
#endif // CONFIG_OBMC
unsigned int pred_sse[MAX_REF_FRAMES];
int pred_mv_sad[MAX_REF_FRAMES];
......
......@@ -6952,7 +6952,6 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
uint8_t best_blk_skip[MAX_MB_PLANE][MAX_MIB_SIZE * MAX_MIB_SIZE * 4];
#endif // CONFIG_VAR_TX
int64_t best_distortion = INT64_MAX;
unsigned int best_pred_var = UINT_MAX;
MB_MODE_INFO best_mbmi;
#if CONFIG_EXT_INTER
int rate2_bmc_nocoeff;
......@@ -7945,20 +7944,6 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
// TODO(yuec): Add code
}
#endif // CONFIG_WARPED_MOTION
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
x->pred_variance =
vp10_high_get_sby_perpixel_variance(
cpi, &xd->plane[0].dst, bsize, xd->bd);
} else {
x->pred_variance =
vp10_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
}
#else
x->pred_variance =
vp10_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
#endif // CONFIG_VP9_HIGHBITDEPTH
x->skip = 0;
*rate2 = tmp_rate2;
......@@ -8100,7 +8085,19 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
best_skippable = *skippable;
best_xskip = x->skip;
best_disable_skip = *disable_skip;
best_pred_var = x->pred_variance;
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
x->recon_variance =
vp10_high_get_sby_perpixel_variance(
cpi, &xd->plane[0].dst, bsize, xd->bd);
} else {
x->recon_variance =
vp10_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
}
#else
x->recon_variance =
vp10_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
#endif // CONFIG_VP9_HIGHBITDEPTH
}
}
......@@ -8123,12 +8120,12 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
*skippable = best_skippable;
x->skip = best_xskip;
*disable_skip = best_disable_skip;
x->pred_variance = best_pred_var;
#endif // CONFIG_OBMC || CONFIG_WARPED_MOTION
if (!is_comp_pred)
single_skippable[this_mode][refs[0]] = *skippable;
#if !(CONFIG_OBMC || CONFIG_WARPED_MOTION)
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
x->recon_variance =
......@@ -8142,6 +8139,7 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
x->recon_variance =
vp10_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // !(CONFIG_OBMC || CONFIG_WARPED_MOTION)
restore_dst_buf(xd, orig_dst, orig_dst_stride);
return 0; // The rate-distortion cost will be re-calculated by caller.
......@@ -8206,9 +8204,6 @@ void vp10_rd_pick_intra_mode_sb(VP10_COMP *cpi, MACROBLOCK *x,
static void rd_variance_adjustment(MACROBLOCK *x,
int64_t *this_rd,
MV_REFERENCE_FRAME ref_frame,
#if CONFIG_OBMC
int is_pred_var_available,
#endif // CONFIG_OBMC
unsigned int source_variance) {
unsigned int recon_variance = x->recon_variance;
unsigned int absvar_diff = 0;
......@@ -8218,11 +8213,6 @@ static void rd_variance_adjustment(MACROBLOCK *x,
if (*this_rd == INT64_MAX)
return;
#if CONFIG_OBMC
if (is_pred_var_available)
recon_variance = x->pred_variance;
#endif // CONFIG_OBMC
if ((source_variance + recon_variance) > LOW_VAR_THRESH) {
absvar_diff = (source_variance > recon_variance)
? (source_variance - recon_variance)
......@@ -8522,11 +8512,7 @@ static void pick_ext_intra_iframe(VP10_COMP *cpi, MACROBLOCK *x,
rate2 += vp10_cost_bit(vp10_get_skip_prob(cm, xd), 0);
}
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
rd_variance_adjustment(x, &this_rd, INTRA_FRAME,
#if CONFIG_OBMC
is_inter_block(mbmi),
#endif // CONFIG_OBMC
x->source_variance);
rd_variance_adjustment(x, &this_rd, INTRA_FRAME, x->source_variance);
if (this_rd < *best_intra_rd) {
*best_intra_rd = this_rd;
......@@ -9622,11 +9608,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
// Apply an adjustment to the rd value based on the similarity of the
// source variance and reconstructed variance.
rd_variance_adjustment(x, &this_rd, ref_frame,
#if CONFIG_OBMC
is_inter_block(mbmi),
#endif // CONFIG_OBMC
x->source_variance);
rd_variance_adjustment(x, &this_rd, ref_frame, x->source_variance);
if (ref_frame == INTRA_FRAME) {
// Keep record of best intra 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