Commit 3392c436 authored by Cheng Chen's avatar Cheng Chen
Browse files

JNT_COMP: 5. Support compound_segment

Let jnt_comp work with compound_segment. When frame distance weights
are used, compound_segment blending is turned off. When normal compound
mode is used, compound_segment blending is searched. The rdcost should
select between {frame distance weights, normal compound,
compound_segment blending}.

Change-Id: I162d1d204ba6a5976538357d9dbc71fc5b1aa8d5
parent 0a7f2f51
......@@ -2624,8 +2624,17 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
aom_read_bit(r, ACCT_STR) ? COMPOUND_AVERAGE : COMPOUND_SEG;
else
#endif // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
mbmi->interinter_compound_type = aom_read_symbol(
r, ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES, ACCT_STR);
#if CONFIG_JNT_COMP
{
if (mbmi->compound_idx) {
mbmi->interinter_compound_type = aom_read_symbol(
r, ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES, ACCT_STR);
}
}
#else
mbmi->interinter_compound_type = aom_read_symbol(
r, ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES, ACCT_STR);
#endif // CONFIG_JNT_COMP
#if CONFIG_WEDGE
if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
assert(is_interinter_compound_used(COMPOUND_WEDGE, bsize));
......@@ -2636,7 +2645,10 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
if (mbmi->interinter_compound_type == COMPOUND_SEG) {
mbmi->mask_type = aom_read_literal(r, MAX_SEG_MASK_BITS, ACCT_STR);
#if CONFIG_JNT_COMP
if (mbmi->compound_idx)
#endif // CONFIG_JNT_COMP
mbmi->mask_type = aom_read_literal(r, MAX_SEG_MASK_BITS, ACCT_STR);
}
#endif // CONFIG_COMPOUND_SEGMENT
}
......
......@@ -1762,8 +1762,17 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
aom_write_bit(w, mbmi->interinter_compound_type == COMPOUND_AVERAGE);
else
#endif // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
aom_write_symbol(w, mbmi->interinter_compound_type,
ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES);
#if CONFIG_JNT_COMP
{
if (mbmi->compound_idx) {
aom_write_symbol(w, mbmi->interinter_compound_type,
ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES);
}
}
#else
aom_write_symbol(w, mbmi->interinter_compound_type,
ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES);
#endif // CONFIG_JNT_COMP
#if CONFIG_WEDGE
if (is_interinter_compound_used(COMPOUND_WEDGE, bsize) &&
mbmi->interinter_compound_type == COMPOUND_WEDGE) {
......@@ -1773,7 +1782,10 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
if (mbmi->interinter_compound_type == COMPOUND_SEG) {
aom_write_literal(w, mbmi->mask_type, MAX_SEG_MASK_BITS);
#if CONFIG_JNT_COMP
if (mbmi->compound_idx)
#endif // CONFIG_JNT_COMP
aom_write_literal(w, mbmi->mask_type, MAX_SEG_MASK_BITS);
}
#endif // CONFIG_COMPOUND_SEGMENT
}
......
......@@ -8612,8 +8612,12 @@ static int64_t handle_inter_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
#if CONFIG_COMPOUND_SINGLEREF
if (is_comp_pred || is_singleref_comp_mode)
#else
#if CONFIG_JNT_COMP
if (is_comp_pred && mbmi->compound_idx)
#else
if (is_comp_pred)
#endif // CONFIG_JNT_COMP
#endif // CONFIG_COMPOUND_SINGLEREF
{
int rate_sum, rs2;
......
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