Commit 5664419e authored by Zoe Liu's avatar Zoe Liu

Exclude distance-weighted prediction for ext-skip

For ext-skip, the use of distance-weighted prediction has only shown
a coding gain in the AMCY low delay scenario. It is hence not being
considered and compound-average is used exlusively.

Change-Id: I57439eda1246e179d6404bbec366c6c610af3a36
parent 0d9e3812
......@@ -47,11 +47,6 @@ extern "C" {
// chroma.
#define DISABLE_VARTX_FOR_CHROMA 1
#if CONFIG_EXT_SKIP && CONFIG_JNT_COMP
// NOTE: To explore whether weighted-compound prediction to be considered.
#define SKIP_MODE_WITH_JNT_COMP 0
#endif // CONFIG_EXT_SKIP && CONFIG_JNT_COMP
// SEG_MASK_TYPES should not surpass 1 << MAX_SEG_MASK_BITS
typedef enum {
#if COMPOUND_SEGMENT_TYPE == 0
......
......@@ -2190,26 +2190,6 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
mbmi->compound_idx = 1;
mbmi->interinter_compound_type = COMPOUND_AVERAGE;
#if CONFIG_EXT_SKIP
#if CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
if (mbmi->skip_mode) {
const int cur_offset = (int)cm->frame_offset;
int ref_offset[2];
get_skip_mode_ref_offsets(cm, ref_offset);
const int cur_to_ref0 = cur_offset - ref_offset[0];
const int cur_to_ref1 = abs(cur_offset - ref_offset[1]);
if (cur_to_ref0 != cur_to_ref1 && xd->all_one_sided_refs) {
const int comp_index_ctx = get_comp_index_context(cm, xd);
mbmi->compound_idx = aom_read_symbol(
r, ec_ctx->compound_index_cdf[comp_index_ctx], 2, ACCT_STR);
if (xd->counts)
++xd->counts->compound_index[comp_index_ctx][mbmi->compound_idx];
}
}
#endif // CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
#endif // CONFIG_EXT_SKIP
if (has_second_ref(mbmi)
#if CONFIG_EXT_SKIP
&& !mbmi->skip_mode
......
......@@ -1386,21 +1386,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
}
#if CONFIG_EXT_SKIP
if (mbmi->skip_mode) {
#if CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
const int cur_offset = (int)cm->frame_offset;
int ref_offset[2];
get_skip_mode_ref_offsets(cm, ref_offset);
const int cur_to_ref0 = cur_offset - ref_offset[0];
const int cur_to_ref1 = abs(cur_offset - ref_offset[1]);
if (cur_to_ref0 != cur_to_ref1 && xd->all_one_sided_refs) {
const int comp_index_ctx = get_comp_index_context(cm, xd);
aom_write_symbol(w, mbmi->compound_idx,
ec_ctx->compound_index_cdf[comp_index_ctx], 2);
}
#endif // CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
return;
}
if (mbmi->skip_mode) return;
#endif // CONFIG_EXT_SKIP
if (!is_inter) {
......
......@@ -869,22 +869,7 @@ static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data,
assert(has_second_ref(mbmi));
rdc->compound_ref_used_flag = 1;
}
#if CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
const int cur_offset = (int)cm->frame_offset;
int ref_offset[2];
get_skip_mode_ref_offsets(cm, ref_offset);
const int cur_to_ref0 = cur_offset - ref_offset[0];
const int cur_to_ref1 = abs(cur_offset - ref_offset[1]);
if (cur_to_ref0 != cur_to_ref1 && xd->all_one_sided_refs) {
const int comp_index_ctx = get_comp_index_context(cm, xd);
++counts->compound_index[comp_index_ctx][mbmi->compound_idx];
if (allow_update_cdf)
update_cdf(fc->compound_index_cdf[comp_index_ctx], mbmi->compound_idx,
2);
}
#endif // CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
return;
}
#endif // CONFIG_EXT_SKIP
......
......@@ -10641,56 +10641,9 @@ PALETTE_EXIT:
// Obtain the rdcost for skip_mode.
#if CONFIG_JNT_COMP
x->compound_idx = 1; // COMPOUND_AVERAGE
#if SKIP_MODE_WITH_JNT_COMP
const int cur_offset = (int)cm->frame_offset;
int ref_offset[2];
get_skip_mode_ref_offsets(cm, ref_offset);
const int cur_to_ref0 = cur_offset - ref_offset[0];
const int cur_to_ref1 = abs(cur_offset - ref_offset[0]);
if (cur_to_ref0 != cur_to_ref1 && xd->all_one_sided_refs) {
// Decide on the JNT_COMP mode.
int64_t best_skip_mode_rd = INT64_MAX;
int best_compound_idx = 0;
int best_skip_mode_rate = 0;
int64_t best_skip_mode_sse = 0, best_skip_mode_dist = 0;
for (int compound_idx = 0; compound_idx < 2; ++compound_idx) {
x->compound_idx = compound_idx;
estimate_skip_mode_rdcost(cpi, tile_data, x, bsize, mi_row, mi_col,
frame_mv, yv12_mb);
if (x->skip_mode_rdcost >= 0 && x->skip_mode_rdcost < INT64_MAX) {
// Update skip mode rdcost.
const int comp_index_ctx = get_comp_index_context(cm, xd);
x->skip_mode_rate += x->comp_idx_cost[comp_index_ctx][compound_idx];
x->skip_mode_rdcost =
RDCOST(x->rdmult, x->skip_mode_rate, x->skip_mode_dist);
if (x->skip_mode_rdcost < best_skip_mode_rd) {
best_skip_mode_rd = x->skip_mode_rdcost;
best_compound_idx = compound_idx;
best_skip_mode_rate = x->skip_mode_rate;
best_skip_mode_sse = x->skip_mode_sse;
best_skip_mode_dist = x->skip_mode_dist;
}
}
}
if (best_skip_mode_rd < INT64_MAX) {
x->compound_idx = best_compound_idx;
x->skip_mode_rdcost = best_skip_mode_rd;
x->skip_mode_rate = best_skip_mode_rate;
x->skip_mode_sse = best_skip_mode_sse;
x->skip_mode_dist = best_skip_mode_dist;
}
} else {
#endif // SKIP_MODE_WITH_JNT_COMP
#endif // CONFIG_JNT_COMP
estimate_skip_mode_rdcost(cpi, tile_data, x, bsize, mi_row, mi_col,
frame_mv, yv12_mb);
#if CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
}
#endif // CONFIG_JNT_COMP && SKIP_MODE_WITH_JNT_COMP
#endif // CONFIG_JNT_COMP
estimate_skip_mode_rdcost(cpi, tile_data, x, bsize, mi_row, mi_col,
frame_mv, yv12_mb);
if (x->skip_mode_rdcost >= 0 && x->skip_mode_rdcost < INT64_MAX) {
// Update skip mode rdcost.
......
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