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

[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)
......
This diff is collapsed.
......@@ -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[plane];
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
const uint8_t txh_unit = tx_size_high_unit[tx_size];
return row * max_blocks_wide + col * txh_unit;
}
static void predict_and_reconstruct_intra_block(
AV1_COMMON *cm, MACROBLOCKD *const xd, aom_reader *const r,
MB_MODE_INFO *const mbmi, int plane, int row, int col, TX_SIZE tx_size) {
PLANE_TYPE plane_type = get_plane_type(plane);
const int block_idx = get_block_idx(xd, plane, row, col);
av1_predict_intra_block_facade(cm, xd, plane, block_idx, col, row, tx_size);
av1_predict_intra_block_facade(cm, xd, plane, col, row, tx_size);
if (!mbmi->skip) {
struct macroblockd_plane *const pd = &xd->plane[plane];
......@@ -184,14 +172,12 @@ static void predict_and_reconstruct_intra_block(
#if CONFIG_LV_MAP
int16_t max_scan_line = 0;
int eob;
av1_read_coeffs_txb_facade(cm, xd, r, row, col, block_idx, plane, tx_size,
av1_read_coeffs_txb_facade(cm, xd, r, row, col, plane, tx_size,
&max_scan_line, &eob);
// tx_type will be read out in av1_read_coeffs_txb_facade
const TX_TYPE tx_type =
av1_get_tx_type(plane_type, xd, row, col, block_idx, tx_size);
const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, tx_size);
#else // CONFIG_LV_MAP
const TX_TYPE tx_type =
av1_get_tx_type(plane_type, xd, row, col, block_idx, tx_size);
const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, tx_size);
const SCAN_ORDER *scan_order = get_scan(cm, tx_size, tx_type, mbmi);
int16_t max_scan_line = 0;
const int eob =
......@@ -253,14 +239,14 @@ static void decode_reconstruct_tx(AV1_COMMON *cm, MACROBLOCKD *const xd,
#if CONFIG_LV_MAP
int16_t max_scan_line = 0;
int eob;
av1_read_coeffs_txb_facade(cm, xd, r, blk_row, blk_col, block, plane,
tx_size, &max_scan_line, &eob);
av1_read_coeffs_txb_facade(cm, xd, r, blk_row, blk_col, plane, tx_size,
&max_scan_line, &eob);
// tx_type will be read out in av1_read_coeffs_txb_facade
const TX_TYPE tx_type =
av1_get_tx_type(plane_type, xd, blk_row, blk_col, block, tx_size);
av1_get_tx_type(plane_type, xd, blk_row, blk_col, tx_size);
#else // CONFIG_LV_MAP
const TX_TYPE tx_type =
av1_get_tx_type(plane_type, xd, blk_row, blk_col, block, tx_size);
av1_get_tx_type(plane_type, xd, blk_row, blk_col, tx_size);
const SCAN_ORDER *sc = get_scan(cm, tx_size, tx_type, mbmi);
int16_t max_scan_line = 0;
const int eob =
......
......@@ -295,7 +295,7 @@ static MOTION_MODE read_motion_mode(MACROBLOCKD *xd, MODE_INFO *mi,
#endif // CONFIG_EXT_SKIP
const MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(0, xd->global_motion, xd, mi);
motion_mode_allowed(xd->global_motion, xd, mi);
int motion_mode;
FRAME_COUNTS *counts = xd->counts;
......@@ -942,8 +942,7 @@ static void read_intra_angle_info(MACROBLOCKD *const xd, aom_reader *r) {
void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#if CONFIG_TXK_SEL
int blk_row, int blk_col, int block, int plane,
TX_SIZE tx_size,
int blk_row, int blk_col, int plane, TX_SIZE tx_size,
#endif
aom_reader *r) {
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
......@@ -962,7 +961,6 @@ void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#else
// only y plane's tx_type is transmitted
if (plane > 0) return;
(void)block;
TX_TYPE *tx_type = &mbmi->txk_type[(blk_row << MAX_MIB_SIZE_LOG2) + blk_col];
#endif
......@@ -1608,17 +1606,15 @@ static INLINE int is_mv_valid(const MV *mv) {
static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
PREDICTION_MODE mode,
MV_REFERENCE_FRAME ref_frame[2], int block,
int_mv mv[2], int_mv ref_mv[2],
int_mv nearest_mv[2], int_mv near_mv[2], int mi_row,
int mi_col, int is_compound, int allow_hp,
aom_reader *r) {
MV_REFERENCE_FRAME ref_frame[2], int_mv mv[2],
int_mv ref_mv[2], int_mv nearest_mv[2],
int_mv near_mv[2], int mi_row, int mi_col,
int is_compound, int allow_hp, aom_reader *r) {
int ret = 1;
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
int_mv *pred_mv = mbmi->pred_mv;
(void)block;
(void)ref_frame;
(void)cm;
(void)mi_row;
......@@ -1663,7 +1659,7 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
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
mi_col, mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
......@@ -1673,7 +1669,7 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
if (is_compound)
mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]],
cm->allow_high_precision_mv, bsize,
mi_col, mi_row, block
mi_col, mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
......@@ -1759,7 +1755,7 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
assert(is_compound);
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
mi_col, mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
......@@ -1768,7 +1764,7 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
.as_int;
mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]],
cm->allow_high_precision_mv, bsize,
mi_col, mi_row, block
mi_col, mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
......@@ -1905,7 +1901,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
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
bsize, mi_col, mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
......@@ -1916,7 +1912,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
(rf[1] != NONE_FRAME)
? gm_get_motion_vector(&cm->global_motion[rf[1]],
cm->allow_high_precision_mv, bsize, mi_col,
mi_row, 0
mi_row
#if CONFIG_AMVR
,
cm->cur_frame_force_integer_mv
......@@ -2117,7 +2113,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
} else {
#endif // CONFIG_EXT_SKIP
int mv_corrupted_flag =
!assign_mv(cm, xd, mbmi->mode, mbmi->ref_frame, 0, mbmi->mv, ref_mv,
!assign_mv(cm, xd, mbmi->mode, mbmi->ref_frame, mbmi->mv, ref_mv,
nearestmv, nearmv, mi_row, mi_col, is_compound, allow_hp, r);
aom_merge_corrupted_flag(&xd->corrupted, mv_corrupted_flag);
#if CONFIG_EXT_SKIP
......
......@@ -31,8 +31,7 @@ void av1_read_mode_info(AV1Decoder *const pbi, MACROBLOCKD *xd,
void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#if CONFIG_TXK_SEL
int blk_row, int blk_col, int block, int plane,
TX_SIZE tx_size,
int blk_row, int blk_col, int plane, TX_SIZE tx_size,
#endif
aom_reader *r);
......
......@@ -55,7 +55,7 @@ static INLINE int rec_eob_pos(const int eob_token, const int extra) {
uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
aom_reader *const r, const int blk_row,
const int blk_col, const int block, const int plane,
const int blk_col, const int plane,
const TXB_CTX *const txb_ctx, const TX_SIZE tx_size,
int16_t *const max_scan_line, int *const eob) {
FRAME_CONTEXT *const ec_ctx = xd->tile_ctx;
......@@ -107,11 +107,11 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
(void)blk_row;
(void)blk_col;
#if CONFIG_TXK_SEL
av1_read_tx_type(cm, xd, blk_row, blk_col, block, plane,
get_min_tx_size(tx_size), r);
av1_read_tx_type(cm, xd, blk_row, blk_col, plane, get_min_tx_size(tx_size),
r);
#endif
const TX_TYPE tx_type =
av1_get_tx_type(plane_type, xd, blk_row, blk_col, block, tx_size);
av1_get_tx_type(plane_type, xd, blk_row, blk_col, tx_size);
const SCAN_ORDER *const scan_order = get_scan(cm, tx_size, tx_type, mbmi);
const int16_t *const scan = scan_order->scan;
int dummy;
......@@ -370,10 +370,12 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
return cul_level;
}
uint8_t av1_read_coeffs_txb_facade(
const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r,
const int row, const int col, const int block, const int plane,
const TX_SIZE tx_size, int16_t *const max_scan_line, int *const eob) {
uint8_t av1_read_coeffs_txb_facade(const AV1_COMMON *const cm,
MACROBLOCKD *const xd, aom_reader *const r,
const int row, const int col,
const int plane, const TX_SIZE tx_size,
int16_t *const max_scan_line,
int *const eob) {
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
struct macroblockd_plane *const pd = &xd->plane[plane];
......@@ -384,11 +386,11 @@ uint8_t av1_read_coeffs_txb_facade(
TXB_CTX txb_ctx;
get_txb_ctx(plane_bsize, tx_size, plane, pd->above_context + col,
pd->left_context + row, &txb_ctx);
uint8_t cul_level = av1_read_coeffs_txb(
cm, xd, r, row, col, block, plane, &txb_ctx, tx_size, max_scan_line, eob);
uint8_t cul_level = av1_read_coeffs_txb(cm, xd, r, row, col, plane, &txb_ctx,
tx_size, max_scan_line, eob);
#if CONFIG_ADAPT_SCAN
PLANE_TYPE plane_type = get_plane_type(plane);
TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, block, tx_size);
TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, tx_size);
const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
if (xd->counts && *eob > 0)
......
......@@ -20,12 +20,14 @@
uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
aom_reader *const r, const int blk_row,
const int blk_col, const int block, const int plane,
const int blk_col, const int plane,
const TXB_CTX *const txb_ctx, const TX_SIZE tx_size,
int16_t *const max_scan_line, int *const eob);
uint8_t av1_read_coeffs_txb_facade(
const AV1_COMMON *const cm, MACROBLOCKD *const xd, aom_reader *const r,
const int row, const int col, const int block, const int plane,
const TX_SIZE tx_size, int16_t *const max_scan_line, int *const eob);
uint8_t av1_read_coeffs_txb_facade(const AV1_COMMON *const cm,
MACROBLOCKD *const xd, aom_reader *const r,
const int row, const int col,
const int plane, const TX_SIZE tx_size,
int16_t *const max_scan_line,
int *const eob);
#endif // DECODETXB_H_
......@@ -315,7 +315,7 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
const MB_MODE_INFO *mbmi = &mi->mbmi;
MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed(0, cm->global_motion, xd, mi);
motion_mode_allowed(cm->global_motion, xd, mi);
switch (last_motion_mode_allowed) {
case SIMPLE_TRANSLATION: break;
case OBMC_CAUSAL:
......@@ -524,8 +524,8 @@ static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x,
uint16_t eob = x->mbmi_ext->eobs[plane][block];
TXB_CTX txb_ctx = { x->mbmi_ext->txb_skip_ctx[plane][block],
x->mbmi_ext->dc_sign_ctx[plane][block] };
av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, block, plane, tx_size,
tcoeff, eob, &txb_ctx);
av1_write_coeffs_txb(cm, xd, w, blk_row, blk_col, plane, tx_size, tcoeff,
eob, &txb_ctx);
#if CONFIG_RD_DEBUG
token_stats->txb_coeff_cost_map[blk_row][blk_col] = tmp_token_stats.cost;
token_stats->cost += tmp_token_stats.cost;
......@@ -1096,8 +1096,7 @@ static void write_palette_mode_info(const AV1_COMMON *cm, const MACROBLOCKD *xd,
void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
#if CONFIG_TXK_SEL
int blk_row, int blk_col, int block, int plane,
TX_SIZE tx_size,
int blk_row, int blk_col, int plane, TX_SIZE tx_size,
#endif
aom_writer *w) {
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
......@@ -1117,8 +1116,7 @@ void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
// Only y plane's tx_type is transmitted
if (plane > 0) return;
PLANE_TYPE plane_type = get_plane_type(plane);
TX_TYPE tx_type =
av1_get_tx_type(plane_type, xd, blk_row, blk_col, block, tx_size);
TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col, tx_size);
#endif
if (!FIXED_TX_TYPE) {
......
......@@ -41,8 +41,7 @@ static INLINE int av1_preserve_existing_gf(AV1_COMP *cpi) {
void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
#if CONFIG_TXK_SEL
int blk_row, int blk_col, int block, int plane,
TX_SIZE tx_size,
int blk_row, int blk_col, int plane, TX_SIZE tx_size,
#endif
aom_writer *w);
......
......@@ -1044,7 +1044,7 @@ static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data,
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
const MOTION_MODE motion_allowed =
motion_mode_allowed(0, xd->global_motion, xd, mi);
motion_mode_allowed(xd->global_motion, xd, mi);
if (mbmi->ref_frame[1] != INTRA_FRAME) {
if (motion_allowed == WARPED_CAUSAL) {
#if CONFIG_EXT_WARPED_MOTION
......@@ -4582,7 +4582,7 @@ static void tx_partition_set_contexts(const AV1_COMMON *const cm,
void av1_update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_TXK_SEL
int blk_row, int blk_col, int block, int plane,
int blk_row, int blk_col, int plane,
#endif
BLOCK_SIZE bsize, TX_SIZE tx_size,
FRAME_COUNTS *counts, uint8_t allow_update_cdf) {
......@@ -4601,7 +4601,7 @@ void av1_update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd,
// Only y plane's tx_type is updated
if (plane > 0) return;
TX_TYPE tx_type =
av1_get_tx_type(PLANE_TYPE_Y, xd, blk_row, blk_col, block, tx_size);
av1_get_tx_type(PLANE_TYPE_Y, xd, blk_row, blk_col, tx_size);
#endif
if (get_ext_tx_types(tx_size, bsize, is_inter, cm->reduced_tx_set_used) > 1 &&
cm->base_qindex > 0 && !mbmi->skip &&
......@@ -4696,11 +4696,11 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data,
for (int plane = 0; plane < AOMMIN(2, num_planes); ++plane) {
if (mbmi->palette_mode_info.palette_size[plane] > 0) {
if (!dry_run)
av1_tokenize_color_map(x, plane, 0, t, bsize, mbmi->tx_size,