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,
if (b == 0 || b == 2) {
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 {
assert(b == 1 || b == 3);
return cur_mi->bmi[b - 1].as_mode;
......@@ -33,7 +33,7 @@ PREDICTION_MODE av1_above_block_mode(const MODE_INFO *cur_mi,
if (b == 0 || b == 1) {
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 {
assert(b == 2 || b == 3);
return cur_mi->bmi[b - 2].as_mode;
......
......@@ -389,11 +389,6 @@ static INLINE int is_intrabc_block(const MB_MODE_INFO *mbmi) {
}
#endif
static INLINE PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) {
(void)block;
return mi->mbmi.mode;
}
#if CONFIG_CFL
static INLINE PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
assert(mode < UV_INTRA_MODES);
......@@ -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,
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) {
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
const int block_size_allowed = 1;
#else
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
const BLOCK_SIZE bsize = mbmi->sb_type;
const int block_size_allowed =
AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
#endif // GLOBAL_SUB8X8_USED
......@@ -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,
const MACROBLOCKD *xd, int block_idx,
const MACROBLOCKD *xd,
TX_SIZE tx_size) {
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,
return DCT_DCT;
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)];
}
......@@ -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,
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 MB_MODE_INFO *const mbmi = &mi->mbmi;
(void)blk_row;
......@@ -1076,8 +1072,7 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type,
#endif // CONFIG_TXK_SEL
#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, block_raster_idx, tx_size);
return get_default_tx_type(plane_type, xd, tx_size);
#endif // FIXED_TX_TYPE
#if CONFIG_DAALA_TX_DST32
......@@ -1102,7 +1097,6 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type,
}
// UV Intra only
(void)block;
TX_TYPE intra_type =
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;
......@@ -1282,14 +1276,14 @@ static INLINE int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
}
static INLINE MOTION_MODE
motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
const MACROBLOCKD *xd, const MODE_INFO *mi) {
motion_mode_allowed(const WarpedMotionParams *gm_params, const MACROBLOCKD *xd,
const MODE_INFO *mi) {
const MB_MODE_INFO *mbmi = &mi->mbmi;
#if CONFIG_AMVR
if (xd->cur_frame_force_integer_mv == 0) {
#endif
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
}
#endif
......@@ -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 MACROBLOCKD *xd,
const MODE_INFO *mi) {
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
if (last_motion_mode_allowed < mode)
......
......@@ -230,7 +230,7 @@ static INLINE void integer_mv_precision(MV *mv) {
// represents an integer)
static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm,
int allow_hp, BLOCK_SIZE bsize,
int mi_col, int mi_row, int block_idx
int mi_col, int mi_row
#if CONFIG_AMVR
,
int is_integer
......@@ -239,7 +239,6 @@ static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm,
int_mv res;
const int32_t *mat = gm->wmmat;
int x, y, tx, ty;
(void)block_idx;
if (gm->wmtype == TRANSLATION) {
// All global motion vectors are stored with WARPEDMODEL_PREC_BITS (16)
......
......@@ -68,7 +68,7 @@ static uint8_t add_ref_mv_candidate(
const MODE_INFO *const candidate_mi, const MB_MODE_INFO *const candidate,
const MV_REFERENCE_FRAME rf[2], uint8_t *refmv_count,
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
int_mv *gm_mv_candidates, const WarpedMotionParams *gm_params,
#endif // USE_CUR_GM_REFMV
......@@ -140,11 +140,11 @@ static uint8_t add_ref_mv_candidate(
} else {
#endif // CONFIG_EXT_WARPED_MOTION
#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];
else
#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
lower_mv_precision(&this_refmv.as_mv, use_hp, is_integer);
#else
......@@ -163,7 +163,7 @@ static uint8_t add_ref_mv_candidate(
if (index == *refmv_count && *refmv_count < MAX_REF_MV_STACK_SIZE) {
ref_mv_stack[index].this_mv = this_refmv;
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;
++(*refmv_count);
......@@ -184,11 +184,11 @@ static uint8_t add_ref_mv_candidate(
for (ref = 0; ref < 2; ++ref) {
#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];
else
#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
lower_mv_precision(&this_refmv[ref].as_mv, use_hp, is_integer);
#else
......@@ -208,9 +208,9 @@ static uint8_t add_ref_mv_candidate(
ref_mv_stack[index].this_mv = this_refmv[0];
ref_mv_stack[index].comp_mv = this_refmv[1];
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(
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;
++(*refmv_count);
......@@ -228,7 +228,7 @@ static uint8_t add_ref_mv_candidate(
}
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,
CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count,
uint8_t *ref_match_count,
......@@ -276,7 +276,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_AMVR
newmv_count += add_ref_mv_candidate(
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
gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV
......@@ -286,7 +286,7 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#else
newmv_count += add_ref_mv_candidate(
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
gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV
......@@ -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,
int mi_row, int mi_col, int block,
int mi_row, int mi_col,
const MV_REFERENCE_FRAME rf[2], int col_offset,
CANDIDATE_MV *ref_mv_stack, uint8_t *refmv_count,
uint8_t *ref_match_count,
......@@ -348,7 +348,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_AMVR
newmv_count += add_ref_mv_candidate(
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
gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV
......@@ -358,7 +358,7 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#else
newmv_count += add_ref_mv_candidate(
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
gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV
......@@ -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,
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,
int col_offset, CANDIDATE_MV *ref_mv_stack,
uint8_t *ref_match_count,
......@@ -397,7 +397,7 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_AMVR
newmv_count += add_ref_mv_candidate(
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
gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV
......@@ -407,7 +407,7 @@ static uint8_t scan_blk_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#else
newmv_count += add_ref_mv_candidate(
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
gm_mv_candidates, cm->global_motion,
#endif // USE_CUR_GM_REFMV
......@@ -685,8 +685,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if USE_CUR_GM_REFMV
int_mv *gm_mv_candidates,
#endif // USE_CUR_GM_REFMV
int block, int mi_row, int mi_col,
int16_t *mode_context) {
int mi_row, int mi_col, int16_t *mode_context) {
#if CONFIG_TMV
const int prev_frame_mvs_stride = ROUND_POWER_OF_TWO(cm->mi_cols, 1);
const int tmi_row = mi_row & 0xfffe;
......@@ -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;
if (abs(max_row_offset) >= 1)
newmv_count += scan_row_mbmi(cm, xd, mi_row, mi_col, block, rf, -1,
ref_mv_stack, refmv_count, &ref_match_count,
newmv_count += scan_row_mbmi(cm, xd, mi_row, mi_col, rf, -1, ref_mv_stack,
refmv_count, &ref_match_count,
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // USE_CUR_GM_REFMV
max_row_offset, &processed_rows);
// Scan the first left column mode info. col_offset = -1;
if (abs(max_col_offset) >= 1)
newmv_count += scan_col_mbmi(cm, xd, mi_row, mi_col, block, rf, -1,
ref_mv_stack, refmv_count, &ref_match_count,
newmv_count += scan_col_mbmi(cm, xd, mi_row, mi_col, rf, -1, ref_mv_stack,
refmv_count, &ref_match_count,
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // USE_CUR_GM_REFMV
max_col_offset, &processed_cols);
// Check top-right boundary
if (has_tr)
newmv_count += scan_blk_mbmi(cm, xd, mi_row, mi_col, block, rf, -1,
xd->n8_w, ref_mv_stack, &ref_match_count,
newmv_count += scan_blk_mbmi(cm, xd, mi_row, mi_col, rf, -1, xd->n8_w,
ref_mv_stack, &ref_match_count,
#if USE_CUR_GM_REFMV
gm_mv_candidates,
#endif // USE_CUR_GM_REFMV
......@@ -856,7 +855,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#endif // CONFIG_MFMV
// 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,
#if USE_CUR_GM_REFMV
gm_mv_candidates,
......@@ -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) &&
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,
#if USE_CUR_GM_REFMV
gm_mv_candidates,
......@@ -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) &&
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,
#if USE_CUR_GM_REFMV
gm_mv_candidates,
......@@ -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;
if (abs(col_offset) <= abs(max_col_offset) &&
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,
#if USE_CUR_GM_REFMV
gm_mv_candidates,
......@@ -994,10 +993,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
// to try and find candidate reference vectors.
static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int block, int mi_row,
int mi_col, find_mv_refs_sync sync,
void *const data, int16_t *mode_context,
int_mv zeromv) {
int_mv *mv_ref_list, int mi_row, int mi_col,
find_mv_refs_sync sync, void *const data,
int16_t *mode_context, int_mv zeromv) {
const int *ref_sign_bias = cm->ref_frame_sign_bias;
const int sb_mi_size = mi_size_wide[cm->sb_size];
int i, refmv_count = 0;
......@@ -1106,10 +1104,10 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
different_ref_found = 1;
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);
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);
}
}
......@@ -1234,8 +1232,8 @@ Done:
// This function keeps a mode count for a given MB/SB
void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int block, int mi_row,
int mi_col, int16_t *mode_context) {
int_mv *mv_ref_list, int mi_row, int mi_col,
int16_t *mode_context) {
int i, refmv_count = 0;
int context_counter = 0;
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,
context_counter += mode_2_counter[candidate->mode];
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);
} 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);
}
}
......@@ -1294,24 +1292,24 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int idx, all_zero = 1;
MV_REFERENCE_FRAME rf[2];
av1_update_mv_context(cm, xd, mi, ref_frame, mv_ref_list, -1, mi_row, mi_col,
av1_update_mv_context(cm, xd, mi, ref_frame, mv_ref_list, mi_row, mi_col,
compound_mode_context);
if (!CONFIG_INTRABC || ref_frame != INTRA_FRAME) {
av1_set_ref_frame(rf, ref_frame);
zeromv[0].as_int = gm_get_motion_vector(&cm->global_motion[rf[0]],
cm->allow_high_precision_mv, bsize,
mi_col, mi_row, 0
zeromv[0].as_int =
gm_get_motion_vector(&cm->global_motion[rf[0]],
cm->allow_high_precision_mv, bsize, mi_col, mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
,
cm->cur_frame_force_integer_mv
#endif
)
.as_int;
)
.as_int;
zeromv[1].as_int = (rf[1] != NONE_FRAME)
? gm_get_motion_vector(&cm->global_motion[rf[1]],
cm->allow_high_precision_mv,
bsize, mi_col, mi_row, 0
bsize, mi_col, mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
......@@ -1324,14 +1322,14 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
if (ref_frame <= ALTREF_FRAME)
find_mv_refs_idx(cm, xd, mi, ref_frame, mv_ref_list, -1, mi_row, mi_col,
sync, data, mode_context, zeromv[0]);
find_mv_refs_idx(cm, xd, mi, ref_frame, mv_ref_list, mi_row, mi_col, sync,
data, mode_context, zeromv[0]);
setup_ref_mv_list(cm, xd, ref_frame, ref_mv_count, ref_mv_stack, mv_ref_list,
#if USE_CUR_GM_REFMV
zeromv,
#endif // USE_CUR_GM_REFMV
-1, mi_row, mi_col, mode_context);
mi_row, mi_col, mode_context);
/* Note: If global motion is enabled, then we want to set the ALL_ZERO flag
iff all of the MVs we could generate with NEARMV/NEARESTMV are equivalent
to the global motion vector.
......
......@@ -132,17 +132,14 @@ static INLINE void clamp_mv_ref(MV *mv, int bw, int bh, const MACROBLOCKD *xd) {
// This function returns either the appropriate sub block or block's mv
// on whether the block_size < 8x8 and we have check_sub_blocks set.
static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate, int which_mv,
int search_col, int block_idx) {
int search_col) {
(void)search_col;
(void)block_idx;
return candidate->mbmi.mv[which_mv];
}
static INLINE int_mv get_sub_block_pred_mv(const MODE_INFO *candidate,
int which_mv, int search_col,
int block_idx) {
int which_mv, int search_col) {
(void)search_col;
(void)block_idx;
return candidate->mbmi.mv[which_mv];
}
......@@ -448,8 +445,8 @@ void av1_find_best_ref_mvs(int allow_hp, int_mv *mvlist, int_mv *nearest_mv,
// This function keeps a mode count for a given MB/SB
void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int block, int mi_row,
int mi_col, int16_t *mode_context);
int_mv *mv_ref_list, int mi_row, int mi_col,
int16_t *mode_context);
#if CONFIG_EXT_WARPED_MOTION
int sortSamples(int *pts_mv, MV *mv, int *pts, int *pts_inref, int len);
......
......@@ -73,7 +73,7 @@ static INLINE void av1_make_inter_predictor(
(void)xd;
// Make sure the selected motion mode is valid for this configuration
assert_motion_mode_valid(mi->mbmi.motion_mode, 0, xd->global_motion, xd, mi);
assert_motion_mode_valid(mi->mbmi.motion_mode, xd->global_motion, xd, mi);
WarpedMotionParams final_warp_params;
const int do_warp =
......@@ -950,9 +950,9 @@ void av1_jnt_comp_weight_assign(const AV1_COMMON *cm, const MB_MODE_INFO *mbmi,
static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
int plane, const MODE_INFO *mi,
int build_for_obmc, int block, int bw,
int bh, int x, int y, int w, int h,
int mi_x, int mi_y) {
int build_for_obmc, int bw, int bh,
int x, int y, int w, int h, int mi_x,
int mi_y) {
struct macroblockd_plane *const pd = &xd->plane[plane];
int is_compound = has_second_ref(&mi->mbmi);
int ref;
......@@ -964,10 +964,9 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
for (ref = 0; ref < 1 + is_compound; ++ref) {
const WarpedMotionParams *const wm =
&xd->global_motion[mi->mbmi.ref_frame[ref]];
is_global[ref] = is_global_mv_block(mi, block, wm->wmtype);
is_global[ref] = is_global_mv_block(mi, wm->wmtype);
}
(void)block;
(void)cm;
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
......@@ -1301,7 +1300,7 @@ static void build_inter_predictors_for_planes(const AV1_COMMON *cm,
pd->subsampling_y))
continue;
build_inter_predictors(cm, xd, plane, xd->mi[0], 0, 0, bw, bh, 0, 0, bw, bh,
build_inter_predictors(cm, xd, plane, xd->mi[0], 0, bw, bh, 0, 0, bw, bh,
mi_x, mi_y);
}
}
......@@ -1658,8 +1657,8 @@ static INLINE void build_prediction_by_above_pred(MACROBLOCKD *xd,
block_size_high[BLOCK_64X64] >> (pd->subsampling_y + 1));
if (skip_u4x4_pred_in_obmc(bsize, pd, 0)) continue;
build_inter_predictors(ctxt->cm, xd, j, above_mi, 1, 0, bw, bh, 0, 0, bw,
bh, mi_x, mi_y);
build_inter_predictors(ctxt->cm, xd, j, above_mi, 1, bw, bh, 0, 0, bw, bh,
mi_x, mi_y);
}
*above_mbmi = backup_mbmi;
}
......@@ -1745,7 +1744,7 @@ static INLINE void build_prediction_by_left_pred(MACROBLOCKD *xd,
int bh = (left_mi_height << MI_SIZE_LOG2) >> pd->subsampling_y;
if (skip_u4x4_pred_in_obmc(bsize, pd, 1)) continue;
build_inter_predictors(ctxt->cm, xd, j, left_mi, 1, 0, bw, bh, 0, 0, bw, bh,
build_inter_predictors(ctxt->cm, xd, j, left_mi, 1, bw, bh, 0, 0, bw, bh,
mi_x, mi_y);
}
*left_mbmi = backup_mbmi;
......@@ -2139,7 +2138,7 @@ static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane,
WarpTypesAllowed warp_types;
const WarpedMotionParams *const wm =
&xd->global_motion[mi->mbmi.ref_frame[ref]];
warp_types.global_warp_allowed = is_global_mv_block(mi, block, wm->wmtype);
warp_types.global_warp_allowed = is_global_mv_block(mi, wm->wmtype);
warp_types.local_warp_allowed = mi->mbmi.motion_mode == WARPED_CAUSAL;
if (is_scaled) {
......
......@@ -2759,19 +2759,16 @@ static void predict_intra_block_helper(const AV1_COMMON *cm,
}
void av1_predict_intra_block_facade(const AV1_COMMON *cm, MACROBLOCKD *xd,
int plane, int block_idx, int blk_col,
int blk_row, TX_SIZE tx_size) {
int plane, int blk_col, int blk_row,
TX_SIZE tx_size) {
const MODE_INFO *mi = xd->mi[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi;
struct macroblockd_plane *const pd = &xd->plane[plane];
const int dst_stride = pd->dst.stride;
uint8_t *dst =
&pd->dst.buf[(blk_row * dst_stride + blk_col) << tx_size_wide_log2[0]];
const int block_raster_idx =
av1_block_index_to_raster_order(tx_size, block_idx);
const PREDICTION_MODE mode = (plane == AOM_PLANE_Y)
? get_y_mode(mi, block_raster_idx)
: get_uv_mode(mbmi->uv_mode);
const PREDICTION_MODE mode =
(plane == AOM_PLANE_Y) ? mbmi->mode : get_uv_mode(mbmi->uv_mode);
av1_predict_intra_block(cm, xd, pd->width, pd->height,
txsize_to_bsize[tx_size], mode, dst, dst_stride, dst,
......
......@@ -22,8 +22,8 @@ extern "C" {
void av1_init_intra_predictors(void);
void av1_predict_intra_block_facade(const AV1_COMMON *cm, MACROBLOCKD *xd,
int plane, int block_idx, int blk_col,
int blk_row, TX_SIZE tx_size);
int plane, int blk_col, int blk_row,
TX_SIZE tx_size);
void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int bw, int bh, BLOCK_SIZE bsize,
PREDICTION_MODE mode, const uint8_t *ref,
......
......@@ -157,23 +157,11 @@ static void inverse_transform_block(MACROBLOCKD *xd, int plane,
memset(dqcoeff, 0, (scan_line + 1) * sizeof(dqcoeff[0]));
}
static int get_block_idx(const MACROBLOCKD *xd, int plane, int row, int col) {
const int bsize = xd->mi[0]->mbmi.sb_type;
const struct macroblockd_plane *pd = &xd->plane[