Commit 1b5e9871 authored by Yunqing Wang's avatar Yunqing Wang
Browse files

Code refactoring: use defined inline functions

Changed to use defined inline functions consistently through
the code.

Change-Id: I7644d24fa7a837378564a6e0790416d3725dd200
parent 8a7cc1f4
...@@ -1827,7 +1827,7 @@ static void auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile, ...@@ -1827,7 +1827,7 @@ static void auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
int bh, bw; int bh, bw;
BLOCK_SIZE min_size = BLOCK_32X32; BLOCK_SIZE min_size = BLOCK_32X32;
BLOCK_SIZE max_size = BLOCK_8X8; BLOCK_SIZE max_size = BLOCK_8X8;
int bsl = mi_width_log2_lookup[BLOCK_64X64]; int bsl = mi_width_log2(BLOCK_64X64);
const int search_range_ctrl = (((mi_row + mi_col) >> bsl) + const int search_range_ctrl = (((mi_row + mi_col) >> bsl) +
get_chessboard_index(cm)) % 2; get_chessboard_index(cm)) % 2;
// Trap case where we do not have a prediction. // Trap case where we do not have a prediction.
...@@ -1976,8 +1976,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile, ...@@ -1976,8 +1976,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
pc_tree->partitioning = PARTITION_NONE; pc_tree->partitioning = PARTITION_NONE;
// Adjust threshold according to partition size. // Adjust threshold according to partition size.
stop_thresh >>= 8 - (b_width_log2_lookup[bsize] + stop_thresh >>= 8 - (b_width_log2(bsize) +
b_height_log2_lookup[bsize]); b_height_log2(bsize));
stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh); stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh);
// If obtained distortion is very small, choose current partition // If obtained distortion is very small, choose current partition
...@@ -2548,8 +2548,8 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile, ...@@ -2548,8 +2548,8 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
pc_tree->partitioning = PARTITION_NONE; pc_tree->partitioning = PARTITION_NONE;
// Adjust threshold according to partition size. // Adjust threshold according to partition size.
stop_thresh >>= 8 - (b_width_log2_lookup[bsize] + stop_thresh >>= 8 - (b_width_log2(bsize) +
b_height_log2_lookup[bsize]); b_height_log2(bsize));
stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh); stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh);
// If obtained distortion is very small, choose current partition // If obtained distortion is very small, choose current partition
......
...@@ -287,7 +287,7 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -287,7 +287,7 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
// Adjust ac threshold according to partition size. // Adjust ac threshold according to partition size.
thresh_ac >>= thresh_ac >>=
8 - (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]); 8 - (b_width_log2(bsize) + b_height_log2(bsize));
thresh_dc = (xd->plane[0].dequant[0] * xd->plane[0].dequant[0] >> 6); thresh_dc = (xd->plane[0].dequant[0] * xd->plane[0].dequant[0] >> 6);
} else { } else {
...@@ -387,7 +387,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -387,7 +387,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
// Mode index conversion form THR_MODES to PREDICTION_MODE for a ref frame. // Mode index conversion form THR_MODES to PREDICTION_MODE for a ref frame.
int mode_idx[MB_MODE_COUNT] = {0}; int mode_idx[MB_MODE_COUNT] = {0};
INTERP_FILTER filter_ref = cm->interp_filter; INTERP_FILTER filter_ref = cm->interp_filter;
int bsl = mi_width_log2_lookup[bsize]; int bsl = mi_width_log2(bsize);
const int pred_filter_search = cm->interp_filter == SWITCHABLE ? const int pred_filter_search = cm->interp_filter == SWITCHABLE ?
(((mi_row + mi_col) >> bsl) + get_chessboard_index(cm)) % 2 : 0; (((mi_row + mi_col) >> bsl) + get_chessboard_index(cm)) % 2 : 0;
int const_motion[MAX_REF_FRAMES] = { 0 }; int const_motion[MAX_REF_FRAMES] = { 0 };
......
...@@ -1793,8 +1793,8 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -1793,8 +1793,8 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
} }
if (cpi->sf.adaptive_motion_search) { if (cpi->sf.adaptive_motion_search) {
int bwl = b_width_log2_lookup[bsize]; int bwl = b_width_log2(bsize);
int bhl = b_height_log2_lookup[bsize]; int bhl = b_height_log2(bsize);
int i; int i;
int tlevel = x->pred_mv_sad[ref] >> (bwl + bhl + 4); int tlevel = x->pred_mv_sad[ref] >> (bwl + bhl + 4);
...@@ -2266,8 +2266,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2266,8 +2266,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
thresh_ac = clamp(thresh_ac, min_thresh, max_thresh); thresh_ac = clamp(thresh_ac, min_thresh, max_thresh);
// Adjust threshold according to partition size. // Adjust threshold according to partition size.
thresh_ac >>= 8 - (b_width_log2_lookup[bsize] + thresh_ac >>= 8 - (b_width_log2(bsize) +
b_height_log2_lookup[bsize]); b_height_log2(bsize));
thresh_dc = (xd->plane[0].dequant[0] * xd->plane[0].dequant[0] >> 6); thresh_dc = (xd->plane[0].dequant[0] * xd->plane[0].dequant[0] >> 6);
} else { } else {
thresh_ac = 0; thresh_ac = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment