Commit 4d26acb4 authored by Yue Chen's avatar Yue Chen

Add CONFIG_INTERINTRA flags and reduce # of interintra modes to 4

Use CONFIG_INTERINTRA to properly separate interintra from the basic
ext_inter experiment.
When macro REDUCE_INTERINTRA_MODES is 1, only 4 ii modes are enabled
so as to reduce the complexity overhead.
(Right now the flag is off)

Change-Id: Iec6f36a1000f181adbb822ad66c7d5b2625e9cc7
parent 4c6d4369
......@@ -383,8 +383,10 @@ typedef struct MB_MODE_INFO {
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
// interintra members
INTERINTRA_MODE interintra_mode;
#endif
// TODO(debargha): Consolidate these flags
int use_wedge_interintra;
int interintra_wedge_index;
......
......@@ -1081,10 +1081,20 @@ static const aom_prob default_compound_type_probs[BLOCK_SIZES]
[COMPOUND_TYPES - 1];
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
#if CONFIG_INTERINTRA
static const aom_prob default_interintra_prob[BLOCK_SIZE_GROUPS] = {
208, 208, 208, 208,
};
#if REDUCED_INTERINTRA_MODES == 1
static const aom_prob
default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = {
{ 65, 32, 144 }, // block_size < 8x8
{ 132, 68, 165 }, // block_size < 16x16
{ 173, 80, 176 }, // block_size < 32x32
{ 221, 135, 194 } // block_size >= 32x32
};
#else // REDUCED_INTERINTRA_MODES
#if CONFIG_ALT_INTRA
static const aom_prob
default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = {
......@@ -1102,6 +1112,7 @@ static const aom_prob
{ 221, 135, 38, 194, 248, 121, 96, 85, 29 } // block_size >= 32x32
};
#endif // CONFIG_ALT_INTRA
#endif // REDUCED_INTERINTRA_MODES
static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = {
#if CONFIG_CB4X4
......@@ -1112,6 +1123,7 @@ static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = {
208, 208, 208
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
// Change this section appropriately once warped motion is supported
......@@ -1272,6 +1284,18 @@ const aom_tree_index av1_inter_mode_tree[TREE_SIZE(INTER_MODES)] = {
#if CONFIG_EXT_INTER
/* clang-format off */
#if CONFIG_INTERINTRA
#if REDUCED_INTERINTRA_MODES == 1
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
-II_DC_PRED, 2, /* 0 = II_DC_NODE */
#if CONFIG_ALT_INTRA
-II_SMOOTH_PRED, 4, /* 1 = II_SMOOTH_PRED */
#else
-II_TM_PRED, 4, /* 1 = II_TM_NODE */
#endif
-II_V_PRED, -II_H_PRED /* 2 = II_V_NODE */
};
#else // REDUCED_INTERINTRA_MODES
#if CONFIG_ALT_INTRA
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
-II_DC_PRED, 2, /* 0 = II_DC_NODE */
......@@ -1298,6 +1322,8 @@ const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
-II_D153_PRED, -II_D207_PRED /* 8 = II_D153_NODE */
};
#endif
#endif // REDUCED_INTERINTRA_MODES
#endif // CONFIG_INTERINTRA
const aom_tree_index av1_inter_compound_mode_tree
[TREE_SIZE(INTER_COMPOUND_MODES)] = {
......@@ -4385,9 +4411,11 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
default_inter_singleref_comp_mode_probs);
#endif // CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->compound_type_prob, default_compound_type_probs);
#if CONFIG_INTERINTRA
av1_copy(fc->interintra_prob, default_interintra_prob);
av1_copy(fc->interintra_mode_prob, default_interintra_mode_prob);
av1_copy(fc->wedge_interintra_prob, default_wedge_interintra_prob);
#endif
#endif // CONFIG_EXT_INTER
#if CONFIG_SUPERTX
av1_copy(fc->supertx_prob, default_supertx_prob);
......
......@@ -199,9 +199,11 @@ typedef struct frame_contexts {
[INTER_SINGLEREF_COMP_MODES - 1];
#endif // CONFIG_COMPOUND_SINGLEREF
aom_prob compound_type_prob[BLOCK_SIZES][COMPOUND_TYPES - 1];
#if CONFIG_INTERINTRA
aom_prob interintra_prob[BLOCK_SIZE_GROUPS];
aom_prob interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1];
aom_prob wedge_interintra_prob[BLOCK_SIZES];
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
aom_prob motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1];
......@@ -369,9 +371,11 @@ typedef struct FRAME_COUNTS {
unsigned int inter_singleref_comp_mode[INTER_MODE_CONTEXTS]
[INTER_SINGLEREF_COMP_MODES];
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_INTERINTRA
unsigned int interintra[BLOCK_SIZE_GROUPS][2];
unsigned int interintra_mode[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
unsigned int wedge_interintra[BLOCK_SIZES][2];
#endif // CONFIG_INTERINTRA
unsigned int compound_interinter[BLOCK_SIZES][COMPOUND_TYPES];
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
......@@ -479,8 +483,10 @@ extern int av1_ext_tx_inter_inv[EXT_TX_SETS_INTER][TX_TYPES];
#endif
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
extern const aom_tree_index
av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)];
#endif
extern const aom_tree_index
av1_inter_compound_mode_tree[TREE_SIZE(INTER_COMPOUND_MODES)];
#if CONFIG_COMPOUND_SINGLEREF
......
......@@ -368,6 +368,21 @@ typedef enum {
} MOTION_MODE;
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
#define REDUCED_INTERINTRA_MODES 0
#if REDUCED_INTERINTRA_MODES == 1
typedef enum {
II_DC_PRED = 0,
II_V_PRED,
II_H_PRED,
#if CONFIG_ALT_INTRA
II_SMOOTH_PRED,
#else
II_TM_PRED,
#endif // CONFIG_ALT_INTRA
INTERINTRA_MODES
} INTERINTRA_MODE;
#else
typedef enum {
II_DC_PRED = 0,
II_V_PRED,
......@@ -384,6 +399,8 @@ typedef enum {
II_TM_PRED,
INTERINTRA_MODES
} INTERINTRA_MODE;
#endif
#endif
typedef enum {
COMPOUND_AVERAGE = 0,
......
......@@ -1333,7 +1333,7 @@ void av1_build_inter_predictors_sby(const AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col, BUFFER_SET *ctx,
BLOCK_SIZE bsize) {
build_inter_predictors_for_planes(cm, xd, bsize, mi_row, mi_col, 0, 0);
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (is_interintra_pred(&xd->mi[0]->mbmi)) {
BUFFER_SET default_ctx = { { xd->plane[0].dst.buf, NULL, NULL },
{ xd->plane[0].dst.stride, 0, 0 } };
......@@ -1343,7 +1343,7 @@ void av1_build_inter_predictors_sby(const AV1_COMMON *cm, MACROBLOCKD *xd,
}
#else
(void)ctx;
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
}
void av1_build_inter_predictors_sbuv(const AV1_COMMON *cm, MACROBLOCKD *xd,
......@@ -1351,7 +1351,7 @@ void av1_build_inter_predictors_sbuv(const AV1_COMMON *cm, MACROBLOCKD *xd,
BLOCK_SIZE bsize) {
build_inter_predictors_for_planes(cm, xd, bsize, mi_row, mi_col, 1,
MAX_MB_PLANE - 1);
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (is_interintra_pred(&xd->mi[0]->mbmi)) {
BUFFER_SET default_ctx = {
{ NULL, xd->plane[1].dst.buf, xd->plane[2].dst.buf },
......@@ -1364,7 +1364,7 @@ void av1_build_inter_predictors_sbuv(const AV1_COMMON *cm, MACROBLOCKD *xd,
}
#else
(void)ctx;
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
}
// TODO(afergs): Check if ctx can be made constant
......@@ -1373,7 +1373,7 @@ void av1_build_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
BLOCK_SIZE bsize) {
build_inter_predictors_for_planes(cm, xd, bsize, mi_row, mi_col, 0,
MAX_MB_PLANE - 1);
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (is_interintra_pred(&xd->mi[0]->mbmi)) {
BUFFER_SET default_ctx = {
{ xd->plane[0].dst.buf, xd->plane[1].dst.buf, xd->plane[2].dst.buf },
......@@ -1388,7 +1388,7 @@ void av1_build_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
}
#else
(void)ctx;
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
}
void av1_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
......@@ -2534,6 +2534,7 @@ void av1_build_ncobmc_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_EXT_INTER
/* clang-format off */
#if CONFIG_INTERINTRA
#if CONFIG_EXT_PARTITION
static const int ii_weights1d[MAX_SB_SIZE] = {
60, 58, 56, 54, 52, 50, 48, 47, 45, 44, 42, 41, 39, 38, 37, 35, 34, 33, 32,
......@@ -2615,6 +2616,7 @@ static void combine_interintra(INTERINTRA_MODE mode, int use_wedge_interintra,
}
break;
#if REDUCED_INTERINTRA_MODES == 0
case II_D63_PRED:
case II_D117_PRED:
for (i = 0; i < bh; ++i) {
......@@ -2643,34 +2645,41 @@ static void combine_interintra(INTERINTRA_MODE mode, int use_wedge_interintra,
}
break;
case II_D135_PRED:
#if CONFIG_ALT_INTRA
case II_SMOOTH_PRED:
#endif
case II_D45_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = ii_weights1d[(i < j ? i : j) * size_scale];
int scale =
(ii_weights1d[i * size_scale] + ii_weights1d[j * size_scale]) >>
1;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
#endif
case II_D45_PRED:
#if REDUCED_INTERINTRA_MODES == 0 || CONFIG_ALT_INTRA
#if REDUCED_INTERINTRA_MODES == 0
case II_D135_PRED:
#endif
#if CONFIG_ALT_INTRA
case II_SMOOTH_PRED:
#endif
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale =
(ii_weights1d[i * size_scale] + ii_weights1d[j * size_scale]) >>
1;
int scale = ii_weights1d[(i < j ? i : j) * size_scale];
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
#endif
#if !(REDUCED_INTERINTRA_MODES == 1 && CONFIG_ALT_INTRA)
case II_TM_PRED:
#endif
case II_DC_PRED:
default:
for (i = 0; i < bh; ++i) {
......@@ -2734,6 +2743,7 @@ static void combine_interintra_highbd(
}
break;
#if REDUCED_INTERINTRA_MODES == 0
case II_D63_PRED:
case II_D117_PRED:
for (i = 0; i < bh; ++i) {
......@@ -2762,34 +2772,41 @@ static void combine_interintra_highbd(
}
break;
case II_D135_PRED:
#if CONFIG_ALT_INTRA
case II_SMOOTH_PRED:
#endif
case II_D45_PRED:
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale = ii_weights1d[(i < j ? i : j) * size_scale];
int scale =
(ii_weights1d[i * size_scale] + ii_weights1d[j * size_scale]) >>
1;
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
#endif
case II_D45_PRED:
#if REDUCED_INTERINTRA_MODES == 0 || CONFIG_ALT_INTRA
#if REDUCED_INTERINTRA_MODES == 0
case II_D135_PRED:
#endif
#if CONFIG_ALT_INTRA
case II_SMOOTH_PRED:
#endif
for (i = 0; i < bh; ++i) {
for (j = 0; j < bw; ++j) {
int scale =
(ii_weights1d[i * size_scale] + ii_weights1d[j * size_scale]) >>
1;
int scale = ii_weights1d[(i < j ? i : j) * size_scale];
comppred[i * compstride + j] =
AOM_BLEND_A64(scale, intrapred[i * intrastride + j],
interpred[i * interstride + j]);
}
}
break;
#endif
#if !(REDUCED_INTERINTRA_MODES == 1 && CONFIG_ALT_INTRA)
case II_TM_PRED:
#endif
case II_DC_PRED:
default:
for (i = 0; i < bh; ++i) {
......@@ -2901,6 +2918,7 @@ void av1_build_interintra_predictors(MACROBLOCKD *xd, uint8_t *ypred,
av1_build_interintra_predictors_sbuv(xd, upred, vpred, ustride, vstride, ctx,
bsize);
}
#endif // CONFIG_INTERINTRA
// Builds the inter-predictor for the single ref case
// for use in the encoder to search the wedges efficiently.
......
......@@ -798,7 +798,7 @@ const uint8_t *av1_get_compound_type_mask_inverse(
const uint8_t *av1_get_compound_type_mask(
const INTERINTER_COMPOUND_DATA *const comp_data, BLOCK_SIZE sb_type);
#if CONFIG_INTERINTRA
void av1_build_interintra_predictors(MACROBLOCKD *xd, uint8_t *ypred,
uint8_t *upred, uint8_t *vpred,
int ystride, int ustride, int vstride,
......@@ -822,7 +822,7 @@ void av1_build_intra_predictors_for_interintra(MACROBLOCKD *xd,
void av1_combine_interintra(MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane,
const uint8_t *inter_pred, int inter_stride,
const uint8_t *intra_pred, int intra_stride);
#endif // CONFIG_INTERINTRA
// Encoder only
void av1_build_inter_predictors_for_planes_single_buf(
MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane_from, int plane_to, int mi_row,
......
......@@ -27,8 +27,34 @@ void av1_predict_intra_block(const MACROBLOCKD *xd, int bw, int bh,
const uint8_t *ref, int ref_stride, uint8_t *dst,
int dst_stride, int aoff, int loff, int plane);
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
// Mapping of interintra to intra mode for use in the intra component
#if REDUCED_INTERINTRA_MODES == 1
static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = {
DC_PRED, V_PRED, H_PRED,
#if CONFIG_ALT_INTRA
SMOOTH_PRED
#else
TM_PRED
#endif
};
// Mapping of intra mode to the interintra mode
static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
II_DC_PRED, II_V_PRED, II_H_PRED, II_V_PRED,
#if CONFIG_ALT_INTRA
II_SMOOTH_PRED,
#else
II_TM_PRED,
#endif
II_V_PRED, II_H_PRED, II_H_PRED, II_V_PRED,
#if CONFIG_ALT_INTRA
II_SMOOTH_PRED, II_SMOOTH_PRED
#else
II_TM_PRED
#endif
};
#else
static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = {
DC_PRED, V_PRED, H_PRED, D45_PRED, D135_PRED,
D117_PRED, D153_PRED, D207_PRED, D63_PRED,
......@@ -47,7 +73,8 @@ static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
#endif
II_TM_PRED
};
#endif // CONFIG_EXT_INTER
#endif
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
#ifdef __cplusplus
} // extern "C"
#endif
......
......@@ -4677,6 +4677,7 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#if CONFIG_EXT_INTER
read_inter_compound_mode_probs(fc, &r);
#if CONFIG_INTERINTRA
if (cm->reference_mode != COMPOUND_REFERENCE) {
#if CONFIG_INTERINTRA
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) {
......@@ -4697,6 +4698,7 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#endif // CONFIG_WEDGE
#endif // CONFIG_INTERINTRA
}
#endif // CONFIG_INTERINTRA
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
if (cm->reference_mode != SINGLE_REFERENCE) {
for (i = 0; i < BLOCK_SIZES; i++) {
......
......@@ -232,7 +232,7 @@ static int read_cfl_alphas(FRAME_CONTEXT *const ec_ctx, aom_reader *r, int skip,
}
#endif
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
static INTERINTRA_MODE read_interintra_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
aom_reader *r, int size_group) {
const INTERINTRA_MODE ii_mode = (INTERINTRA_MODE)aom_read_tree(
......@@ -242,7 +242,7 @@ static INTERINTRA_MODE read_interintra_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
if (counts) ++counts->interintra_mode[size_group][ii_mode];
return ii_mode;
}
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
static PREDICTION_MODE read_inter_mode(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
aom_reader *r, int16_t ctx) {
......@@ -2074,7 +2074,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
aom_merge_corrupted_flag(&xd->corrupted, mv_corrupted_flag);
}
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
mbmi->use_wedge_interintra = 0;
if (cm->reference_mode != COMPOUND_REFERENCE &&
#if CONFIG_SUPERTX
......@@ -2115,7 +2115,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
}
}
}
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
mbmi->motion_mode = SIMPLE_TRANSLATION;
......
......@@ -122,7 +122,9 @@ static struct av1_token intra_filter_encodings[INTRA_FILTERS];
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
static struct av1_token interintra_mode_encodings[INTERINTRA_MODES];
#endif
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
static struct av1_token compound_type_encodings[COMPOUND_TYPES];
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
......@@ -172,7 +174,9 @@ void av1_encode_token_init(void) {
av1_tokens_from_tree(intra_filter_encodings, av1_intra_filter_tree);
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
av1_tokens_from_tree(interintra_mode_encodings, av1_interintra_mode_tree);
#endif // CONFIG_INTERINTRA
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
av1_tokens_from_tree(compound_type_encodings, av1_compound_type_tree);
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
......@@ -235,13 +239,13 @@ static void write_intra_mode_kf(const AV1_COMMON *cm, FRAME_CONTEXT *frame_ctx,
#endif
}
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
static void write_interintra_mode(aom_writer *w, INTERINTRA_MODE mode,
const aom_prob *probs) {
av1_write_token(w, av1_interintra_mode_tree, probs,
&interintra_mode_encodings[mode]);
}
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
static void write_inter_mode(aom_writer *w, PREDICTION_MODE mode,
FRAME_CONTEXT *ec_ctx, const int16_t mode_ctx) {
......@@ -2008,7 +2012,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
}
}
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (cpi->common.reference_mode != COMPOUND_REFERENCE &&
#if CONFIG_SUPERTX
!supertx_enabled &&
......@@ -2031,7 +2035,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
}
}
}
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX
......@@ -4734,7 +4738,7 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
update_inter_mode_probs(cm, header_bc, counts);
#if CONFIG_EXT_INTER
update_inter_compound_mode_probs(cm, probwt, header_bc);
#if CONFIG_INTERINTRA
if (cm->reference_mode != COMPOUND_REFERENCE) {
#if CONFIG_INTERINTRA
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) {
......@@ -4757,6 +4761,7 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
#endif // CONFIG_WEDGE
#endif // CONFIG_INTERINTRA
}
#endif // CONFIG_INTERINTRA
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
if (cm->reference_mode != SINGLE_REFERENCE) {
for (i = 0; i < BLOCK_SIZES; i++)
......
......@@ -2173,7 +2173,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
#endif // CONFIG_EXT_REFS
}
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (cm->reference_mode != COMPOUND_REFERENCE &&
#if CONFIG_SUPERTX
!supertx_enabled &&
......@@ -2189,7 +2189,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
counts->interintra[bsize_group][0]++;
}
}
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
const MOTION_MODE motion_allowed = motion_mode_allowed(
......
......@@ -553,7 +553,9 @@ typedef struct AV1_COMP {
#if CONFIG_EXT_INTER
unsigned int inter_compound_mode_cost[INTER_MODE_CONTEXTS]
[INTER_COMPOUND_MODES];
#if CONFIG_INTERINTRA
unsigned int interintra_mode_cost[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
int motion_mode_cost[BLOCK_SIZES][MOTION_MODES];
......
......@@ -439,10 +439,12 @@ void av1_initialize_rd_consts(AV1_COMP *cpi) {
av1_cost_tokens((int *)cpi->inter_compound_mode_cost[i],
cm->fc->inter_compound_mode_probs[i],
av1_inter_compound_mode_tree);
#if CONFIG_INTERINTRA
for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
av1_cost_tokens((int *)cpi->interintra_mode_cost[i],
cm->fc->interintra_mode_prob[i],
av1_interintra_mode_tree);
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; i++) {
......
......@@ -9569,10 +9569,10 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
int best_skip2 = 0;
uint8_t ref_frame_skip_mask[2] = { 0 };
uint32_t mode_skip_mask[TOTAL_REFS_PER_FRAME] = { 0 };
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
MV_REFERENCE_FRAME best_single_inter_ref = LAST_FRAME;
int64_t best_single_inter_rd = INT64_MAX;
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
int mode_skip_start = sf->mode_skip_start + 1;
const int *const rd_threshes = rd_opt->threshes[segment_id][bsize];
const int *const rd_thresh_freq_fact = tile_data->thresh_freq_fact[bsize];
......@@ -10101,9 +10101,9 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
if (comp_pred) xd->plane[i].pre[1] = yv12_mb[second_ref_frame][i];
}
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
mbmi->interintra_mode = (INTERINTRA_MODE)(II_DC_PRED - 1);
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (ref_frame == INTRA_FRAME) {
RD_STATS rd_stats_y;
......@@ -10265,7 +10265,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
backup_ref_mv[0] = mbmi_ext->ref_mvs[ref_frame][0];
if (comp_pred) backup_ref_mv[1] = mbmi_ext->ref_mvs[second_ref_frame][0];
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
if (second_ref_frame == INTRA_FRAME) {
if (best_single_inter_ref != ref_frame) continue;
mbmi->interintra_mode = intra_to_interintra_mode[best_intra_mode];
......@@ -10283,7 +10283,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
#endif // CONFIG_FILTER_INTRA
}
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
mbmi->ref_mv_idx = 0;
ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
......@@ -10684,13 +10684,13 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
best_intra_rd = this_rd;
best_intra_mode = mbmi->mode;
}
#if CONFIG_EXT_INTER
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
} else if (second_ref_frame == NONE_FRAME) {
if (this_rd < best_single_inter_rd) {
best_single_inter_rd = this_rd;
best_single_inter_ref = mbmi->ref_frame[0];
}
#endif // CONFIG_EXT_INTER
#endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA
}
if (!disable_skip && ref_frame == INTRA_FRAME) {
......
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