Commit 2eb9b845 authored by Luc Trudeau's avatar Luc Trudeau
Browse files

[Clean Up] Remove get_y_mode()

The get_y_mode function, is superfluous, not used consistently, and requires a
useless block_idx parameter than gets pass around a lot inside the
codebase for no apparent reason.

The block parameter is misleading, as it could cause people to think all these
functions actually use this value.

Change-Id: I7ae0a8d1282c009b9114c83771cce10f5c2ee397
parent bddba0a0
...@@ -21,7 +21,7 @@ PREDICTION_MODE av1_left_block_mode(const MODE_INFO *cur_mi, ...@@ -21,7 +21,7 @@ PREDICTION_MODE av1_left_block_mode(const MODE_INFO *cur_mi,
if (b == 0 || b == 2) { if (b == 0 || b == 2) {
if (!left_mi || is_inter_block(&left_mi->mbmi)) return DC_PRED; if (!left_mi || is_inter_block(&left_mi->mbmi)) return DC_PRED;
return get_y_mode(left_mi, b + 1); return left_mi->mbmi.mode;
} else { } else {
assert(b == 1 || b == 3); assert(b == 1 || b == 3);
return cur_mi->bmi[b - 1].as_mode; return cur_mi->bmi[b - 1].as_mode;
...@@ -33,7 +33,7 @@ PREDICTION_MODE av1_above_block_mode(const MODE_INFO *cur_mi, ...@@ -33,7 +33,7 @@ PREDICTION_MODE av1_above_block_mode(const MODE_INFO *cur_mi,
if (b == 0 || b == 1) { if (b == 0 || b == 1) {
if (!above_mi || is_inter_block(&above_mi->mbmi)) return DC_PRED; if (!above_mi || is_inter_block(&above_mi->mbmi)) return DC_PRED;
return get_y_mode(above_mi, b + 2); return above_mi->mbmi.mode;
} else { } else {
assert(b == 2 || b == 3); assert(b == 2 || b == 3);
return cur_mi->bmi[b - 2].as_mode; return cur_mi->bmi[b - 2].as_mode;
......
...@@ -389,11 +389,6 @@ static INLINE int is_intrabc_block(const MB_MODE_INFO *mbmi) { ...@@ -389,11 +389,6 @@ static INLINE int is_intrabc_block(const MB_MODE_INFO *mbmi) {
} }
#endif #endif
static INLINE PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) {
(void)block;
return mi->mbmi.mode;
}
#if CONFIG_CFL #if CONFIG_CFL
static INLINE PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) { static INLINE PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
assert(mode < UV_INTRA_MODES); assert(mode < UV_INTRA_MODES);
...@@ -465,13 +460,14 @@ PREDICTION_MODE av1_left_block_mode(const MODE_INFO *cur_mi, ...@@ -465,13 +460,14 @@ PREDICTION_MODE av1_left_block_mode(const MODE_INFO *cur_mi,
PREDICTION_MODE av1_above_block_mode(const MODE_INFO *cur_mi, PREDICTION_MODE av1_above_block_mode(const MODE_INFO *cur_mi,
const MODE_INFO *above_mi, int b); const MODE_INFO *above_mi, int b);
static INLINE int is_global_mv_block(const MODE_INFO *mi, int block, static INLINE int is_global_mv_block(const MODE_INFO *mi,
TransformationType type) { TransformationType type) {
PREDICTION_MODE mode = get_y_mode(mi, block); const MB_MODE_INFO *const mbmi = &mi->mbmi;
const PREDICTION_MODE mode = mbmi->mode;
#if GLOBAL_SUB8X8_USED #if GLOBAL_SUB8X8_USED
const int block_size_allowed = 1; const int block_size_allowed = 1;
#else #else
const BLOCK_SIZE bsize = mi->mbmi.sb_type; const BLOCK_SIZE bsize = mbmi->sb_type;
const int block_size_allowed = const int block_size_allowed =
AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8; AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
#endif // GLOBAL_SUB8X8_USED #endif // GLOBAL_SUB8X8_USED
...@@ -1012,7 +1008,7 @@ static INLINE int av1_raster_order_to_block_index(TX_SIZE tx_size, ...@@ -1012,7 +1008,7 @@ static INLINE int av1_raster_order_to_block_index(TX_SIZE tx_size,
} }
static INLINE TX_TYPE get_default_tx_type(PLANE_TYPE plane_type, static INLINE TX_TYPE get_default_tx_type(PLANE_TYPE plane_type,
const MACROBLOCKD *xd, int block_idx, const MACROBLOCKD *xd,
TX_SIZE tx_size) { TX_SIZE tx_size) {
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
...@@ -1021,7 +1017,7 @@ static INLINE TX_TYPE get_default_tx_type(PLANE_TYPE plane_type, ...@@ -1021,7 +1017,7 @@ static INLINE TX_TYPE get_default_tx_type(PLANE_TYPE plane_type,
return DCT_DCT; return DCT_DCT;
return intra_mode_to_tx_type_context[plane_type == PLANE_TYPE_Y return intra_mode_to_tx_type_context[plane_type == PLANE_TYPE_Y
? get_y_mode(xd->mi[0], block_idx) ? mbmi->mode
: get_uv_mode(mbmi->uv_mode)]; : get_uv_mode(mbmi->uv_mode)];
} }
...@@ -1032,7 +1028,7 @@ get_plane_block_size(BLOCK_SIZE bsize, const struct macroblockd_plane *pd) { ...@@ -1032,7 +1028,7 @@ get_plane_block_size(BLOCK_SIZE bsize, const struct macroblockd_plane *pd) {
static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type, static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type,
const MACROBLOCKD *xd, int blk_row, const MACROBLOCKD *xd, int blk_row,
int blk_col, int block, TX_SIZE tx_size) { int blk_col, TX_SIZE tx_size) {
const MODE_INFO *const mi = xd->mi[0]; const MODE_INFO *const mi = xd->mi[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi; const MB_MODE_INFO *const mbmi = &mi->mbmi;
(void)blk_row; (void)blk_row;
...@@ -1076,8 +1072,7 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type, ...@@ -1076,8 +1072,7 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type,
#endif // CONFIG_TXK_SEL #endif // CONFIG_TXK_SEL
#if FIXED_TX_TYPE #if FIXED_TX_TYPE
const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block); return get_default_tx_type(plane_type, xd, tx_size);
return get_default_tx_type(plane_type, xd, block_raster_idx, tx_size);
#endif // FIXED_TX_TYPE #endif // FIXED_TX_TYPE
#if CONFIG_DAALA_TX_DST32 #if CONFIG_DAALA_TX_DST32
...@@ -1102,7 +1097,6 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type, ...@@ -1102,7 +1097,6 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type,
} }
// UV Intra only // UV Intra only
(void)block;
TX_TYPE intra_type = TX_TYPE intra_type =
intra_mode_to_tx_type_context[get_uv_mode(mbmi->uv_mode)]; intra_mode_to_tx_type_context[get_uv_mode(mbmi->uv_mode)];
if (!av1_ext_tx_used[tx_set_type][intra_type]) return DCT_DCT; if (!av1_ext_tx_used[tx_set_type][intra_type]) return DCT_DCT;
...@@ -1282,14 +1276,14 @@ static INLINE int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) { ...@@ -1282,14 +1276,14 @@ static INLINE int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
} }
static INLINE MOTION_MODE static INLINE MOTION_MODE
motion_mode_allowed(int block, const WarpedMotionParams *gm_params, motion_mode_allowed(const WarpedMotionParams *gm_params, const MACROBLOCKD *xd,
const MACROBLOCKD *xd, const MODE_INFO *mi) { const MODE_INFO *mi) {
const MB_MODE_INFO *mbmi = &mi->mbmi; const MB_MODE_INFO *mbmi = &mi->mbmi;
#if CONFIG_AMVR #if CONFIG_AMVR
if (xd->cur_frame_force_integer_mv == 0) { if (xd->cur_frame_force_integer_mv == 0) {
#endif #endif
const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype; const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype;
if (is_global_mv_block(mi, block, gm_type)) return SIMPLE_TRANSLATION; if (is_global_mv_block(mi, gm_type)) return SIMPLE_TRANSLATION;
#if CONFIG_AMVR #if CONFIG_AMVR
} }
#endif #endif
...@@ -1313,12 +1307,12 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params, ...@@ -1313,12 +1307,12 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
} }
} }
static INLINE void assert_motion_mode_valid(MOTION_MODE mode, int block, static INLINE void assert_motion_mode_valid(MOTION_MODE mode,
const WarpedMotionParams *gm_params, const WarpedMotionParams *gm_params,
const MACROBLOCKD *xd, const MACROBLOCKD *xd,
const MODE_INFO *mi) { const MODE_INFO *mi) {
const MOTION_MODE last_motion_mode_allowed = const MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(block, gm_params, xd, mi); motion_mode_allowed(gm_params, xd, mi);
// Check that the input mode is not illegal // Check that the input mode is not illegal
if (last_motion_mode_allowed < mode) if (last_motion_mode_allowed < mode)
......
...@@ -230,7 +230,7 @@ static INLINE void integer_mv_precision(MV *mv) { ...@@ -230,7 +230,7 @@ static INLINE void integer_mv_precision(MV *mv) {
// represents an integer) // represents an integer)
static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm, static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm,
int allow_hp, BLOCK_SIZE bsize, int allow_hp, BLOCK_SIZE bsize,
int mi_col, int mi_row, int block_idx int mi_col, int mi_row
#if CONFIG_AMVR #if CONFIG_AMVR
, ,
int is_integer int is_integer
...@@ -239,7 +239,6 @@ static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm, ...@@ -239,7 +239,6 @@ static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm,
int_mv res; int_mv res;
const int32_t *mat = gm->wmmat; const int32_t *mat = gm->wmmat;
int x, y, tx, ty; int x, y, tx, ty;
(void)block_idx;
if (gm->wmtype == TRANSLATION) { if (gm->wmtype == TRANSLATION) {
// All global motion vectors are stored with WARPEDMODEL_PREC_BITS (16) // All global motion vectors are stored with WARPEDMODEL_PREC_BITS (16)
......
...@@ -68,7 +68,7 @@ static uint8_t add_ref_mv_candidate( ...@@ -68,7 +68,7 @@ static uint8_t add_ref_mv_candidate(
const MODE_INFO *const candidate_mi, const MB_MODE_INFO *const candidate, const MODE_INFO *const candidate_mi, const MB_MODE_INFO *const candidate,
const MV_REFERENCE_FRAME rf[2], uint8_t *refmv_count, const MV_REFERENCE_FRAME rf[2], uint8_t *refmv_count,
uint8_t *ref_match_count, CANDIDATE_MV *ref_mv_stack, const int use_hp, uint8_t *ref_match_count, CANDIDATE_MV *ref_mv_stack, const int use_hp,
int len, int block, int len,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates, const WarpedMotionParams *gm_params, int_mv *gm_mv_candidates, const WarpedMotionParams *gm_params,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -140,11 +140,11 @@ static uint8_t add_ref_mv_candidate( ...@@ -140,11 +140,11 @@ static uint8_t add_ref_mv_candidate(
} else { } else {
#endif // CONFIG_EXT_WARPED_MOTION #endif // CONFIG_EXT_WARPED_MOTION
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
if (is_global_mv_block(candidate_mi, block, gm_params[rf[0]].wmtype)) if (is_global_mv_block(candidate_mi, gm_params[rf[0]].wmtype))
this_refmv = gm_mv_candidates[0]; this_refmv = gm_mv_candidates[0];
else else
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
this_refmv = get_sub_block_mv(candidate_mi, ref, col, block); this_refmv = get_sub_block_mv(candidate_mi, ref, col);
#if CONFIG_AMVR #if CONFIG_AMVR
lower_mv_precision(&this_refmv.as_mv, use_hp, is_integer); lower_mv_precision(&this_refmv.as_mv, use_hp, is_integer);
#else #else
...@@ -163,7 +163,7 @@ static uint8_t add_ref_mv_candidate( ...@@ -163,7 +163,7 @@ static uint8_t add_ref_mv_candidate(
if (index == *refmv_count && *refmv_count < MAX_REF_MV_STACK_SIZE) { if (index == *refmv_count && *refmv_count < MAX_REF_MV_STACK_SIZE) {
ref_mv_stack[index].this_mv = this_refmv; ref_mv_stack[index].this_mv = this_refmv;
ref_mv_stack[index].pred_diff[0] = av1_get_pred_diff_ctx( ref_mv_stack[index].pred_diff[0] = av1_get_pred_diff_ctx(
get_sub_block_pred_mv(candidate_mi, ref, col, block), this_refmv); get_sub_block_pred_mv(candidate_mi, ref, col), this_refmv);
ref_mv_stack[index].weight = weight * len; ref_mv_stack[index].weight = weight * len;
++(*refmv_count); ++(*refmv_count);
...@@ -184,11 +184,11 @@ static uint8_t add_ref_mv_candidate( ...@@ -184,11 +184,11 @@ static uint8_t add_ref_mv_candidate(
for (ref = 0; ref < 2; ++ref) { for (ref = 0; ref < 2; ++ref) {
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
if (is_global_mv_block(candidate_mi, block, gm_params[rf[ref]].wmtype)) if (is_global_mv_block(candidate_mi, gm_params[rf[ref]].wmtype))
this_refmv[ref] = gm_mv_candidates[ref]; this_refmv[ref] = gm_mv_candidates[ref];
else else
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
this_refmv[ref] = get_sub_block_mv(candidate_mi, ref, col, block); this_refmv[ref] = get_sub_block_mv(candidate_mi, ref, col);
#if CONFIG_AMVR #if CONFIG_AMVR
lower_mv_precision(&this_refmv[ref].as_mv, use_hp, is_integer); lower_mv_precision(&this_refmv[ref].as_mv, use_hp, is_integer);
#else #else
...@@ -208,9 +208,9 @@ static uint8_t add_ref_mv_candidate( ...@@ -208,9 +208,9 @@ static uint8_t add_ref_mv_candidate(
ref_mv_stack[index].this_mv = this_refmv[0]; ref_mv_stack[index].this_mv = this_refmv[0];
ref_mv_stack[index].comp_mv = this_refmv[1]; ref_mv_stack[index].comp_mv = this_refmv[1];
ref_mv_stack[index].pred_diff[0] = av1_get_pred_diff_ctx( ref_mv_stack[index].pred_diff[0] = av1_get_pred_diff_ctx(
get_sub_block_pred_mv(candidate_mi, 0, col, block), this_refmv[0]); get_sub_block_pred_mv(candidate_mi, 0, col), this_refmv[0]);
ref_mv_stack[index].pred_diff[1] = av1_get_pred_diff_ctx( ref_mv_stack[index].pred_diff[1] = av1_get_pred_diff_ctx(
get_sub_block_pred_mv(candidate_mi, 1, col, block), this_refmv[1]); get_sub_block_pred_mv(candidate_mi, 1, col), this_refmv[1]);
ref_mv_stack[index].weight = weight * len; ref_mv_stack[index].weight = weight * len;
++(*refmv_count); ++(*refmv_count);
...@@ -228,7 +228,7 @@ static uint8_t add_ref_mv_candidate( ...@@ -228,7 +228,7 @@ static uint8_t add_ref_mv_candidate(
} }
static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int mi_row, int mi_col, int block, int mi_row, int mi_col,
const MV_REFERENCE_FRAME rf[2], int row_offset, const MV_REFERENCE_FRAME rf[2], int row_offset,
CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count, CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count,
uint8_t *ref_match_count, uint8_t *ref_match_count,
...@@ -276,7 +276,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -276,7 +276,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_AMVR #if CONFIG_AMVR
newmv_count += add_ref_mv_candidate( newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack, candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block, cm->allow_high_precision_mv, len,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion, gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -286,7 +286,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -286,7 +286,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#else #else
newmv_count += add_ref_mv_candidate( newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack, candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block, cm->allow_high_precision_mv, len,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion, gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -301,7 +301,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -301,7 +301,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
} }
static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int mi_row, int mi_col, int block, int mi_row, int mi_col,
const MV_REFERENCE_FRAME rf[2], int col_offset, const MV_REFERENCE_FRAME rf[2], int col_offset,
CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count, CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count,
uint8_t *ref_match_count, uint8_t *ref_match_count,
...@@ -348,7 +348,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -348,7 +348,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_AMVR #if CONFIG_AMVR
newmv_count += add_ref_mv_candidate( newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack, candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block, cm->allow_high_precision_mv, len,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion, gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -358,7 +358,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -358,7 +358,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#else #else
newmv_count += add_ref_mv_candidate( newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack, candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block, cm->allow_high_precision_mv, len,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion, gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -372,7 +372,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -372,7 +372,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
} }
static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const int mi_row, const int mi_col, int block, const int mi_row, const int mi_col,
const MV_REFERENCE_FRAME rf[2], int row_offset, const MV_REFERENCE_FRAME rf[2], int row_offset,
int col_offset, CANDIDATE_MV *ref_mv_stack, int col_offset, CANDIDATE_MV *ref_mv_stack,
uint8_t *ref_match_count, uint8_t *ref_match_count,
...@@ -397,7 +397,7 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -397,7 +397,7 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_AMVR #if CONFIG_AMVR
newmv_count += add_ref_mv_candidate( newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack, candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block, cm->allow_high_precision_mv, len,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion, gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -407,7 +407,7 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -407,7 +407,7 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#else #else
newmv_count += add_ref_mv_candidate( newmv_count += add_ref_mv_candidate(
candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack, candidate_mi, candidate, rf, refmv_count, ref_match_count, ref_mv_stack,
cm->allow_high_precision_mv, len, block, cm->allow_high_precision_mv, len,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, cm->global_motion, gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -685,8 +685,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -685,8 +685,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates, int_mv *gm_mv_candidates,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
int block, int mi_row, int mi_col, int mi_row, int mi_col, int16_t *mode_context) {
int16_t *mode_context) {
#if CONFIG_TMV #if CONFIG_TMV
const int prev_frame_mvs_stride = ROUND_POWER_OF_TWO(cm->mi_cols, 1); const int prev_frame_mvs_stride = ROUND_POWER_OF_TWO(cm->mi_cols, 1);
const int tmi_row = mi_row & 0xfffe; const int tmi_row = mi_row & 0xfffe;
...@@ -745,24 +744,24 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -745,24 +744,24 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
// Scan the first above row mode info. row_offset = -1; // Scan the first above row mode info. row_offset = -1;
if (abs(max_row_offset) >= 1) if (abs(max_row_offset) >= 1)
newmv_count += scan_row_mbmi(cm, xd, mi_row, mi_col, block, rf, -1, newmv_count += scan_row_mbmi(cm, xd, mi_row, mi_col, rf, -1, ref_mv_stack,
ref_mv_stack, refmv_count, &ref_match_count, refmv_count, &ref_match_count,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, gm_mv_candidates,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
max_row_offset, &processed_rows); max_row_offset, &processed_rows);
// Scan the first left column mode info. col_offset = -1; // Scan the first left column mode info. col_offset = -1;
if (abs(max_col_offset) >= 1) if (abs(max_col_offset) >= 1)
newmv_count += scan_col_mbmi(cm, xd, mi_row, mi_col, block, rf, -1, newmv_count += scan_col_mbmi(cm, xd, mi_row, mi_col, rf, -1, ref_mv_stack,
ref_mv_stack, refmv_count, &ref_match_count, refmv_count, &ref_match_count,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, gm_mv_candidates,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
max_col_offset, &processed_cols); max_col_offset, &processed_cols);
// Check top-right boundary // Check top-right boundary
if (has_tr) if (has_tr)
newmv_count += scan_blk_mbmi(cm, xd, mi_row, mi_col, block, rf, -1, newmv_count += scan_blk_mbmi(cm, xd, mi_row, mi_col, rf, -1, xd->n8_w,
xd->n8_w, ref_mv_stack, &ref_match_count, ref_mv_stack, &ref_match_count,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, gm_mv_candidates,
#endif // USE_CUR_GM_REFMV #endif // USE_CUR_GM_REFMV
...@@ -856,7 +855,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -856,7 +855,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#endif // CONFIG_MFMV #endif // CONFIG_MFMV
// Scan the second outer area. // Scan the second outer area.
scan_blk_mbmi(cm, xd, mi_row, mi_col, block, rf, -1, -1, ref_mv_stack, scan_blk_mbmi(cm, xd, mi_row, mi_col, rf, -1, -1, ref_mv_stack,
&ref_match_count, &ref_match_count,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, gm_mv_candidates,
...@@ -868,7 +867,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -868,7 +867,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
if (abs(row_offset) <= abs(max_row_offset) && if (abs(row_offset) <= abs(max_row_offset) &&
abs(row_offset) > processed_rows) abs(row_offset) > processed_rows)
scan_row_mbmi(cm, xd, mi_row, mi_col, block, rf, row_offset, ref_mv_stack, scan_row_mbmi(cm, xd, mi_row, mi_col, rf, row_offset, ref_mv_stack,
refmv_count, &ref_match_count, refmv_count, &ref_match_count,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, gm_mv_candidates,
...@@ -877,7 +876,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -877,7 +876,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
if (abs(col_offset) <= abs(max_col_offset) && if (abs(col_offset) <= abs(max_col_offset) &&
abs(col_offset) > processed_cols) abs(col_offset) > processed_cols)
scan_col_mbmi(cm, xd, mi_row, mi_col, block, rf, col_offset, ref_mv_stack, scan_col_mbmi(cm, xd, mi_row, mi_col, rf, col_offset, ref_mv_stack,
refmv_count, &ref_match_count, refmv_count, &ref_match_count,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, gm_mv_candidates,
...@@ -888,7 +887,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -888,7 +887,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const int col_offset = -(MVREF_COLS << 1) + 1 + col_adj; const int col_offset = -(MVREF_COLS << 1) + 1 + col_adj;
if (abs(col_offset) <= abs(max_col_offset) && if (abs(col_offset) <= abs(max_col_offset) &&
abs(col_offset) > processed_cols) abs(col_offset) > processed_cols)
scan_col_mbmi(cm, xd, mi_row, mi_col, block, rf, col_offset, ref_mv_stack, scan_col_mbmi(cm, xd, mi_row, mi_col, rf, col_offset, ref_mv_stack,
refmv_count, &ref_match_count, refmv_count, &ref_match_count,
#if USE_CUR_GM_REFMV #if USE_CUR_GM_REFMV
gm_mv_candidates, gm_mv_candidates,
...@@ -994,10 +993,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -994,10 +993,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
// to try and find candidate reference vectors. // to try and find candidate reference vectors.
static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd, static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int block, int mi_row, int_mv *mv_ref_list, int mi_row, int mi_col,
int mi_col, find_mv_refs_sync sync, find_mv_refs_sync sync, void *const data,
void *const data, int16_t *mode_context, int16_t *mode_context, int_mv zeromv) {
int_mv zeromv) {
const int *ref_sign_bias = cm->ref_frame_sign_bias; const int *ref_sign_bias = cm->ref_frame_sign_bias;
const int sb_mi_size = mi_size_wide[cm->sb_size]; const int sb_mi_size = mi_size_wide[cm->sb_size];
int i, refmv_count = 0; int i, refmv_count = 0;
...@@ -1106,10 +1104,10 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -1106,10 +1104,10 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
different_ref_found = 1; different_ref_found = 1;
if (candidate->ref_frame[0] == ref_frame) if (candidate->ref_frame[0] == ref_frame)
ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col, block), ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col),
refmv_count, mv_ref_list, bw, bh, xd, Done); refmv_count, mv_ref_list, bw, bh, xd, Done);
else if (candidate->ref_frame[1] == ref_frame) else if (candidate->ref_frame[1] == ref_frame)
ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col, block), ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col),
refmv_count, mv_ref_list, bw, bh, xd, Done); refmv_count, mv_ref_list, bw, bh, xd, Done);
} }
} }
...@@ -1234,8 +1232,8 @@ Done: ...@@ -1234,8 +1232,8 @@ Done:
// This function keeps a mode count for a given MB/SB // This function keeps a mode count for a given MB/SB
void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd, void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int block, int mi_row, int_mv *mv_ref_list, int mi_row, int mi_col,
int mi_col, int16_t *mode_context) { int16_t *mode_context) {
int i, refmv_count = 0; int i, refmv_count = 0;
int context_counter = 0; int context_counter = 0;
const int bw = block_size_wide[mi->mbmi.sb_type]; const int bw = block_size_wide[mi->mbmi.sb_type];
...@@ -1268,10 +1266,10 @@ void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -1268,10 +1266,10 @@ void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
context_counter += mode_2_counter[candidate->mode]; context_counter += mode_2_counter[candidate->mode];
if (candidate->ref_frame[0] == ref_frame) { if (candidate->ref_frame[0] == ref_frame) {
ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col, block), ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col),
refmv_count, mv_ref_list, bw, bh, xd, Done); refmv_count, mv_ref_list, bw, bh, xd, Done);
} else if (candidate->ref_frame[1] == ref_frame) { } else if (candidate->ref_frame[1] == ref_frame) {
ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col, block), ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col),
refmv_count, mv_ref_list, bw, bh, xd, Done); refmv_count, mv_ref_list, bw, bh, xd, Done);