[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
diff --git a/av1/common/blockd.c b/av1/common/blockd.c index 9d2fdbd..73d6329 100644 --- a/av1/common/blockd.c +++ b/av1/common/blockd.c
@@ -21,7 +21,7 @@ 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 @@ 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;
diff --git a/av1/common/blockd.h b/av1/common/blockd.h index c055c98..3b4336b 100644 --- a/av1/common/blockd.h +++ b/av1/common/blockd.h
@@ -389,11 +389,6 @@ } #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_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 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 @@ 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 @@ 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 @@ #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 @@ } // 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 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 @@ } } -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)
diff --git a/av1/common/mv.h b/av1/common/mv.h index 212d9fe..bd05fdc 100644 --- a/av1/common/mv.h +++ b/av1/common/mv.h
@@ -230,7 +230,7 @@ // 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 @@ 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)
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c index 2f911c5..3b12eac 100644 --- a/av1/common/mvref_common.c +++ b/av1/common/mvref_common.c
@@ -68,7 +68,7 @@ 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 @@ } 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 @@ 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 @@ 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 @@ 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 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 @@ #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 @@ #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_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 @@ #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 @@ #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_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 @@ #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 @@ #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 @@ #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 @@ // 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 @@ #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 @@ 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 @@ 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 @@ 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 @@ // 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 @@ 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 @@ // 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 @@ 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 @@ 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 @@ } 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.
diff --git a/av1/common/mvref_common.h b/av1/common/mvref_common.h index 4fed25a..b965078 100644 --- a/av1/common/mvref_common.h +++ b/av1/common/mvref_common.h
@@ -132,17 +132,14 @@ // 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 @@ // 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);
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c index c3737ef..392553f 100644 --- a/av1/common/reconinter.c +++ b/av1/common/reconinter.c
@@ -73,7 +73,7 @@ (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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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) {
diff --git a/av1/common/reconintra.c b/av1/common/reconintra.c index a4ee580..976fee4 100644 --- a/av1/common/reconintra.c +++ b/av1/common/reconintra.c
@@ -2759,19 +2759,16 @@ } 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,
diff --git a/av1/common/reconintra.h b/av1/common/reconintra.h index bad3b97..b755223 100644 --- a/av1/common/reconintra.h +++ b/av1/common/reconintra.h
@@ -22,8 +22,8 @@ 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,
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 928b309..ac6272e 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c
@@ -157,23 +157,11 @@ 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 @@ #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 @@ #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 =
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c index 0928fc0..68f91aa 100644 --- a/av1/decoder/decodemv.c +++ b/av1/decoder/decodemv.c
@@ -295,7 +295,7 @@ #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 @@ 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 @@ #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 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 @@ 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 @@ 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 @@ 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 @@ .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 @@ 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 @@ (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 @@ } 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
diff --git a/av1/decoder/decodemv.h b/av1/decoder/decodemv.h index a4d383d..23d571d 100644 --- a/av1/decoder/decodemv.h +++ b/av1/decoder/decodemv.h
@@ -31,8 +31,7 @@ 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);
diff --git a/av1/decoder/decodetxb.c b/av1/decoder/decodetxb.c index 2dbc55e..0bdcca1 100644 --- a/av1/decoder/decodetxb.c +++ b/av1/decoder/decodetxb.c
@@ -55,7 +55,7 @@ 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 @@ (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 @@ 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 @@ 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)
diff --git a/av1/decoder/decodetxb.h b/av1/decoder/decodetxb.h index ecb400d..fb0b19f 100644 --- a/av1/decoder/decodetxb.h +++ b/av1/decoder/decodetxb.h
@@ -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_
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index 4350163..d9e0990 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c
@@ -315,7 +315,7 @@ 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 @@ 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 @@ 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 @@ // 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) {
diff --git a/av1/encoder/bitstream.h b/av1/encoder/bitstream.h index 69e0500..97cfd14 100644 --- a/av1/encoder/bitstream.h +++ b/av1/encoder/bitstream.h
@@ -41,8 +41,7 @@ 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);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c index f1d516e..86e93b8 100644 --- a/av1/encoder/encodeframe.c +++ b/av1/encoder/encodeframe.c
@@ -1044,7 +1044,7 @@ 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 @@ 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 @@ // 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 @@ 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, + av1_tokenize_color_map(x, plane, t, bsize, mbmi->tx_size, PALETTE_MAP); else if (dry_run == DRY_RUN_COSTCOEFFS) - rate += av1_cost_color_map(x, plane, 0, bsize, mbmi->tx_size, - PALETTE_MAP); + rate += + av1_cost_color_map(x, plane, bsize, mbmi->tx_size, PALETTE_MAP); } } }
diff --git a/av1/encoder/encodeframe.h b/av1/encoder/encodeframe.h index 745940d..38a2fbb 100644 --- a/av1/encoder/encodeframe.h +++ b/av1/encoder/encodeframe.h
@@ -37,7 +37,7 @@ void av1_update_tx_type_count(const struct AV1Common *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);
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c index 65bc6be..bc26cfc 100644 --- a/av1/encoder/encodemb.c +++ b/av1/encoder/encodemb.c
@@ -146,7 +146,7 @@ const int16_t *const dequant_ptr = p->dequant_QTX; const uint8_t *const band_translate = get_band_translate(tx_size); 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, &xd->mi[0]->mbmi); const int16_t *const scan = scan_order->scan; @@ -492,8 +492,7 @@ struct macroblockd_plane *const pd = &xd->plane[plane]; #endif 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); #if CONFIG_NEW_QUANT const int is_inter = is_inter_block(mbmi); @@ -657,7 +656,7 @@ { TX_TYPE tx_type = - av1_get_tx_type(pd->plane_type, xd, blk_row, blk_col, block, tx_size); + av1_get_tx_type(pd->plane_type, xd, blk_row, blk_col, tx_size); av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst, pd->dst.stride, p->eobs[block], cm->reduced_tx_set_used); @@ -931,14 +930,13 @@ tran_low_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); PLANE_TYPE plane_type = get_plane_type(plane); 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); uint16_t *eob = &p->eobs[block]; const int dst_stride = pd->dst.stride; uint8_t *dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << tx_size_wide_log2[0]]; - av1_predict_intra_block_facade(cm, xd, plane, block, blk_col, blk_row, - tx_size); + av1_predict_intra_block_facade(cm, xd, plane, blk_col, blk_row, tx_size); av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size);
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c index 6ea782a..19f2b48 100644 --- a/av1/encoder/encodetxb.c +++ b/av1/encoder/encodetxb.c
@@ -315,14 +315,14 @@ } void av1_write_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd, - aom_writer *w, int blk_row, int blk_col, int block, - int plane, TX_SIZE tx_size, const tran_low_t *tcoeff, + aom_writer *w, int blk_row, int blk_col, int plane, + TX_SIZE tx_size, const tran_low_t *tcoeff, uint16_t eob, TXB_CTX *txb_ctx) { MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; const PLANE_TYPE plane_type = get_plane_type(plane); const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); 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; const int seg_eob = av1_get_max_eob(tx_size); @@ -350,8 +350,8 @@ av1_txb_init_levels(tcoeff, width, height, levels); #if CONFIG_TXK_SEL - av1_write_tx_type(cm, xd, blk_row, blk_col, block, plane, - get_min_tx_size(tx_size), w); + av1_write_tx_type(cm, xd, blk_row, blk_col, plane, get_min_tx_size(tx_size), + w); #endif int eob_extra, dummy; @@ -549,8 +549,8 @@ 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); } void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, @@ -593,7 +593,7 @@ TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); const PLANE_TYPE plane_type = get_plane_type(plane); 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); MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; const struct macroblock_plane *p = &x->plane[plane]; const int eob = p->eobs[block]; @@ -1996,7 +1996,7 @@ const PLANE_TYPE plane_type = get_plane_type(plane); const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size); 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 MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; const struct macroblock_plane *p = &x->plane[plane]; struct macroblockd_plane *pd = &xd->plane[plane]; @@ -2073,7 +2073,7 @@ const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); const PLANE_TYPE plane_type = pd->plane_type; 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); (void)plane_bsize; @@ -2099,7 +2099,7 @@ tran_low_t *tcoeff = BLOCK_OFFSET(x->mbmi_ext->tcoeff[plane], block); const int segment_id = mbmi->segment_id; 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; const int seg_eob = av1_get_tx_eob(&cpi->common.seg, segment_id, tx_size); @@ -2136,8 +2136,8 @@ av1_txb_init_levels(tcoeff, width, height, levels); #if CONFIG_TXK_SEL - av1_update_tx_type_count(cm, xd, blk_row, blk_col, block, plane, - mbmi->sb_type, get_min_tx_size(tx_size), td->counts, + av1_update_tx_type_count(cm, xd, blk_row, blk_col, plane, mbmi->sb_type, + get_min_tx_size(tx_size), td->counts, allow_update_cdf); #endif @@ -2362,8 +2362,8 @@ for (tx_type = txk_start; tx_type <= txk_end; ++tx_type) { if (plane == 0) mbmi->txk_type[(blk_row << MAX_MIB_SIZE_LOG2) + blk_col] = tx_type; - TX_TYPE ref_tx_type = av1_get_tx_type(get_plane_type(plane), xd, blk_row, - blk_col, block, tx_size); + TX_TYPE ref_tx_type = + av1_get_tx_type(get_plane_type(plane), xd, blk_row, blk_col, tx_size); if (tx_type != ref_tx_type) { // use av1_get_tx_type() to check if the tx_type is valid for the current // mode if it's not, we skip it here.
diff --git a/av1/encoder/encodetxb.h b/av1/encoder/encodetxb.h index 2db05d6..8fee349 100644 --- a/av1/encoder/encodetxb.h +++ b/av1/encoder/encodetxb.h
@@ -74,8 +74,8 @@ int blk_row, int blk_col, int block, TX_SIZE tx_size, TXB_CTX *txb_ctx); void av1_write_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd, - aom_writer *w, int blk_row, int blk_col, int block, - int plane, TX_SIZE tx_size, const tran_low_t *tcoeff, + aom_writer *w, int blk_row, int blk_col, int plane, + TX_SIZE tx_size, const tran_low_t *tcoeff, uint16_t eob, TXB_CTX *txb_ctx); void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x, aom_writer *w, int plane, BLOCK_SIZE bsize);
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index 6ba22b0..e2bed3d 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c
@@ -1877,7 +1877,7 @@ const PLANE_TYPE plane_type = get_plane_type(plane); const TX_SIZE tx_size = av1_get_tx_size(plane, xd); 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 int dst_stride = pd->dst.stride; uint8_t *dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << tx_size_wide_log2[0]]; @@ -1995,7 +1995,7 @@ const 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); + av1_get_tx_type(plane_type, xd, blk_row, blk_col, tx_size); av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, recon, MAX_TX_SIZE, eob, cpi->common.reduced_tx_set_used); @@ -2071,8 +2071,7 @@ if (args->exit_early) return; if (!is_inter_block(mbmi)) { - av1_predict_intra_block_facade(cm, xd, plane, block, blk_col, blk_row, - tx_size); + av1_predict_intra_block_facade(cm, xd, plane, blk_col, blk_row, tx_size); av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size); } @@ -2149,7 +2148,7 @@ #endif // CONFIG_CFL const PLANE_TYPE plane_type = get_plane_type(plane); 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 *scan_order = get_scan(cm, tx_size, tx_type, mbmi); this_rd_stats.rate = @@ -2438,13 +2437,12 @@ const int is_inter = is_inter_block(mbmi); if (mbmi->ref_mv_idx > 0 && tx_type != DCT_DCT) return 1; - if (FIXED_TX_TYPE && tx_type != get_default_tx_type(0, xd, 0, tx_size)) - return 1; + if (FIXED_TX_TYPE && tx_type != get_default_tx_type(0, xd, tx_size)) return 1; if (!is_inter && x->use_default_intra_tx_type && - tx_type != get_default_tx_type(0, xd, 0, tx_size)) + tx_type != get_default_tx_type(0, xd, tx_size)) return 1; if (is_inter && x->use_default_inter_tx_type && - tx_type != get_default_tx_type(0, xd, 0, tx_size)) + tx_type != get_default_tx_type(0, xd, tx_size)) return 1; const AV1_COMMON *const cm = &cpi->common; const TxSetType tx_set_type = @@ -2509,7 +2507,7 @@ RD_STATS this_rd_stats; if (is_inter) { if (x->use_default_inter_tx_type && - tx_type != get_default_tx_type(0, xd, 0, mbmi->tx_size)) + tx_type != get_default_tx_type(0, xd, mbmi->tx_size)) continue; if (cpi->sf.tx_type_search.prune_mode > NO_PRUNE) { if (!do_tx_type_search(tx_type, prune, @@ -2518,7 +2516,7 @@ } } else { if (x->use_default_intra_tx_type && - tx_type != get_default_tx_type(0, xd, 0, mbmi->tx_size)) + tx_type != get_default_tx_type(0, xd, mbmi->tx_size)) continue; if (!ALLOW_INTRA_EXT_TX && bs >= BLOCK_8X8) { if (tx_type != intra_mode_to_tx_type_context[mbmi->mode]) continue; @@ -2719,12 +2717,9 @@ const int max_blocks_high = max_block_high(xd, bsize, 0); mbmi->tx_size = tx_size; // Prediction. - const int step = stepr * stepc; - int block = 0; for (row = 0; row < max_blocks_high; row += stepr) { for (col = 0; col < max_blocks_wide; col += stepc) { - av1_predict_intra_block_facade(cm, xd, 0, block, col, row, tx_size); - block += step; + av1_predict_intra_block_facade(cm, xd, 0, col, row, tx_size); } } // RD estimation. @@ -2862,7 +2857,7 @@ #endif // CONFIG_PALETTE_DELTA_ENCODING cpi->common.bit_depth); palette_mode_cost += - av1_cost_color_map(x, 0, 0, bsize, mbmi->tx_size, PALETTE_MAP); + av1_cost_color_map(x, 0, bsize, mbmi->tx_size, PALETTE_MAP); int64_t this_model_rd = intra_model_yrd(cpi, x, bsize, palette_mode_cost); if (*best_model_rd != INT64_MAX && this_model_rd > *best_model_rd + (*best_model_rd >> 1)) @@ -3637,8 +3632,7 @@ int64_t tmp; tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); 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); const SCAN_ORDER *const scan_order = get_scan(cm, tx_size, tx_type, &xd->mi[0]->mbmi); BLOCK_SIZE txm_bsize = txsize_to_bsize[tx_size]; @@ -4942,7 +4936,7 @@ } */ if (is_inter && x->use_default_inter_tx_type && - tx_type != get_default_tx_type(0, xd, 0, max_tx_size)) + tx_type != get_default_tx_type(0, xd, max_tx_size)) continue; if (xd->lossless[mbmi->segment_id]) @@ -5300,8 +5294,7 @@ color_cache, n_cache, #endif // CONFIG_PALETTE_DELTA_ENCODING cpi->common.bit_depth); - this_rate += - av1_cost_color_map(x, 1, 0, bsize, mbmi->tx_size, PALETTE_MAP); + this_rate += av1_cost_color_map(x, 1, bsize, mbmi->tx_size, PALETTE_MAP); this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist); if (this_rd < *best_rd) { *best_rd = this_rd; @@ -5787,7 +5780,7 @@ zeromv[cur_frm].as_int = gm_get_motion_vector(&cpi->common.global_motion[ref_frames[cur_frm]], cpi->common.allow_high_precision_mv, bsize, - mi_col, mi_row, block + mi_col, mi_row #if CONFIG_AMVR , cpi->common.cur_frame_force_integer_mv @@ -5877,7 +5870,7 @@ for (ref = 0; ref < 2; ++ref) { const WarpedMotionParams *const wm = &xd->global_motion[xd->mi[0]->mbmi.ref_frame[ref]]; - is_global[ref] = is_global_mv_block(xd->mi[0], block, wm->wmtype); + is_global[ref] = is_global_mv_block(xd->mi[0], wm->wmtype); } // Do joint motion search in compound mode to get more accurate mv. @@ -6571,7 +6564,7 @@ const int p_col = ((mi_col * MI_SIZE) >> pd->subsampling_x) + 4 * ic; const int p_row = ((mi_row * MI_SIZE) >> pd->subsampling_y) + 4 * ir; const WarpedMotionParams *const wm = &xd->global_motion[other_ref]; - int is_global = is_global_mv_block(xd->mi[0], block, wm->wmtype); + int is_global = is_global_mv_block(xd->mi[0], wm->wmtype); // This function should only ever be called for compound modes assert(has_second_ref(mbmi)); @@ -7668,7 +7661,7 @@ const MV_REFERENCE_FRAME ref = mbmi->ref_frame[0]; zeromv.as_int = gm_get_motion_vector(&cm->global_motion[ref], cm->allow_high_precision_mv, bsize, - mi_col, mi_row, 0 + mi_col, mi_row #if CONFIG_AMVR , cm->cur_frame_force_integer_mv @@ -7754,7 +7747,7 @@ #endif // CONFIG_EXT_WARPED_MOTION best_bmc_mbmi->num_proj_ref[0] = mbmi->num_proj_ref[0]; rate2_nocoeff = rd_stats->rate; - last_motion_mode_allowed = motion_mode_allowed(0, xd->global_motion, xd, mi); + last_motion_mode_allowed = motion_mode_allowed(xd->global_motion, xd, mi); base_mbmi = *mbmi; int64_t best_rd = INT64_MAX; @@ -9364,8 +9357,7 @@ frame_mv[NEWMV][ref_frame].as_int = INVALID_MV; frame_mv[GLOBALMV][ref_frame].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame], - cm->allow_high_precision_mv, bsize, mi_col, mi_row, - 0 + cm->allow_high_precision_mv, bsize, mi_col, mi_row #if CONFIG_AMVR , cm->cur_frame_force_integer_mv @@ -9375,8 +9367,7 @@ frame_mv[NEW_NEWMV][ref_frame].as_int = INVALID_MV; frame_mv[GLOBAL_GLOBALMV][ref_frame].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame], - cm->allow_high_precision_mv, bsize, mi_col, mi_row, - 0 + cm->allow_high_precision_mv, bsize, mi_col, mi_row #if CONFIG_AMVR , cm->cur_frame_force_integer_mv @@ -9469,7 +9460,7 @@ mode_skip_mask[ALTREF_FRAME] = ~INTER_NEAREST_NEAR_ZERO; zeromv.as_int = gm_get_motion_vector(&cm->global_motion[ALTREF_FRAME], cm->allow_high_precision_mv, bsize, - mi_col, mi_row, 0 + mi_col, mi_row #if CONFIG_AMVR , cm->cur_frame_force_integer_mv @@ -10709,19 +10700,19 @@ int comp_pred_mode = refs[1] > INTRA_FRAME; int_mv zeromv[2]; const uint8_t rf_type = av1_ref_frame_type(best_mbmode.ref_frame); - zeromv[0].as_int = gm_get_motion_vector(&cm->global_motion[refs[0]], - cm->allow_high_precision_mv, bsize, - mi_col, mi_row, 0 + zeromv[0].as_int = + gm_get_motion_vector(&cm->global_motion[refs[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 = comp_pred_mode ? gm_get_motion_vector(&cm->global_motion[refs[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 @@ -10817,7 +10808,7 @@ const MV_REFERENCE_FRAME ref = best_mbmode.ref_frame[0]; zeromv.as_int = gm_get_motion_vector(&cm->global_motion[ref], cm->allow_high_precision_mv, bsize, - mi_col, mi_row, 0 + mi_col, mi_row #if CONFIG_AMVR , cm->cur_frame_force_integer_mv @@ -10860,7 +10851,7 @@ if (mbmi->mode == GLOBALMV || mbmi->mode == GLOBAL_GLOBALMV) { // Correct the motion mode for GLOBALMV const MOTION_MODE last_motion_mode_allowed = - motion_mode_allowed(0, xd->global_motion, xd, xd->mi[0]); + motion_mode_allowed(xd->global_motion, xd, xd->mi[0]); if (mbmi->motion_mode > last_motion_mode_allowed) mbmi->motion_mode = last_motion_mode_allowed; @@ -10953,7 +10944,7 @@ mbmi->ref_frame[1] = NONE_FRAME; mbmi->mv[0].as_int = gm_get_motion_vector(&cm->global_motion[mbmi->ref_frame[0]], - cm->allow_high_precision_mv, bsize, mi_col, mi_row, 0 + cm->allow_high_precision_mv, bsize, mi_col, mi_row #if CONFIG_AMVR , cm->cur_frame_force_integer_mv
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c index 38e78f3..d2acee8 100644 --- a/av1/encoder/tokenize.c +++ b/av1/encoder/tokenize.c
@@ -259,8 +259,7 @@ struct macroblock_plane *p = &x->plane[plane]; struct macroblockd_plane *pd = &xd->plane[plane]; const PLANE_TYPE type = pd->plane_type; - const TX_TYPE tx_type = - av1_get_tx_type(type, xd, blk_row, blk_col, block, tx_size); + const TX_TYPE tx_type = av1_get_tx_type(type, xd, blk_row, blk_col, tx_size); const SCAN_ORDER *const scan_order = get_scan(cm, tx_size, tx_type, mbmi); const int rate = av1_cost_coeffs( cpi, x, plane, blk_row, blk_col, block, tx_size, scan_order, @@ -366,10 +365,9 @@ } static void get_color_map_params(const MACROBLOCK *const x, int plane, - int block, BLOCK_SIZE bsize, TX_SIZE tx_size, + BLOCK_SIZE bsize, TX_SIZE tx_size, COLOR_MAP_TYPE type, Av1ColorMapParam *params) { - (void)block; (void)tx_size; memset(params, 0, sizeof(*params)); switch (type) { @@ -378,22 +376,20 @@ } } -int av1_cost_color_map(const MACROBLOCK *const x, int plane, int block, - BLOCK_SIZE bsize, TX_SIZE tx_size, COLOR_MAP_TYPE type) { +int av1_cost_color_map(const MACROBLOCK *const x, int plane, BLOCK_SIZE bsize, + TX_SIZE tx_size, COLOR_MAP_TYPE type) { assert(plane == 0 || plane == 1); Av1ColorMapParam color_map_params; - get_color_map_params(x, plane, block, bsize, tx_size, type, - &color_map_params); + get_color_map_params(x, plane, bsize, tx_size, type, &color_map_params); return cost_and_tokenize_map(&color_map_params, NULL, 1); } -void av1_tokenize_color_map(const MACROBLOCK *const x, int plane, int block, +void av1_tokenize_color_map(const MACROBLOCK *const x, int plane, TOKENEXTRA **t, BLOCK_SIZE bsize, TX_SIZE tx_size, COLOR_MAP_TYPE type) { assert(plane == 0 || plane == 1); Av1ColorMapParam color_map_params; - get_color_map_params(x, plane, block, bsize, tx_size, type, - &color_map_params); + get_color_map_params(x, plane, bsize, tx_size, type, &color_map_params); // The first color index does not use context or entropy. (*t)->token = color_map_params.color_map[0]; (*t)->color_map_cdf = NULL; @@ -423,8 +419,7 @@ const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); const int segment_id = mbmi->segment_id; const int16_t *scan, *nb; - const TX_TYPE tx_type = - av1_get_tx_type(type, xd, blk_row, blk_col, block, tx_size); + const TX_TYPE tx_type = av1_get_tx_type(type, xd, blk_row, blk_col, tx_size); const SCAN_ORDER *const scan_order = get_scan(cm, tx_size, tx_type, mbmi); const int ref = is_inter_block(mbmi); FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
diff --git a/av1/encoder/tokenize.h b/av1/encoder/tokenize.h index 5f388d9..8a5c97c 100644 --- a/av1/encoder/tokenize.h +++ b/av1/encoder/tokenize.h
@@ -76,10 +76,10 @@ int mi_col, BLOCK_SIZE bsize, int *rate, uint8_t allow_update_cdf); -int av1_cost_color_map(const MACROBLOCK *const x, int plane, int block, - BLOCK_SIZE bsize, TX_SIZE tx_size, COLOR_MAP_TYPE type); +int av1_cost_color_map(const MACROBLOCK *const x, int plane, BLOCK_SIZE bsize, + TX_SIZE tx_size, COLOR_MAP_TYPE type); -void av1_tokenize_color_map(const MACROBLOCK *const x, int plane, int block, +void av1_tokenize_color_map(const MACROBLOCK *const x, int plane, TOKENEXTRA **t, BLOCK_SIZE bsize, TX_SIZE tx_size, COLOR_MAP_TYPE type);