Commit 2b9ec2ea authored by Sarah Parker's avatar Sarah Parker

Rename ZEROMV to GLOBALMV

This name better reflects the functionality of the mode.

Change-Id: Idc2372e7c7b226f70f63fa4f272a88cb4d857089
parent e39b3b8b
......@@ -573,13 +573,13 @@ static const int mode_lf_lut[] = {
#if CONFIG_SMOOTH_HV
0, 0,
#endif // CONFIG_SMOOTH_HV
1, 1, 0, 1, // INTER_MODES (ZEROMV == 0)
1, 1, 0, 1, // INTER_MODES (GLOBALMV == 0)
#if CONFIG_COMPOUND_SINGLEREF
// 1, 1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES
// NOTE(zoeliu): Remove SR_NEAREST_NEWMV
1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES
#endif // CONFIG_COMPOUND_SINGLEREF
1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (ZERO_ZEROMV == 0)
1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (GLOBAL_GLOBALMV == 0)
};
static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {
......
......@@ -120,13 +120,13 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // PAETH_PRED
MB_MODE_COUNT, // NEARESTMV
MB_MODE_COUNT, // NEARMV
MB_MODE_COUNT, // ZEROMV
MB_MODE_COUNT, // GLOBALMV
MB_MODE_COUNT, // NEWMV
#if CONFIG_COMPOUND_SINGLEREF
NEARESTMV, // SR_NEAREST_NEARMV
// NEARESTMV, // SR_NEAREST_NEWMV
NEARMV, // SR_NEAR_NEWMV
ZEROMV, // SR_ZERO_NEWMV
GLOBALMV, // SR_ZERO_NEWMV
NEWMV, // SR_NEW_NEWMV
#endif // CONFIG_COMPOUND_SINGLEREF
NEARESTMV, // NEAREST_NEARESTMV
......@@ -135,7 +135,7 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
NEWMV, // NEW_NEARESTMV
NEARMV, // NEAR_NEWMV
NEWMV, // NEW_NEARMV
ZEROMV, // ZERO_ZEROMV
GLOBALMV, // GLOBAL_GLOBALMV
NEWMV, // NEW_NEWMV
};
assert(NELEMENTS(lut) == MB_MODE_COUNT);
......@@ -166,7 +166,7 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // PAETH_PRED
MB_MODE_COUNT, // NEARESTMV
MB_MODE_COUNT, // NEARMV
MB_MODE_COUNT, // ZEROMV
MB_MODE_COUNT, // GLOBALMV
MB_MODE_COUNT, // NEWMV
#if CONFIG_COMPOUND_SINGLEREF
NEARMV, // SR_NEAREST_NEARMV
......@@ -181,7 +181,7 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
NEARESTMV, // NEW_NEARESTMV
NEWMV, // NEAR_NEWMV
NEARMV, // NEW_NEARMV
ZEROMV, // ZERO_ZEROMV
GLOBALMV, // GLOBAL_GLOBALMV
NEWMV, // NEW_NEWMV
};
assert(NELEMENTS(lut) == MB_MODE_COUNT);
......@@ -499,7 +499,7 @@ static INLINE int is_global_mv_block(const MODE_INFO *mi, int block,
const int block_size_allowed =
AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
#endif // GLOBAL_SUB8X8_USED
return (mode == ZEROMV || mode == ZERO_ZEROMV) && type > TRANSLATION &&
return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
block_size_allowed;
}
......@@ -1502,8 +1502,8 @@ static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) {
const MB_MODE_INFO *const mbmi = &mi->mbmi;
int ref;
// First check if all modes are ZEROMV
if (mbmi->mode != ZEROMV && mbmi->mode != ZERO_ZEROMV) return 0;
// First check if all modes are GLOBALMV
if (mbmi->mode != GLOBALMV && mbmi->mode != GLOBAL_GLOBALMV) return 0;
#if !GLOBAL_SUB8X8_USED
if (mbmi->sb_type < BLOCK_8X8) return 0;
......
......@@ -592,7 +592,7 @@ static const aom_prob default_newmv_prob[NEWMV_MODE_CONTEXTS] = {
155, 116, 94, 32, 96, 56, 30,
};
static const aom_prob default_zeromv_prob[ZEROMV_MODE_CONTEXTS] = {
static const aom_prob default_zeromv_prob[GLOBALMV_MODE_CONTEXTS] = {
45, 13,
};
......@@ -612,7 +612,7 @@ static const aom_cdf_prob default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)] =
{ AOM_ICDF(128 * 96), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 56), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 30), AOM_ICDF(32768), 0 } };
static const aom_cdf_prob default_zeromv_cdf[ZEROMV_MODE_CONTEXTS][CDF_SIZE(
static const aom_cdf_prob default_zeromv_cdf[GLOBALMV_MODE_CONTEXTS][CDF_SIZE(
2)] = { { AOM_ICDF(128 * 45), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 13), AOM_ICDF(32768), 0 } };
static const aom_cdf_prob default_refmv_cdf[REFMV_MODE_CONTEXTS][CDF_SIZE(2)] =
......@@ -1117,7 +1117,7 @@ const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
const aom_tree_index av1_inter_compound_mode_tree
[TREE_SIZE(INTER_COMPOUND_MODES)] = {
-INTER_COMPOUND_OFFSET(ZERO_ZEROMV), 2,
-INTER_COMPOUND_OFFSET(GLOBAL_GLOBALMV), 2,
-INTER_COMPOUND_OFFSET(NEAREST_NEARESTMV), 4,
6, -INTER_COMPOUND_OFFSET(NEW_NEWMV),
-INTER_COMPOUND_OFFSET(NEAR_NEARMV), 8,
......@@ -6082,7 +6082,7 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i)
fc->newmv_prob[i] =
av1_mode_mv_merge_probs(pre_fc->newmv_prob[i], counts->newmv_mode[i]);
for (i = 0; i < ZEROMV_MODE_CONTEXTS; ++i)
for (i = 0; i < GLOBALMV_MODE_CONTEXTS; ++i)
fc->zeromv_prob[i] =
av1_mode_mv_merge_probs(pre_fc->zeromv_prob[i], counts->zeromv_mode[i]);
for (i = 0; i < REFMV_MODE_CONTEXTS; ++i)
......
......@@ -185,12 +185,12 @@ typedef struct frame_contexts {
#endif
aom_prob newmv_prob[NEWMV_MODE_CONTEXTS];
aom_prob zeromv_prob[ZEROMV_MODE_CONTEXTS];
aom_prob zeromv_prob[GLOBALMV_MODE_CONTEXTS];
aom_prob refmv_prob[REFMV_MODE_CONTEXTS];
aom_prob drl_prob[DRL_MODE_CONTEXTS];
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob zeromv_cdf[ZEROMV_MODE_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob zeromv_cdf[GLOBALMV_MODE_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob refmv_cdf[REFMV_MODE_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)];
#endif
......@@ -440,7 +440,7 @@ typedef struct FRAME_COUNTS {
#endif
unsigned int newmv_mode[NEWMV_MODE_CONTEXTS][2];
unsigned int zeromv_mode[ZEROMV_MODE_CONTEXTS][2];
unsigned int zeromv_mode[GLOBALMV_MODE_CONTEXTS][2];
unsigned int refmv_mode[REFMV_MODE_CONTEXTS][2];
unsigned int drl_mode[DRL_MODE_CONTEXTS][2];
......
......@@ -507,7 +507,7 @@ typedef enum ATTRIBUTE_PACKED {
PAETH_PRED, // Predict from the direction of smallest gradient
NEARESTMV,
NEARMV,
ZEROMV,
GLOBALMV,
NEWMV,
#if CONFIG_COMPOUND_SINGLEREF
// Single ref compound modes
......@@ -524,7 +524,7 @@ typedef enum ATTRIBUTE_PACKED {
NEW_NEARESTMV,
NEAR_NEWMV,
NEW_NEARMV,
ZERO_ZEROMV,
GLOBAL_GLOBALMV,
NEW_NEWMV,
MB_MODE_COUNT,
INTRA_MODES = PAETH_PRED + 1, // PAETH_PRED has to be the last intra mode.
......@@ -632,15 +632,15 @@ typedef enum ATTRIBUTE_PACKED {
#define NMV_CONTEXTS 3
#define NEWMV_MODE_CONTEXTS 7
#define ZEROMV_MODE_CONTEXTS 2
#define GLOBALMV_MODE_CONTEXTS 2
#define REFMV_MODE_CONTEXTS 9
#define DRL_MODE_CONTEXTS 5
#define ZEROMV_OFFSET 3
#define GLOBALMV_OFFSET 3
#define REFMV_OFFSET 4
#define NEWMV_CTX_MASK ((1 << ZEROMV_OFFSET) - 1)
#define ZEROMV_CTX_MASK ((1 << (REFMV_OFFSET - ZEROMV_OFFSET)) - 1)
#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
#define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
#define ALL_ZERO_FLAG_OFFSET 8
......
......@@ -476,7 +476,7 @@ static int add_tpl_ref_mv(const AV1_COMMON *cm,
if (blk_row == 0 && blk_col == 0)
if (abs(this_refmv.as_mv.row) >= 16 ||
abs(this_refmv.as_mv.col) >= 16)
mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);
mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
for (idx = 0; idx < *refmv_count; ++idx)
if (abs(this_refmv.as_mv.row - ref_mv_stack[idx].this_mv.as_mv.row) <
......@@ -514,7 +514,7 @@ static int add_tpl_ref_mv(const AV1_COMMON *cm,
abs(this_refmv.as_mv.col) >= 16 ||
abs(comp_refmv.as_mv.row) >= 16 ||
abs(comp_refmv.as_mv.col) >= 16)
mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);
mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
for (idx = 0; idx < *refmv_count; ++idx)
if (abs(this_refmv.as_mv.row - ref_mv_stack[idx].this_mv.as_mv.row) <
......@@ -597,7 +597,7 @@ static int add_col_ref_mv(const AV1_COMMON *cm,
#endif
{
if (abs(this_refmv.as_mv.row) >= 16 || abs(this_refmv.as_mv.col) >= 16)
mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);
mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
}
for (idx = 0; idx < *refmv_count; ++idx)
......@@ -746,7 +746,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
}
if (coll_blk_count == 0) mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);
if (coll_blk_count == 0) mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
for (i = 0; i < 9; ++i) {
blk_row = tpl_sample_pos[i][0];
......@@ -822,9 +822,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
#endif
if (coll_blk_count == 0) mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);
if (coll_blk_count == 0) mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
} else {
mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);
mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
}
#endif // CONFIG_MFMV
......
......@@ -61,7 +61,7 @@ static const int mode_2_counter[] = {
9, // PAETH_PRED
0, // NEARESTMV
0, // NEARMV
3, // ZEROMV
3, // GLOBALMV
1, // NEWMV
#if CONFIG_COMPOUND_SINGLEREF
0, // SR_NEAREST_NEARMV
......@@ -76,7 +76,7 @@ static const int mode_2_counter[] = {
1, // NEW_NEARESTMV
1, // NEAR_NEWMV
1, // NEW_NEARMV
3, // ZERO_ZEROMV
3, // GLOBAL_GLOBALMV
1, // NEW_NEWMV
};
......
......@@ -35,8 +35,8 @@ typedef enum {
SEG_LVL_ALT_LF_V, // Use alternate loop filter value on v plane
SEG_LVL_REF_FRAME, // Optional Segment reference frame
SEG_LVL_SKIP, // Optional Segment (0,0) + skip mode
#if CONFIG_SEGMENT_ZEROMV
SEG_LVL_ZEROMV,
#if CONFIG_SEGMENT_GLOBALMV
SEG_LVL_GLOBALMV,
SEG_LVL_MAX
#else
SEG_LVL_MAX
......@@ -49,8 +49,8 @@ typedef enum {
SEG_LVL_ALT_LF = 1, // Use alternate loop filter value...
SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame
SEG_LVL_SKIP = 3, // Optional Segment (0,0) + skip mode
#if CONFIG_SEGMENT_ZEROMV
SEG_LVL_ZEROMV = 4,
#if CONFIG_SEGMENT_GLOBALMV
SEG_LVL_GLOBALMV = 4,
SEG_LVL_MAX = 5
#else
SEG_LVL_MAX = 4
......
......@@ -151,7 +151,7 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i;
for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i)
av1_diff_update_prob(r, &fc->newmv_prob[i], ACCT_STR);
for (i = 0; i < ZEROMV_MODE_CONTEXTS; ++i)
for (i = 0; i < GLOBALMV_MODE_CONTEXTS; ++i)
av1_diff_update_prob(r, &fc->zeromv_prob[i], ACCT_STR);
for (i = 0; i < REFMV_MODE_CONTEXTS; ++i)
av1_diff_update_prob(r, &fc->refmv_prob[i], ACCT_STR);
......
......@@ -197,8 +197,8 @@ static PREDICTION_MODE read_inter_mode(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
return NEWMV;
}
if (counts) ++counts->newmv_mode[mode_ctx][1];
if (ctx & (1 << ALL_ZERO_FLAG_OFFSET)) return ZEROMV;
mode_ctx = (ctx >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
if (ctx & (1 << ALL_ZERO_FLAG_OFFSET)) return GLOBALMV;
mode_ctx = (ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
#if CONFIG_NEW_MULTISYMBOL
is_zeromv =
aom_read_symbol(r, ec_ctx->zeromv_cdf[mode_ctx], 2, ACCT_STR) == 0;
......@@ -207,7 +207,7 @@ static PREDICTION_MODE read_inter_mode(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
#endif
if (is_zeromv) {
if (counts) ++counts->zeromv_mode[mode_ctx][0];
return ZEROMV;
return GLOBALMV;
}
if (counts) ++counts->zeromv_mode[mode_ctx][1];
mode_ctx = (ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
......@@ -1570,9 +1570,9 @@ static void read_ref_frames(AV1_COMMON *const cm, MACROBLOCKD *const xd,
SEG_LVL_REF_FRAME);
ref_frame[1] = NONE_FRAME;
}
#if CONFIG_SEGMENT_ZEROMV
#if CONFIG_SEGMENT_GLOBALMV
else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
segfeature_active(&cm->seg, segment_id, SEG_LVL_ZEROMV))
segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV))
#else
else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP))
#endif
......@@ -1994,7 +1994,7 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
if (is_compound) pred_mv[1].as_int = near_mv[1].as_int;
break;
}
case ZEROMV: {
case GLOBALMV: {
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]],
cm->allow_high_precision_mv, bsize,
mi_col, mi_row, block
......@@ -2178,7 +2178,7 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
mv[1].as_int = near_mv[1].as_int;
break;
}
case ZERO_ZEROMV: {
case GLOBAL_GLOBALMV: {
assert(is_compound);
mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]],
cm->allow_high_precision_mv, bsize,
......@@ -2275,9 +2275,9 @@ static void dec_dump_logs(AV1_COMMON *cm, MODE_INFO *const mi, int mi_row,
int16_t zeromv_ctx = -1;
int16_t refmv_ctx = -1;
if (mbmi->mode != NEWMV) {
if (mode_ctx & (1 << ALL_ZERO_FLAG_OFFSET)) assert(mbmi->mode == ZEROMV);
zeromv_ctx = (mode_ctx >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
if (mbmi->mode != ZEROMV) {
if (mode_ctx & (1 << ALL_ZERO_FLAG_OFFSET)) assert(mbmi->mode == GLOBALMV);
zeromv_ctx = (mode_ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
if (mbmi->mode != GLOBALMV) {
refmv_ctx = (mode_ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
if (mode_ctx & (1 << SKIP_NEARESTMV_OFFSET)) refmv_ctx = 6;
if (mode_ctx & (1 << SKIP_NEARMV_OFFSET)) refmv_ctx = 7;
......@@ -2422,14 +2422,14 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
av1_mode_context_analyzer(inter_mode_ctx, mbmi->ref_frame, bsize, -1);
mbmi->ref_mv_idx = 0;
#if CONFIG_SEGMENT_ZEROMV
#if CONFIG_SEGMENT_GLOBALMV
if (segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP) ||
segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_ZEROMV))
segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_GLOBALMV))
#else
if (segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP))
#endif
{
mbmi->mode = ZEROMV;
mbmi->mode = GLOBALMV;
} else {
if (is_compound) mbmi->mode = read_inter_compound_mode(cm, xd, r, mode_ctx);
#if CONFIG_COMPOUND_SINGLEREF
......@@ -2446,7 +2446,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
read_drl_idx(ec_ctx, xd, mbmi, r);
}
if (mbmi->mode != ZEROMV && mbmi->mode != ZERO_ZEROMV) {
if (mbmi->mode != GLOBALMV && mbmi->mode != GLOBAL_GLOBALMV) {
for (ref = 0; ref < 1 + is_compound; ++ref) {
#if CONFIG_AMVR
av1_find_best_ref_mvs(allow_hp, ref_mvs[mbmi->ref_frame[ref]],
......@@ -2460,9 +2460,9 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
}
#if CONFIG_COMPOUND_SINGLEREF
if ((is_compound || is_singleref_comp_mode) && mbmi->mode != ZERO_ZEROMV)
#else // !CONFIG_COMPOUND_SINGLEREF
if (is_compound && mbmi->mode != ZERO_ZEROMV)
if ((is_compound || is_singleref_comp_mode) && mbmi->mode != GLOBAL_GLOBALMV)
#else // !CONFIG_COMPOUND_SINGLEREF
if (is_compound && mbmi->mode != GLOBAL_GLOBALMV)
#endif // CONFIG_COMPOUND_SINGLEREF
{
uint8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
......
......@@ -423,7 +423,7 @@ static void cyclic_refresh_update_map(AV1_COMP *const cpi) {
const int bl_index2 = bl_index + y * cm->mi_cols + x;
// If the block is as a candidate for clean up then mark it
// for possible boost/refresh (segment 1). The segment id may get
// reset to 0 later if block gets coded anything other than ZEROMV.
// reset to 0 later if block gets coded anything other than GLOBALMV.
if (cr->map[bl_index2] == 0) {
if (cr->last_coded_q_map[bl_index2] > qindex_thresh) sum_map++;
} else if (cr->map[bl_index2] < 0) {
......
......@@ -132,18 +132,19 @@ static void write_inter_mode(aom_writer *w, PREDICTION_MODE mode,
if (mode != NEWMV) {
if (mode_ctx & (1 << ALL_ZERO_FLAG_OFFSET)) {
assert(mode == ZEROMV);
assert(mode == GLOBALMV);
return;
}
const int16_t zeromv_ctx = (mode_ctx >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
const int16_t zeromv_ctx =
(mode_ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol(w, mode != ZEROMV, ec_ctx->zeromv_cdf[zeromv_ctx], 2);
aom_write_symbol(w, mode != GLOBALMV, ec_ctx->zeromv_cdf[zeromv_ctx], 2);
#else
aom_write(w, mode != ZEROMV, ec_ctx->zeromv_prob[zeromv_ctx]);
aom_write(w, mode != GLOBALMV, ec_ctx->zeromv_prob[zeromv_ctx]);
#endif
if (mode != ZEROMV) {
if (mode != GLOBALMV) {
int16_t refmv_ctx = (mode_ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
if (mode_ctx & (1 << SKIP_NEARESTMV_OFFSET)) refmv_ctx = 6;
......@@ -354,7 +355,7 @@ static void update_inter_mode_probs(AV1_COMMON *cm, aom_writer *w,
for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i)
av1_cond_prob_diff_update(w, &cm->fc->newmv_prob[i], counts->newmv_mode[i],
probwt);
for (i = 0; i < ZEROMV_MODE_CONTEXTS; ++i)
for (i = 0; i < GLOBALMV_MODE_CONTEXTS; ++i)
av1_cond_prob_diff_update(w, &cm->fc->zeromv_prob[i],
counts->zeromv_mode[i], probwt);
for (i = 0; i < REFMV_MODE_CONTEXTS; ++i)
......@@ -801,9 +802,9 @@ static void write_ref_frames(const AV1_COMMON *cm, const MACROBLOCKD *xd,
assert(mbmi->ref_frame[0] ==
get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME));
}
#if CONFIG_SEGMENT_ZEROMV
#if CONFIG_SEGMENT_GLOBALMV
else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
segfeature_active(&cm->seg, segment_id, SEG_LVL_ZEROMV))
segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV))
#else
else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP))
#endif
......@@ -1974,11 +1975,11 @@ static void enc_dump_logs(AV1_COMP *cpi, int mi_row, int mi_col) {
int16_t zeromv_ctx = -1;
int16_t refmv_ctx = -1;
if (mbmi->mode != NEWMV) {
zeromv_ctx = (mode_ctx >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
zeromv_ctx = (mode_ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
if (mode_ctx & (1 << ALL_ZERO_FLAG_OFFSET)) {
assert(mbmi->mode == ZEROMV);
assert(mbmi->mode == GLOBALMV);
}
if (mbmi->mode != ZEROMV) {
if (mbmi->mode != GLOBALMV) {
refmv_ctx = (mode_ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
if (mode_ctx & (1 << SKIP_NEARESTMV_OFFSET)) refmv_ctx = 6;
if (mode_ctx & (1 << SKIP_NEARMV_OFFSET)) refmv_ctx = 7;
......
......@@ -207,7 +207,7 @@ struct macroblock {
int mbmode_cost[BLOCK_SIZE_GROUPS][INTRA_MODES];
int newmv_mode_cost[NEWMV_MODE_CONTEXTS][2];
int zeromv_mode_cost[ZEROMV_MODE_CONTEXTS][2];
int zeromv_mode_cost[GLOBALMV_MODE_CONTEXTS][2];
int refmv_mode_cost[REFMV_MODE_CONTEXTS][2];
int drl_mode_cost0[DRL_MODE_CONTEXTS][2];
......
......@@ -337,7 +337,7 @@ static void update_filter_type_count(FRAME_COUNTS *counts,
static void update_global_motion_used(PREDICTION_MODE mode, BLOCK_SIZE bsize,
const MB_MODE_INFO *mbmi,
RD_COUNTS *rdc) {
if (mode == ZEROMV || mode == ZERO_ZEROMV) {
if (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) {
const int num_4x4s =
num_4x4_blocks_wide_lookup[bsize] * num_4x4_blocks_high_lookup[bsize];
int ref;
......@@ -952,8 +952,8 @@ static void update_inter_mode_stats(FRAME_COUNTS *counts, PREDICTION_MODE mode,
return;
}
mode_ctx = (mode_context >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
if (mode == ZEROMV) {
mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
if (mode == GLOBALMV) {
++counts->zeromv_mode[mode_ctx][0];
return;
} else {
......
......@@ -338,7 +338,7 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
#endif
}
for (i = 0; i < ZEROMV_MODE_CONTEXTS; ++i) {
for (i = 0; i < GLOBALMV_MODE_CONTEXTS; ++i) {
#if CONFIG_NEW_MULTISYMBOL
av1_cost_tokens_from_cdf(x->zeromv_mode_cost[i], fc->zeromv_cdf[i], NULL);
#else
......@@ -1156,7 +1156,7 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_NEARA] += 1000;
rd->thresh_mult[THR_NEARG] += 1000;
rd->thresh_mult[THR_ZEROMV] += 2000;
rd->thresh_mult[THR_GLOBALMV] += 2000;
rd->thresh_mult[THR_ZEROL2] += 2000;
rd->thresh_mult[THR_ZEROL3] += 2000;
rd->thresh_mult[THR_ZEROB] += 2000;
......
......@@ -75,7 +75,7 @@ typedef enum {
THR_NEARA,
THR_NEARG,
THR_ZEROMV,
THR_GLOBALMV,
THR_ZEROL2,
THR_ZEROL3,
THR_ZEROB,
......
This diff is collapsed.
......@@ -63,21 +63,21 @@ enum {
// SR_NEAREST_NEARMV, SR_NEAREST_NEWMV, SR_NEAR_NEWMV,
// SR_ZERO_NEWMV, and SR_NEW_NEWMV.
#endif // CONFIG_COMPOUND_SINGLEREF
INTER_ALL = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << NEAR_NEARMV) | (1 << NEW_NEWMV) |
(1 << NEAREST_NEWMV) | (1 << NEAR_NEWMV) | (1 << NEW_NEARMV) |
(1 << NEW_NEARESTMV) | (1 << ZERO_ZEROMV),
INTER_ALL = (1 << NEARESTMV) | (1 << NEARMV) | (1 << GLOBALMV) |
(1 << NEWMV) | (1 << NEAREST_NEARESTMV) | (1 << NEAR_NEARMV) |
(1 << NEW_NEWMV) | (1 << NEAREST_NEWMV) | (1 << NEAR_NEWMV) |
(1 << NEW_NEARMV) | (1 << NEW_NEARESTMV) | (1 << GLOBAL_GLOBALMV),
INTER_NEAREST = (1 << NEARESTMV) | (1 << NEAREST_NEARESTMV) |
(1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV),
INTER_NEAREST_NEW = (1 << NEARESTMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << NEW_NEWMV) |
(1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) |
(1 << NEW_NEARMV) | (1 << NEAR_NEWMV),
INTER_NEAREST_ZERO = (1 << NEARESTMV) | (1 << ZEROMV) |
(1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) |
INTER_NEAREST_ZERO = (1 << NEARESTMV) | (1 << GLOBALMV) |
(1 << NEAREST_NEARESTMV) | (1 << GLOBAL_GLOBALMV) |
(1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV),
INTER_NEAREST_NEW_ZERO = (1 << NEARESTMV) | (1 << ZEROMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) |
INTER_NEAREST_NEW_ZERO = (1 << NEARESTMV) | (1 << GLOBALMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << GLOBAL_GLOBALMV) |
(1 << NEW_NEWMV) | (1 << NEW_NEARESTMV) |
(1 << NEAREST_NEWMV) | (1 << NEW_NEARMV) |
(1 << NEAR_NEWMV),
......@@ -86,8 +86,8 @@ enum {
(1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) |
(1 << NEW_NEARMV) | (1 << NEAR_NEWMV) |
(1 << NEAR_NEARMV),
INTER_NEAREST_NEAR_ZERO = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) |
(1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) |
INTER_NEAREST_NEAR_ZERO = (1 << NEARESTMV) | (1 << NEARMV) | (1 << GLOBALMV) |
(1 << NEAREST_NEARESTMV) | (1 << GLOBAL_GLOBALMV) |
(1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV) |
(1 << NEW_NEARMV) | (1 << NEAR_NEWMV) |
(1 << NEAR_NEARMV),
......@@ -439,7 +439,7 @@ typedef struct SPEED_FEATURES {
// by only looking at counts from 1/2 the bands.
FAST_COEFF_UPDATE use_fast_coef_updates;
// A binary mask indicating if NEARESTMV, NEARMV, ZEROMV, NEWMV
// A binary mask indicating if NEARESTMV, NEARMV, GLOBALMV, NEWMV
// modes are used in order from LSB to MSB for each BLOCK_SIZE.
int inter_mode_mask[BLOCK_SIZES_ALL];
......
......@@ -186,7 +186,7 @@ set(CONFIG_RD_DEBUG 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_RECT_TX_EXT 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_REFERENCE_BUFFER 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_REF_ADAPT 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SEGMENT_ZEROMV 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SEGMENT_GLOBALMV 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SHORT_FILTER 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SIMPLE_BWD_ADAPT 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SMOOTH_HV 1 CACHE NUMBER "AV1 experiment flag.")
......
......@@ -305,7 +305,7 @@ EXPERIMENT_LIST="
ctx1d
txk_sel
mv_compress
segment_zeromv
segment_globalmv
frame_superres
new_multisymbol
compound_singleref
......
......@@ -217,9 +217,9 @@ const map_entry prediction_mode_map[] = {
ENUM(SMOOTH_V_PRED), ENUM(SMOOTH_H_PRED),
#endif // CONFIG_SMOOTH_HV
ENUM(PAETH_PRED), ENUM(NEARESTMV), ENUM(NEARMV),
ENUM(ZEROMV), ENUM(NEWMV), ENUM(NEAREST_NEARESTMV),
ENUM(GLOBALMV), ENUM(NEWMV), ENUM(NEAREST_NEARESTMV),
ENUM(NEAR_NEARMV), ENUM(NEAREST_NEWMV), ENUM(NEW_NEARESTMV),
ENUM(NEAR_NEWMV), ENUM(NEW_NEARMV), ENUM(ZERO_ZEROMV),
ENUM(NEAR_NEWMV), ENUM(NEW_NEARMV), ENUM(GLOBAL_GLOBALMV),
ENUM(NEW_NEWMV), ENUM(INTRA_INVALID), LAST_ENUM
};
......
......@@ -404,14 +404,14 @@ int main(int argc, const char **argv) {
"static const aom_cdf_prob "
"default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)]");
cts_each_dim[0] = ZEROMV_MODE_CONTEXTS;
cts_each_dim[0] = GLOBALMV_MODE_CONTEXTS;
cts_each_dim[1] = 2;
optimize_entropy_table(
&fc.zeromv_mode[0][0], probsfile, 2, cts_each_dim, NULL, 1,
"static const aom_prob default_zeromv_prob[ZEROMV_MODE_CONTEXTS]");
"static const aom_prob default_zeromv_prob[GLOBALMV_MODE_CONTEXTS]");
optimize_cdf_table(&fc.zeromv_mode[0][0], probsfile, 2, cts_each_dim,
"static const aom_cdf_prob "
"default_zeromv_cdf[ZEROMV_MODE_CONTEXTS][CDF_SIZE(2)]");
"default_zeromv_cdf[GLOBALMV_MODE_CONTEXTS][CDF_SIZE(2)]");
cts_each_dim[0] = REFMV_MODE_CONTEXTS;
cts_each_dim[1] = 2;
......
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