Commit dfcbfbd4 authored by Hui Su's avatar Hui Su

intrabc: use its own mv cost table

To faciliate using intrabc on interframes.

Change-Id: Ibfe376190adf24d15198c5fb548e1050e191a3d6
parent 1c2dfae3
......@@ -615,6 +615,9 @@ typedef struct AV1_COMP {
#if CONFIG_INTRABC
// A flag to indicate if intrabc is ever used in current frame.
int intrabc_used;
int dv_cost[2][MV_VALS];
// TODO(huisu@google.com): we can update dv_joint_cost per SB.
int dv_joint_cost[MV_JOINTS];
#endif // CONFIG_INTRABC
} AV1_COMP;
......
......@@ -715,10 +715,9 @@ void av1_initialize_rd_consts(AV1_COMP *cpi) {
#if CONFIG_INTRABC
if (frame_is_intra_only(cm) && cm->allow_screen_content_tools &&
cpi->oxcf.pass != 1) {
av1_build_nmv_cost_table(
x->nmv_vec_cost[0],
cm->allow_high_precision_mv ? x->nmvcost_hp[0] : x->nmvcost[0],
&cm->fc->ndvc, MV_SUBPEL_NONE);
int *dvcost[2] = { &cpi->dv_cost[0][MV_MAX], &cpi->dv_cost[1][MV_MAX] };
av1_build_nmv_cost_table(cpi->dv_joint_cost, dvcost, &cm->fc->ndvc,
MV_SUBPEL_NONE);
}
#endif
......
......@@ -8873,11 +8873,12 @@ static int64_t rd_pick_intrabc_mode_sb(const AV1_COMP *cpi, MACROBLOCK *x,
x->skip = 0;
av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, bsize);
assert(x->mvcost == x->mv_cost_stack[0]);
int *dvcost[2] = { (int *)&cpi->dv_cost[0][MV_MAX],
(int *)&cpi->dv_cost[1][MV_MAX] };
// TODO(aconverse@google.com): The full motion field defining discount
// in MV_COST_WEIGHT is too large. Explore other values.
int rate_mv = av1_mv_bit_cost(&dv, &dv_ref.as_mv, x->nmvjointcost,
x->mvcost, MV_COST_WEIGHT_SUB);
int rate_mv = av1_mv_bit_cost(&dv, &dv_ref.as_mv, cpi->dv_joint_cost,
dvcost, MV_COST_WEIGHT_SUB);
const int rate_mode = x->intrabc_cost[1];
RD_STATS rd_stats, rd_stats_uv;
av1_subtract_plane(x, bsize, 0);
......
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