Commit 7f24e1b0 authored by Zoe Liu's avatar Zoe Liu Committed by Debargha Mukherjee

Remove the single ref inter mode NEWFROMNEARMV

Change-Id: I246da885154303d139f5d97c53ebfc55d6dc82ca
parent 2a7de683
......@@ -263,10 +263,8 @@ static const uint16_t above_border_uv = 0x000f;
static const int mode_lf_lut[MB_MODE_COUNT] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // INTRA_MODES
1, 1, 0, 1 // INTER_MODES (ZEROMV == 0)
1, 1, 0, 1, // INTER_MODES (ZEROMV == 0)
#if CONFIG_EXT_INTER
,
1, // NEWFROMNEARMV mode
1, 1, 1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (ZERO_ZEROMV == 0)
#endif // CONFIG_EXT_INTER
};
......
......@@ -118,7 +118,7 @@ typedef struct {
#if CONFIG_EXT_INTER
static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) {
return mode >= NEARESTMV && mode <= NEWFROMNEARMV;
return mode >= NEARESTMV && mode <= NEWMV;
}
static INLINE int is_inter_compound_mode(PREDICTION_MODE mode) {
......@@ -144,7 +144,6 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // NEARMV
MB_MODE_COUNT, // ZEROMV
MB_MODE_COUNT, // NEWMV
MB_MODE_COUNT, // NEWFROMNEARMV
NEARESTMV, // NEAREST_NEARESTMV
NEARESTMV, // NEAREST_NEARMV
NEARMV, // NEAR_NEARESTMV
......@@ -179,7 +178,6 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // NEARMV
MB_MODE_COUNT, // ZEROMV
MB_MODE_COUNT, // NEWMV
MB_MODE_COUNT, // NEWFROMNEARMV
NEARESTMV, // NEAREST_NEARESTMV
NEARMV, // NEAREST_NEARMV
NEARESTMV, // NEAR_NEARESTMV
......@@ -196,9 +194,8 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
}
static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
return (mode == NEWMV || mode == NEWFROMNEARMV || mode == NEW_NEWMV ||
mode == NEAREST_NEWMV || mode == NEW_NEARESTMV ||
mode == NEAR_NEWMV || mode == NEW_NEARMV);
return (mode == NEWMV || mode == NEW_NEWMV || mode == NEAREST_NEWMV ||
mode == NEW_NEARESTMV || mode == NEAR_NEWMV || mode == NEW_NEARMV);
}
static INLINE int use_masked_motion_search(COMPOUND_TYPE type) {
......
......@@ -747,24 +747,10 @@ static const aom_prob default_refmv_prob[REFMV_MODE_CONTEXTS] = {
static const aom_prob default_drl_prob[DRL_MODE_CONTEXTS] = { 128, 160, 180,
128, 160 };
#if CONFIG_EXT_INTER
static const aom_prob default_new2mv_prob = 180;
#endif // CONFIG_EXT_INTER
#endif // CONFIG_REF_MV
static const aom_prob
default_inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1] = {
#if CONFIG_EXT_INTER
// TODO(zoeliu): To adjust the initial default probs
{ 2, 173, 34, 173 }, // 0 = both zero mv
{ 7, 145, 85, 145 }, // 1 = one zero mv + one a predicted mv
{ 7, 166, 63, 166 }, // 2 = two predicted mvs
{ 7, 94, 66, 128 }, // 3 = one predicted/zero and one new mv
{ 8, 64, 46, 128 }, // 4 = two new mvs
{ 17, 81, 31, 128 }, // 5 = one intra neighbour + x
{ 25, 29, 30, 96 }, // 6 = two intra neighbours
#else
{ 2, 173, 34 }, // 0 = both zero mv
{ 7, 145, 85 }, // 1 = one zero mv + one a predicted mv
{ 7, 166, 63 }, // 2 = two predicted mvs
......@@ -772,7 +758,6 @@ static const aom_prob
{ 8, 64, 46 }, // 4 = two new mvs
{ 17, 81, 31 }, // 5 = one intra neighbour + x
{ 25, 29, 30 }, // 6 = two intra neighbours
#endif // CONFIG_EXT_INTER
};
#if CONFIG_EXT_INTER
......@@ -951,14 +936,8 @@ const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
#endif // CONFIG_ALT_INTRA
const aom_tree_index av1_inter_mode_tree[TREE_SIZE(INTER_MODES)] = {
-INTER_OFFSET(ZEROMV), 2,
-INTER_OFFSET(NEARESTMV), 4,
#if CONFIG_EXT_INTER
-INTER_OFFSET(NEARMV), 6,
-INTER_OFFSET(NEWMV), -INTER_OFFSET(NEWFROMNEARMV)
#else
-INTER_OFFSET(NEARMV), -INTER_OFFSET(NEWMV)
#endif // CONFIG_EXT_INTER
-INTER_OFFSET(ZEROMV), 2, -INTER_OFFSET(NEARESTMV), 4, -INTER_OFFSET(NEARMV),
-INTER_OFFSET(NEWMV)
};
#if CONFIG_EXT_INTER
......@@ -1780,7 +1759,7 @@ static const aom_prob
},
},
};
#else
#else // !CONFIG_EXT_TX
/* clang-format off */
const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)] = {
......@@ -1943,7 +1922,7 @@ static const aom_cdf_prob
{ 23680, 23929, 27831, 30446, 30598, 31129, 31244, 31655, 31868, 32234,
32768, 0 },
};
#else
#else // !CONFIG_ALT_INTRA
static const aom_cdf_prob default_if_y_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(
INTRA_MODES)] = {
{ 8320, 11376, 12880, 19959, 23072, 24067, 25461, 26917, 29157, 32768, 0 },
......@@ -2560,7 +2539,7 @@ const aom_cdf_prob
{ 6656, 12164, 16993, 21568, 22933, 23648, 25322, 26602, 27806, 29841,
32768, 0 },
},
#else
#else // !CONFIG_ALT_INTRA
{ { 17536, 19321, 21527, 25360, 27516, 28026, 29323, 30023, 30999, 32768,
0 },
{ 11776, 15466, 22360, 24865, 26991, 27889, 29299, 30519, 31398, 32768,
......@@ -2795,9 +2774,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->zeromv_prob, default_zeromv_prob);
av1_copy(fc->refmv_prob, default_refmv_prob);
av1_copy(fc->drl_prob, default_drl_prob);
#if CONFIG_EXT_INTER
fc->new2mv_prob = default_new2mv_prob;
#endif // CONFIG_EXT_INTER
#endif // CONFIG_REF_MV
av1_copy(fc->inter_mode_probs, default_inter_mode_probs);
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
......@@ -3013,10 +2989,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
for (i = 0; i < DRL_MODE_CONTEXTS; ++i)
fc->drl_prob[i] =
av1_mode_mv_merge_probs(pre_fc->drl_prob[i], counts->drl_mode[i]);
#if CONFIG_EXT_INTER
fc->new2mv_prob =
av1_mode_mv_merge_probs(pre_fc->new2mv_prob, counts->new2mv_mode);
#endif // CONFIG_EXT_INTER
#else
for (i = 0; i < INTER_MODE_CONTEXTS; i++)
aom_tree_merge_probs(av1_inter_mode_tree, pre_fc->inter_mode_probs[i],
......
......@@ -181,10 +181,6 @@ typedef struct frame_contexts {
aom_prob zeromv_prob[ZEROMV_MODE_CONTEXTS];
aom_prob refmv_prob[REFMV_MODE_CONTEXTS];
aom_prob drl_prob[DRL_MODE_CONTEXTS];
#if CONFIG_EXT_INTER
aom_prob new2mv_prob;
#endif // CONFIG_EXT_INTER
#endif // CONFIG_REF_MV
aom_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
......@@ -344,9 +340,6 @@ typedef struct FRAME_COUNTS {
unsigned int zeromv_mode[ZEROMV_MODE_CONTEXTS][2];
unsigned int refmv_mode[REFMV_MODE_CONTEXTS][2];
unsigned int drl_mode[DRL_MODE_CONTEXTS][2];
#if CONFIG_EXT_INTER
unsigned int new2mv_mode[2];
#endif // CONFIG_EXT_INTER
#endif
unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
......
......@@ -314,7 +314,6 @@ typedef enum ATTRIBUTE_PACKED {
ZEROMV,
NEWMV,
#if CONFIG_EXT_INTER
NEWFROMNEARMV,
NEAREST_NEARESTMV,
NEAREST_NEARMV,
NEAR_NEARESTMV,
......@@ -389,11 +388,7 @@ typedef enum {
#define DIRECTIONAL_MODES (INTRA_MODES - 2)
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTER
#define INTER_MODES (1 + NEWFROMNEARMV - NEARESTMV)
#else
#define INTER_MODES (1 + NEWMV - NEARESTMV)
#endif // CONFIG_EXT_INTER
#if CONFIG_EXT_INTER
#define INTER_COMPOUND_MODES (1 + NEW_NEWMV - NEAREST_NEARESTMV)
......
......@@ -48,12 +48,7 @@ static uint8_t add_ref_mv_candidate(
ref_mv_stack[index].weight = 2 * len;
++(*refmv_count);
#if CONFIG_EXT_INTER
if (candidate->mode == NEWMV || candidate->mode == NEWFROMNEARMV)
#else
if (candidate->mode == NEWMV)
#endif // CONFIG_EXT_INTER
++newmv_count;
if (candidate->mode == NEWMV) ++newmv_count;
}
if (candidate_mi->mbmi.sb_type < BLOCK_8X8 && block >= 0 &&
......@@ -76,12 +71,7 @@ static uint8_t add_ref_mv_candidate(
ref_mv_stack[index].weight = len;
++(*refmv_count);
#if CONFIG_EXT_INTER
if (candidate->mode == NEWMV || candidate->mode == NEWFROMNEARMV)
#else
if (candidate->mode == NEWMV)
#endif // CONFIG_EXT_INTER
++newmv_count;
if (candidate->mode == NEWMV) ++newmv_count;
}
}
}
......
......@@ -64,7 +64,6 @@ static const int mode_2_counter[MB_MODE_COUNT] = {
3, // ZEROMV
1, // NEWMV
#if CONFIG_EXT_INTER
1, // NEWFROMNEARMV
0, // NEAREST_NEARESTMV
0, // NEAREST_NEARMV
0, // NEAR_NEARESTMV
......
......@@ -188,9 +188,6 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) {
av1_diff_update_prob(r, &fc->refmv_prob[i], ACCT_STR);
for (i = 0; i < DRL_MODE_CONTEXTS; ++i)
av1_diff_update_prob(r, &fc->drl_prob[i], ACCT_STR);
#if CONFIG_EXT_INTER
av1_diff_update_prob(r, &fc->new2mv_prob, ACCT_STR);
#endif // CONFIG_EXT_INTER
#else
#if !CONFIG_EC_ADAPT
int i, j;
......
......@@ -169,11 +169,7 @@ static INTERINTRA_MODE read_interintra_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
#endif // CONFIG_EXT_INTER
static PREDICTION_MODE read_inter_mode(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
MB_MODE_INFO *mbmi,
#endif
aom_reader *r, int16_t ctx) {
#if CONFIG_REF_MV
FRAME_COUNTS *counts = xd->counts;
int16_t mode_ctx = ctx & NEWMV_CTX_MASK;
......@@ -181,23 +177,7 @@ static PREDICTION_MODE read_inter_mode(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
if (aom_read(r, mode_prob, ACCT_STR) == 0) {
if (counts) ++counts->newmv_mode[mode_ctx][0];
#if CONFIG_EXT_INTER
if (has_second_ref(mbmi)) {
#endif // CONFIG_EXT_INTER
return NEWMV;
#if CONFIG_EXT_INTER
} else {
mode_prob = ec_ctx->new2mv_prob;
if (aom_read(r, mode_prob, ACCT_STR) == 0) {
if (counts) ++counts->new2mv_mode[0];
return NEWMV;
} else {
if (counts) ++counts->new2mv_mode[1];
return NEWFROMNEARMV;
}
}
#endif // CONFIG_EXT_INTER
return NEWMV;
}
if (counts) ++counts->newmv_mode[mode_ctx][1];
......@@ -1365,9 +1345,6 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
(void)bsize;
switch (mode) {
#if CONFIG_EXT_INTER
case NEWFROMNEARMV:
#endif // CONFIG_EXT_INTER
case NEWMV: {
FRAME_COUNTS *counts = xd->counts;
#if !CONFIG_REF_MV
......@@ -1628,9 +1605,6 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
const int unify_bsize = CONFIG_CB4X4;
int_mv nearestmv[2], nearmv[2];
int_mv ref_mvs[MODE_CTX_REF_FRAMES][MAX_MV_REF_CANDIDATES];
#if CONFIG_EXT_INTER
int mv_idx;
#endif // CONFIG_EXT_INTER
int ref, is_compound;
int16_t inter_mode_ctx[MODE_CTX_REF_FRAMES];
#if CONFIG_REF_MV && CONFIG_EXT_INTER
......@@ -1734,11 +1708,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
mbmi->mode = read_inter_compound_mode(cm, xd, r, mode_ctx);
else
#endif // CONFIG_EXT_INTER
mbmi->mode = read_inter_mode(ec_ctx, xd,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
mbmi,
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
r, mode_ctx);
mbmi->mode = read_inter_mode(ec_ctx, xd, r, mode_ctx);
#if CONFIG_REF_MV
#if CONFIG_EXT_INTER
if (mbmi->mode == NEARMV || mbmi->mode == NEAR_NEARMV ||
......@@ -1859,15 +1829,9 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
b_mode = read_inter_compound_mode(cm, xd, r, mode_ctx);
else
#endif // CONFIG_EXT_INTER
b_mode = read_inter_mode(ec_ctx, xd,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
mbmi,
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
r, mode_ctx);
b_mode = read_inter_mode(ec_ctx, xd, r, mode_ctx);
#if CONFIG_EXT_INTER
mv_idx = (b_mode == NEWFROMNEARMV) ? 1 : 0;
if (b_mode != ZEROMV && b_mode != ZERO_ZEROMV) {
#else
if (b_mode != ZEROMV) {
......@@ -1917,8 +1881,8 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
if (!assign_mv(cm, xd, b_mode, mbmi->ref_frame, j, block,
#if CONFIG_EXT_INTER
ref_mv[mv_idx],
#else
ref_mv[0],
#else // !CONFIG_EXT_INTER
ref_mv_s8,
#endif // CONFIG_EXT_INTER
nearest_sub8x8, near_sub8x8, mi_row, mi_col, is_compound,
......@@ -1971,12 +1935,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
}
int mv_corrupted_flag =
!assign_mv(cm, xd, mbmi->mode, mbmi->ref_frame, 0, mbmi->mv,
#if CONFIG_EXT_INTER
mbmi->mode == NEWFROMNEARMV ? nearmv : nearestmv,
#else
ref_mv,
#endif // CONFIG_EXT_INTER
!assign_mv(cm, xd, mbmi->mode, mbmi->ref_frame, 0, mbmi->mv, ref_mv,
nearestmv, nearmv, mi_row, mi_col, is_compound, allow_hp, r);
aom_merge_corrupted_flag(&xd->corrupted, mv_corrupted_flag);
}
......
......@@ -240,26 +240,15 @@ static void write_interintra_mode(aom_writer *w, INTERINTRA_MODE mode,
#endif // CONFIG_EXT_INTER
static void write_inter_mode(aom_writer *w, PREDICTION_MODE mode,
FRAME_CONTEXT *ec_ctx,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
int is_compound,
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
const int16_t mode_ctx) {
FRAME_CONTEXT *ec_ctx, const int16_t mode_ctx) {
#if CONFIG_REF_MV
const int16_t newmv_ctx = mode_ctx & NEWMV_CTX_MASK;
const aom_prob newmv_prob = ec_ctx->newmv_prob[newmv_ctx];
#if CONFIG_EXT_INTER
aom_write(w, mode != NEWMV && mode != NEWFROMNEARMV, newmv_prob);
if (!is_compound && (mode == NEWMV || mode == NEWFROMNEARMV))
aom_write(w, mode == NEWFROMNEARMV, ec_ctx->new2mv_prob);
if (mode != NEWMV && mode != NEWFROMNEARMV) {
#else
aom_write(w, mode != NEWMV, newmv_prob);
#define IS_NEWMV_MODE(mode) ((mode) == NEWMV)
aom_write(w, !IS_NEWMV_MODE(mode), newmv_prob);
if (mode != NEWMV) {
#endif // CONFIG_EXT_INTER
if (!IS_NEWMV_MODE(mode)) {
const int16_t zeromv_ctx = (mode_ctx >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
const aom_prob zeromv_prob = ec_ctx->zeromv_prob[zeromv_ctx];
......@@ -282,7 +271,10 @@ static void write_inter_mode(aom_writer *w, PREDICTION_MODE mode,
aom_write(w, mode != NEARESTMV, refmv_prob);
}
}
#else
#undef IS_NEWMV_MODE
#else // !CONFIG_REF_MV
assert(is_inter_mode(mode));
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_inter_mode_ind[INTER_OFFSET(mode)],
......@@ -520,10 +512,6 @@ static void update_inter_mode_probs(AV1_COMMON *cm, aom_writer *w,
for (i = 0; i < DRL_MODE_CONTEXTS; ++i)
av1_cond_prob_diff_update(w, &cm->fc->drl_prob[i], counts->drl_mode[i],
probwt);
#if CONFIG_EXT_INTER
av1_cond_prob_diff_update(w, &cm->fc->new2mv_prob, counts->new2mv_mode,
probwt);
#endif // CONFIG_EXT_INTER
}
#endif
......@@ -1734,11 +1722,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
write_inter_compound_mode(cm, w, mode, mode_ctx);
else if (is_inter_singleref_mode(mode))
#endif // CONFIG_EXT_INTER
write_inter_mode(w, mode, ec_ctx,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
is_compound,
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
mode_ctx);
write_inter_mode(w, mode, ec_ctx, mode_ctx);
#if CONFIG_REF_MV
#if CONFIG_EXT_INTER
......@@ -1778,15 +1762,10 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
write_inter_compound_mode(cm, w, b_mode, mode_ctx);
else if (is_inter_singleref_mode(b_mode))
#endif // CONFIG_EXT_INTER
write_inter_mode(w, b_mode, ec_ctx,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
has_second_ref(mbmi),
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
mode_ctx);
write_inter_mode(w, b_mode, ec_ctx, mode_ctx);
#if CONFIG_EXT_INTER
if (b_mode == NEWMV || b_mode == NEWFROMNEARMV ||
b_mode == NEW_NEWMV) {
if (b_mode == NEWMV || b_mode == NEW_NEWMV) {
#else
if (b_mode == NEWMV) {
#endif // CONFIG_EXT_INTER
......@@ -1838,7 +1817,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
}
} else {
#if CONFIG_EXT_INTER
if (mode == NEWMV || mode == NEWFROMNEARMV || mode == NEW_NEWMV) {
if (mode == NEWMV || mode == NEW_NEWMV) {
#else
if (mode == NEWMV) {
#endif // CONFIG_EXT_INTER
......@@ -1852,15 +1831,8 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
nmv_context *nmvc = &ec_ctx->nmvc[nmv_ctx];
#endif
ref_mv = mbmi_ext->ref_mvs[mbmi->ref_frame[ref]][0];
#if CONFIG_EXT_INTER
if (mode == NEWFROMNEARMV)
av1_encode_mv(cpi, w, &mbmi->mv[ref].as_mv,
&mbmi_ext->ref_mvs[mbmi->ref_frame[ref]][1].as_mv,
nmvc, allow_hp);
else
#endif // CONFIG_EXT_INTER
av1_encode_mv(cpi, w, &mbmi->mv[ref].as_mv, &ref_mv.as_mv, nmvc,
allow_hp);
av1_encode_mv(cpi, w, &mbmi->mv[ref].as_mv, &ref_mv.as_mv, nmvc,
allow_hp);
}
#if CONFIG_EXT_INTER
} else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
......
......@@ -1989,17 +1989,9 @@ static void rd_pick_sb_modes(const AV1_COMP *const cpi, TileDataEnc *tile_data,
#if CONFIG_REF_MV
static void update_inter_mode_stats(FRAME_COUNTS *counts, PREDICTION_MODE mode,
#if CONFIG_EXT_INTER
int is_compound,
#endif // CONFIG_EXT_INTER
int16_t mode_context) {
int16_t mode_ctx = mode_context & NEWMV_CTX_MASK;
#if CONFIG_EXT_INTER
if (mode == NEWMV || mode == NEWFROMNEARMV) {
if (!is_compound) ++counts->new2mv_mode[mode == NEWFROMNEARMV];
#else
if (mode == NEWMV) {
#endif // CONFIG_EXT_INTER
++counts->newmv_mode[mode_ctx][0];
return;
} else {
......@@ -2219,11 +2211,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
#endif // CONFIG_EXT_INTER
mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
mbmi->ref_frame, bsize, -1);
update_inter_mode_stats(counts, mode,
#if CONFIG_EXT_INTER
has_second_ref(mbmi),
#endif // CONFIG_EXT_INTER
mode_ctx);
update_inter_mode_stats(counts, mode, mode_ctx);
#if CONFIG_EXT_INTER
}
#endif // CONFIG_EXT_INTER
......@@ -2291,11 +2279,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
#endif // CONFIG_EXT_INTER
mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
mbmi->ref_frame, bsize, j);
update_inter_mode_stats(counts, b_mode,
#if CONFIG_EXT_INTER
has_second_ref(mbmi),
#endif // CONFIG_EXT_INTER
mode_ctx);
update_inter_mode_stats(counts, b_mode, mode_ctx);
#if CONFIG_EXT_INTER
}
#endif // CONFIG_EXT_INTER
......
......@@ -294,14 +294,13 @@ static void inc_mvs(const MB_MODE_INFO *mbmi, const MB_MODE_INFO_EXT *mbmi_ext,
nmv_context_counts *nmv_counts) {
int i;
PREDICTION_MODE mode = mbmi->mode;
int mv_idx = (mode == NEWFROMNEARMV);
#if !CONFIG_REF_MV
nmv_context_counts *counts = nmv_counts;
#endif
if (mode == NEWMV || mode == NEWFROMNEARMV || mode == NEW_NEWMV) {
if (mode == NEWMV || mode == NEW_NEWMV) {
for (i = 0; i < 1 + has_second_ref(mbmi); ++i) {
const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[i]][mv_idx].as_mv;
const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[i]][0].as_mv;
const MV diff = { mvs[i].as_mv.row - ref->row,
mvs[i].as_mv.col - ref->col };
#if CONFIG_REF_MV
......@@ -354,7 +353,7 @@ static void inc_mvs_sub8x8(const MODE_INFO *mi, int block, const int_mv mvs[2],
nmv_context_counts *counts = nmv_counts;
#endif
if (mode == NEWMV || mode == NEWFROMNEARMV || mode == NEW_NEWMV) {
if (mode == NEWMV || mode == NEW_NEWMV) {
for (i = 0; i < 1 + has_second_ref(&mi->mbmi); ++i) {
const MV *ref = &mi->bmi[block].ref_mv[i].as_mv;
const MV diff = { mvs[i].as_mv.row - ref->row,
......
......@@ -542,9 +542,6 @@ typedef struct AV1_COMP {
int zeromv_mode_cost[ZEROMV_MODE_CONTEXTS][2];
int refmv_mode_cost[REFMV_MODE_CONTEXTS][2];
int drl_mode_cost0[DRL_MODE_CONTEXTS][2];
#if CONFIG_EXT_INTER
int new2mv_mode_cost[2];
#endif // CONFIG_EXT_INTER
#endif
unsigned int inter_mode_cost[INTER_MODE_CONTEXTS][INTER_MODES];
......
......@@ -457,10 +457,6 @@ void av1_initialize_rd_consts(AV1_COMP *cpi) {
cpi->drl_mode_cost0[i][0] = av1_cost_bit(cm->fc->drl_prob[i], 0);
cpi->drl_mode_cost0[i][1] = av1_cost_bit(cm->fc->drl_prob[i], 1);
}
#if CONFIG_EXT_INTER
cpi->new2mv_mode_cost[0] = av1_cost_bit(cm->fc->new2mv_prob, 0);
cpi->new2mv_mode_cost[1] = av1_cost_bit(cm->fc->new2mv_prob, 1);
#endif // CONFIG_EXT_INTER
#else
for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
av1_cost_tokens((int *)cpi->inter_mode_cost[i],
......@@ -930,17 +926,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_NEARA] += 1000;
rd->thresh_mult[THR_NEARG] += 1000;
#if CONFIG_EXT_INTER
rd->thresh_mult[THR_NEWFROMNEARMV] += 1000;
#if CONFIG_EXT_REFS
rd->thresh_mult[THR_NEWFROMNEARL2] += 1000;
rd->thresh_mult[THR_NEWFROMNEARL3] += 1000;
rd->thresh_mult[THR_NEWFROMNEARB] += 1000;
#endif // CONFIG_EXT_REFS
rd->thresh_mult[THR_NEWFROMNEARA] += 1000;
rd->thresh_mult[THR_NEWFROMNEARG] += 1000;
#endif // CONFIG_EXT_INTER
rd->thresh_mult[THR_ZEROMV] += 2000;
#if CONFIG_EXT_REFS
rd->thresh_mult[THR_ZEROL2] += 2000;
......
......@@ -85,17 +85,6 @@ typedef enum {
THR_NEARA,
THR_NEARG,
#if CONFIG_EXT_INTER
THR_NEWFROMNEARMV,
#if CONFIG_EXT_REFS
THR_NEWFROMNEARL2,
THR_NEWFROMNEARL3,
THR_NEWFROMNEARB,
#endif // CONFIG_EXT_REFS
THR_NEWFROMNEARA,
THR_NEWFROMNEARG,
#endif // CONFIG_EXT_INTER
THR_ZEROMV,
#if CONFIG_EXT_REFS
THR_ZEROL2,
......
This diff is collapsed.
......@@ -36,15 +36,14 @@ enum {
#if CONFIG_EXT_INTER
enum {
INTER_ALL = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) | (1 << NEWMV) |
(1 << NEWFROMNEARMV) | (1 << NEAREST_NEARESTMV) |
(1 << NEAR_NEARMV) | (1 << NEAREST_NEARMV) |
(1 << NEAR_NEARESTMV) | (1 << NEW_NEWMV) | (1 << NEAREST_NEWMV) |
(1 << NEAR_NEWMV) | (1 << NEW_NEARMV) | (1 << NEW_NEARESTMV) |
(1 << ZERO_ZEROMV),
(1 << NEAREST_NEARESTMV) | (1 << NEAR_NEARMV) |
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) | (1 << NEW_NEWMV) |
(1 << NEAREST_NEWMV) | (1 << NEAR_NEWMV) | (1 << NEW_NEARMV) |
(1 << NEW_NEARESTMV) | (1 << ZERO_ZEROMV),
INTER_NEAREST = (1 << NEARESTMV) | (1 << NEAREST_NEARESTMV) |
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) |
(1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV),
INTER_NEAREST_NEW = (1 << NEARESTMV) | (1 << NEWMV) | (1 << NEWFROMNEARMV) |
INTER_NEAREST_NEW = (1 << NEARESTMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << NEW_NEWMV) |
(1 << NEAR_NEARESTMV) | (1 << NEAREST_NEARMV) |
(1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) |
......@@ -54,12 +53,12 @@ enum {
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) |
(1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV),
INTER_NEAREST_NEW_ZERO =
(1 << NEARESTMV) | (1 << ZEROMV) | (1 << NEWMV) | (1 << NEWFROMNEARMV) |
(1 << NEARESTMV) | (1 << ZEROMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) | (1 << NEW_NEWMV) |
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) | (1 << NEW_NEARESTMV) |
(1 << NEAREST_NEWMV) | (1 << NEW_NEARMV) | (1 << NEAR_NEWMV),
INTER_NEAREST_NEAR_NEW =
(1 << NEARESTMV) | (1 << NEARMV) | (1 << NEWMV) | (1 << NEWFROMNEARMV) |
(1 << NEARESTMV) | (1 << NEARMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << NEW_NEWMV) | (1 << NEAREST_NEARMV) |
(1 << NEAR_NEARESTMV) | (1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) |
(1 << NEW_NEARMV) | (1 << NEAR_NEWMV) | (1 << NEAR_NEARMV),
......
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