Consider skip cost as residue cost Change-Id: I81d2e3b49f6f57b896eb751dcd7aa67ad64c8446
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index b485712..a680544 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c
@@ -637,7 +637,7 @@ static void inter_mode_data_push(BLOCK_SIZE bsize, int64_t sse, int64_t dist, int residue_cost, int all_cost, int64_t ref_best_rd) { - if (residue_cost == 0) return; + if (residue_cost == 0 || sse == dist) return; const int block_idx = inter_mode_data_block_idx(bsize); if (block_idx == -1) return; if (inter_mode_data_idx[block_idx] < INTER_MODE_RD_DATA_OVERALL_SIZE) { @@ -8090,6 +8090,12 @@ mbmi->skip = 0; } *disable_skip = 0; +#if CONFIG_COLLECT_INTER_MODE_RD_STATS + inter_mode_data_push(mbmi->sb_type, rd_stats->sse, rd_stats->dist, + rd_stats_y->rate + rd_stats_uv->rate + + x->skip_cost[skip_ctx][mbmi->skip], + rd_stats->rate, ref_best_rd); +#endif // CONFIG_COLLECT_INTER_MODE_RD_STATS } else { x->skip = 1; *disable_skip = 1; @@ -8113,12 +8119,6 @@ } } -#if CONFIG_COLLECT_INTER_MODE_RD_STATS - inter_mode_data_push(mbmi->sb_type, rd_stats->sse, rd_stats->dist, - rd_stats_y->rate + rd_stats_uv->rate, rd_stats->rate, - ref_best_rd); -#endif // CONFIG_COLLECT_INTER_MODE_RD_STATS - tmp_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist); if ((mbmi->motion_mode == SIMPLE_TRANSLATION && mbmi->ref_frame[1] != INTRA_FRAME) ||