Commit 2d0e9b75 authored by Sarah Parker's avatar Sarah Parker Committed by James Zern

Move compound segment mask buffer from mbmi to xd

This resolves crashes on awcy due to excessive memory
use. No change in BDRATE.

Change-Id: I1d92d0b53718cfc66f2842cfca68059bafafc64a
parent 187a02e8
......@@ -322,14 +322,18 @@ typedef struct RD_STATS {
} RD_STATS;
#if CONFIG_EXT_INTER
// This struct is used to group function args that are commonly
// sent together in functions related to interinter compound modes
typedef struct {
COMPOUND_TYPE type;
#if CONFIG_WEDGE
int wedge_index;
int wedge_sign;
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
SEG_MASK_TYPE mask_type;
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]);
uint8_t *seg_mask;
#endif // CONFIG_COMPOUND_SEGMENT
COMPOUND_TYPE interinter_compound_type;
} INTERINTER_COMPOUND_DATA;
#endif // CONFIG_EXT_INTER
......@@ -387,12 +391,21 @@ typedef struct {
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTER
// interintra members
INTERINTRA_MODE interintra_mode;
// TODO(debargha): Consolidate these flags
int use_wedge_interintra;
int interintra_wedge_index;
int interintra_wedge_sign;
INTERINTER_COMPOUND_DATA interinter_compound_data;
// interinter members
COMPOUND_TYPE interinter_compound_type;
#if CONFIG_WEDGE
int wedge_index;
int wedge_sign;
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
SEG_MASK_TYPE mask_type;
#endif // CONFIG_COMPOUND_SEGMENT
#endif // CONFIG_EXT_INTER
MOTION_MODE motion_mode;
#if CONFIG_MOTION_VAR
......@@ -662,6 +675,10 @@ typedef struct macroblockd {
const EobThresholdMD *eob_threshold_md;
#endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SEGMENT
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SEGMENT
#if CONFIG_CFL
CFL_CTX *cfl;
#endif
......
This diff is collapsed.
......@@ -2192,7 +2192,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
mbmi->interinter_compound_data.type = COMPOUND_AVERAGE;
mbmi->interinter_compound_type = COMPOUND_AVERAGE;
if (cm->reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode)
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
......@@ -2201,29 +2201,27 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
) {
if (is_any_masked_compound_used(bsize)) {
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
mbmi->interinter_compound_data.type =
mbmi->interinter_compound_type =
aom_read_tree(r, av1_compound_type_tree,
cm->fc->compound_type_prob[bsize], ACCT_STR);
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#if CONFIG_WEDGE
if (mbmi->interinter_compound_data.type == COMPOUND_WEDGE) {
mbmi->interinter_compound_data.wedge_index =
if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
mbmi->wedge_index =
aom_read_literal(r, get_wedge_bits_lookup(bsize), ACCT_STR);
mbmi->interinter_compound_data.wedge_sign = aom_read_bit(r, ACCT_STR);
mbmi->wedge_sign = aom_read_bit(r, ACCT_STR);
}
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
if (mbmi->interinter_compound_data.type == COMPOUND_SEG) {
mbmi->interinter_compound_data.mask_type =
aom_read_literal(r, MAX_SEG_MASK_BITS, ACCT_STR);
if (mbmi->interinter_compound_type == COMPOUND_SEG) {
mbmi->mask_type = aom_read_literal(r, MAX_SEG_MASK_BITS, ACCT_STR);
}
#endif // CONFIG_COMPOUND_SEGMENT
} else {
mbmi->interinter_compound_data.type = COMPOUND_AVERAGE;
mbmi->interinter_compound_type = COMPOUND_AVERAGE;
}
if (xd->counts)
xd->counts
->compound_interinter[bsize][mbmi->interinter_compound_data.type]++;
xd->counts->compound_interinter[bsize][mbmi->interinter_compound_type]++;
}
#endif // CONFIG_EXT_INTER
......
......@@ -2082,21 +2082,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
av1_write_token(
w, av1_compound_type_tree, cm->fc->compound_type_prob[bsize],
&compound_type_encodings[mbmi->interinter_compound_data.type]);
av1_write_token(w, av1_compound_type_tree,
cm->fc->compound_type_prob[bsize],
&compound_type_encodings[mbmi->interinter_compound_type]);
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#if CONFIG_WEDGE
if (mbmi->interinter_compound_data.type == COMPOUND_WEDGE) {
aom_write_literal(w, mbmi->interinter_compound_data.wedge_index,
get_wedge_bits_lookup(bsize));
aom_write_bit(w, mbmi->interinter_compound_data.wedge_sign);
if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
aom_write_literal(w, mbmi->wedge_index, get_wedge_bits_lookup(bsize));
aom_write_bit(w, mbmi->wedge_sign);
}
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
if (mbmi->interinter_compound_data.type == COMPOUND_SEG) {
aom_write_literal(w, mbmi->interinter_compound_data.mask_type,
MAX_SEG_MASK_BITS);
if (mbmi->interinter_compound_type == COMPOUND_SEG) {
aom_write_literal(w, mbmi->mask_type, MAX_SEG_MASK_BITS);
}
#endif // CONFIG_COMPOUND_SEGMENT
}
......
......@@ -2233,8 +2233,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
&& mbmi->motion_mode == SIMPLE_TRANSLATION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
) {
counts->compound_interinter[bsize]
[mbmi->interinter_compound_data.type]++;
counts->compound_interinter[bsize][mbmi->interinter_compound_type]++;
}
#endif // CONFIG_EXT_INTER
}
......
This diff is collapsed.
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