Commit 8a78a2b4 authored by Yue Chen's avatar Yue Chen

Fix mishandled rd_stats merge for MOTION_VAR

Bring rd_stats back to proper starting point for the second mode.
Bug introduced during code refactoring preparing for RD_DEBUG:
https://aomedia-review.googlesource.com/#/c/5689/

Change-Id: I9ad10144ae3cc395a6efa700d047741c7734470c
parent 932cf697
...@@ -7813,10 +7813,12 @@ static int64_t handle_inter_mode( ...@@ -7813,10 +7813,12 @@ static int64_t handle_inter_mode(
#endif // CONFIG_WARPED_MOTION #endif // CONFIG_WARPED_MOTION
x->skip = 0; x->skip = 0;
rd_stats->dist = 0;
rd_stats->sse = 0;
rd_stats->skip = 1;
rd_stats->rate = tmp_rate2; rd_stats->rate = tmp_rate2;
if (allow_motvar) if (allow_motvar)
rd_stats->rate += cpi->motion_mode_cost[bsize][mbmi->motion_mode]; rd_stats->rate += cpi->motion_mode_cost[bsize][mbmi->motion_mode];
rd_stats->dist = 0;
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (!skip_txfm_sb) { if (!skip_txfm_sb) {
int64_t rdcosty = INT64_MAX; int64_t rdcosty = INT64_MAX;
...@@ -7931,6 +7933,10 @@ static int64_t handle_inter_mode( ...@@ -7931,6 +7933,10 @@ static int64_t handle_inter_mode(
rd_stats_uv->rate = 0; rd_stats_uv->rate = 0;
rd_stats->skip = 1; rd_stats->skip = 1;
} }
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (!is_comp_pred && mbmi->motion_mode == SIMPLE_TRANSLATION)
single_skippable[this_mode][refs[0]] = rd_stats->skip;
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
if (this_mode == ZEROMV) { if (this_mode == ZEROMV) {
rd_stats->rate += GLOBAL_MOTION_RATE(mbmi->ref_frame[0]); rd_stats->rate += GLOBAL_MOTION_RATE(mbmi->ref_frame[0]);
...@@ -7995,9 +8001,9 @@ static int64_t handle_inter_mode( ...@@ -7995,9 +8001,9 @@ static int64_t handle_inter_mode(
*disable_skip = best_disable_skip; *disable_skip = best_disable_skip;
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if !(CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION)
if (!is_comp_pred) single_skippable[this_mode][refs[0]] = rd_stats->skip; if (!is_comp_pred) single_skippable[this_mode][refs[0]] = rd_stats->skip;
#if !(CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION)
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
x->recon_variance = av1_high_get_sby_perpixel_variance( x->recon_variance = av1_high_get_sby_perpixel_variance(
......
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