Commit bdd6ca81 authored by Cheng Chen's avatar Cheng Chen
Browse files

JNT_COMP: 6. support wedge

Support compound_segment and wedge.
JNT_COMP is a competitor to compound_segment and wedge. They are
mutually exclusive.

Change-Id: Id93c36de44a69008182424f40325e42e699bedcd
parent 3ca43bf0
......@@ -2642,24 +2642,20 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
) {
if (is_any_masked_compound_used(bsize)) {
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
if (cm->allow_masked_compound) {
#if CONFIG_JNT_COMP
if (cm->allow_masked_compound && mbmi->compound_idx)
#else
if (cm->allow_masked_compound)
#endif // CONFIG_JNT_COMP
{
#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
if (!is_interinter_compound_used(COMPOUND_WEDGE, bsize))
mbmi->interinter_compound_type =
aom_read_bit(r, ACCT_STR) ? COMPOUND_AVERAGE : COMPOUND_SEG;
else
#endif // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
#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
mbmi->interinter_compound_type = aom_read_symbol(
r, ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES, ACCT_STR);
#if CONFIG_WEDGE
if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
assert(is_interinter_compound_used(COMPOUND_WEDGE, bsize));
......@@ -2670,10 +2666,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
if (mbmi->interinter_compound_type == COMPOUND_SEG) {
#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);
mbmi->mask_type = aom_read_literal(r, MAX_SEG_MASK_BITS, ACCT_STR);
}
#endif // CONFIG_COMPOUND_SEGMENT
}
......
......@@ -1770,23 +1770,19 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
#endif // CONFIG_MOTION_VAR
is_any_masked_compound_used(bsize)) {
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
if (cm->allow_masked_compound) {
#if CONFIG_JNT_COMP
if (cm->allow_masked_compound && mbmi->compound_idx)
#else
if (cm->allow_masked_compound)
#endif // CONFIG_JNT_COMP
{
#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
if (!is_interinter_compound_used(COMPOUND_WEDGE, bsize))
aom_write_bit(w, mbmi->interinter_compound_type == COMPOUND_AVERAGE);
else
#endif // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
#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
aom_write_symbol(w, mbmi->interinter_compound_type,
ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES);
#if CONFIG_WEDGE
if (is_interinter_compound_used(COMPOUND_WEDGE, bsize) &&
mbmi->interinter_compound_type == COMPOUND_WEDGE) {
......@@ -1796,10 +1792,7 @@ 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) {
#if CONFIG_JNT_COMP
if (mbmi->compound_idx)
#endif // CONFIG_JNT_COMP
aom_write_literal(w, mbmi->mask_type, MAX_SEG_MASK_BITS);
aom_write_literal(w, mbmi->mask_type, MAX_SEG_MASK_BITS);
}
#endif // CONFIG_COMPOUND_SEGMENT
}
......
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