Commit 130cccba authored by Alex Converse's avatar Alex Converse Committed by hui su

Rename pick_filter_intra.

The word 'pick' is usually used in functions that make decisions where
the bitstream allows multiple legal choices, and not to limit the
bitstream format itself.

Change-Id: Ia60709c29e004475e1aa8861aefded27ebaf4712
parent 9dfe45a8
......@@ -216,7 +216,7 @@ const int16_t dr_intra_derivative[270][2] = {
// Returns whether filter selection is needed for a given
// intra prediction angle.
int pick_intra_filter(int angle) {
int vp10_is_intra_filter_switchable(int angle) {
assert(angle > 0 && angle < 270);
if (angle % 45 == 0)
return 0;
......
......@@ -524,7 +524,7 @@ static const TX_TYPE filter_intra_mode_to_tx_type_lookup[FILTER_INTRA_MODES] = {
ADST_ADST, // FILTER_TM
};
int pick_intra_filter(int angle);
int vp10_is_intra_filter_switchable(int angle);
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_TILE
......
......@@ -64,7 +64,7 @@ static INTRA_FILTER get_ref_intra_filter(const MB_MODE_INFO *ref_mbmi) {
if (mode != DC_PRED && mode != TM_PRED) {
int p_angle = mode_to_angle_map[mode] +
ref_mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle)) {
if (vp10_is_intra_filter_switchable(p_angle)) {
ref_type = ref_mbmi->intra_filter;
}
}
......
......@@ -1290,7 +1290,7 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
if (mode != DC_PRED && mode != TM_PRED &&
xd->mi[0]->mbmi.sb_type >= BLOCK_8X8) {
INTRA_FILTER filter = INTRA_FILTER_LINEAR;
if (plane == 0 && pick_intra_filter(p_angle))
if (plane == 0 && vp10_is_intra_filter_switchable(p_angle))
filter = xd->mi[0]->mbmi.intra_filter;
highbd_dr_predictor(dst, dst_stride, bs, const_above_row, left_col,
p_angle, xd->bd, filter);
......@@ -1450,7 +1450,7 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
if (mode != DC_PRED && mode != TM_PRED &&
xd->mi[0]->mbmi.sb_type >= BLOCK_8X8) {
INTRA_FILTER filter = INTRA_FILTER_LINEAR;
if (plane == 0 && pick_intra_filter(p_angle))
if (plane == 0 && vp10_is_intra_filter_switchable(p_angle))
filter = xd->mi[0]->mbmi.intra_filter;
dr_predictor(dst, dst_stride, tx_size, const_above_row, left_col, p_angle,
filter);
......
......@@ -26,7 +26,7 @@ void vp10_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, int bhl_in,
uint8_t *dst, int dst_stride,
int aoff, int loff, int plane);
#if CONFIG_EXT_INTRA
int pick_intra_filter(int angle);
int vp10_is_intra_filter_switchable(int angle);
#endif // CONFIG_EXT_INTRA
#ifdef __cplusplus
} // extern "C"
......
......@@ -580,7 +580,7 @@ static void read_intra_frame_mode_info(VP10_COMMON *const cm,
read_uniform(r, 2 * MAX_ANGLE_DELTAS + 1) - MAX_ANGLE_DELTAS;
p_angle = mode_to_angle_map[mbmi->mode] +
mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle)) {
if (vp10_is_intra_filter_switchable(p_angle)) {
FRAME_COUNTS *counts = xd->counts;
mbmi->intra_filter = vp10_read_tree(r, vp10_intra_filter_tree,
cm->fc->intra_filter_probs[ctx]);
......@@ -922,7 +922,7 @@ static void read_intra_block_mode_info(VP10_COMMON *const cm,
read_uniform(r, 2 * MAX_ANGLE_DELTAS + 1) - MAX_ANGLE_DELTAS;
p_angle =
mode_to_angle_map[mbmi->mode] + mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle)) {
if (vp10_is_intra_filter_switchable(p_angle)) {
FRAME_COUNTS *counts = xd->counts;
const int ctx = vp10_get_pred_context_intra_interp(xd);
mbmi->intra_filter = vp10_read_tree(r, vp10_intra_filter_tree,
......
......@@ -1076,7 +1076,7 @@ static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi,
write_uniform(w, 2 * MAX_ANGLE_DELTAS + 1,
MAX_ANGLE_DELTAS + mbmi->angle_delta[0]);
p_angle = mode_to_angle_map[mode] + mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle)) {
if (vp10_is_intra_filter_switchable(p_angle)) {
const int ctx = vp10_get_pred_context_intra_interp(xd);
vp10_write_token(w, vp10_intra_filter_tree,
cm->fc->intra_filter_probs[ctx],
......@@ -1439,7 +1439,7 @@ static void write_mb_modes_kf(const VP10_COMMON *cm, const MACROBLOCKD *xd,
MAX_ANGLE_DELTAS + mbmi->angle_delta[0]);
p_angle =
mode_to_angle_map[mbmi->mode] + mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle)) {
if (vp10_is_intra_filter_switchable(p_angle)) {
vp10_write_token(w, vp10_intra_filter_tree,
cm->fc->intra_filter_probs[intra_filter_ctx],
&intra_filter_encodings[mbmi->intra_filter]);
......
......@@ -4858,7 +4858,7 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td,
const int intra_filter_ctx = vp10_get_pred_context_intra_interp(xd);
p_angle = mode_to_angle_map[mbmi->mode] +
mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle))
if (vp10_is_intra_filter_switchable(p_angle))
++counts->intra_filter[intra_filter_ctx][mbmi->intra_filter];
}
}
......
......@@ -2422,7 +2422,7 @@ static int64_t rd_pick_intra_angle_sby(VP10_COMP *cpi, MACROBLOCK *x,
mbmi->angle_delta[0] * ANGLE_STEP;
for (filter = INTRA_FILTER_LINEAR; filter < INTRA_FILTERS; ++filter) {
int64_t tmp_best_rd;
if ((FILTER_FAST_SEARCH || !pick_intra_filter(p_angle)) &&
if ((FILTER_FAST_SEARCH || !vp10_is_intra_filter_switchable(p_angle)) &&
filter != INTRA_FILTER_LINEAR)
continue;
mic->mbmi.intra_filter = filter;
......@@ -2464,8 +2464,8 @@ static int64_t rd_pick_intra_angle_sby(VP10_COMP *cpi, MACROBLOCK *x,
mbmi->angle_delta[0] * ANGLE_STEP;
for (filter = INTRA_FILTER_LINEAR; filter < INTRA_FILTERS; ++filter) {
mic->mbmi.intra_filter = filter;
if ((FILTER_FAST_SEARCH || !pick_intra_filter(p_angle)) &&
filter != INTRA_FILTER_LINEAR)
if ((FILTER_FAST_SEARCH || !vp10_is_intra_filter_switchable(p_angle))
&& filter != INTRA_FILTER_LINEAR)
continue;
pick_intra_angle_routine_sby(cpi, x, rate, rate_tokenonly,
distortion, skippable,
......@@ -2486,7 +2486,7 @@ static int64_t rd_pick_intra_angle_sby(VP10_COMP *cpi, MACROBLOCK *x,
mbmi->angle_delta[0] * ANGLE_STEP;
for (filter = INTRA_FILTER_LINEAR; filter < INTRA_FILTERS; ++filter) {
mic->mbmi.intra_filter = filter;
if ((FILTER_FAST_SEARCH || !pick_intra_filter(p_angle)) &&
if ((FILTER_FAST_SEARCH || !vp10_is_intra_filter_switchable(p_angle)) &&
filter != INTRA_FILTER_LINEAR)
continue;
pick_intra_angle_routine_sby(cpi, x, rate, rate_tokenonly,
......@@ -2505,7 +2505,7 @@ static int64_t rd_pick_intra_angle_sby(VP10_COMP *cpi, MACROBLOCK *x,
mbmi->angle_delta[0] = best_angle_delta;
p_angle = mode_to_angle_map[mbmi->mode] +
mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle)) {
if (vp10_is_intra_filter_switchable(p_angle)) {
for (filter = INTRA_FILTER_LINEAR + 1; filter < INTRA_FILTERS; ++filter) {
mic->mbmi.intra_filter = filter;
pick_intra_angle_routine_sby(cpi, x, rate, rate_tokenonly,
......@@ -2778,7 +2778,7 @@ static int64_t rd_pick_intra_sby_mode(VP10_COMP *cpi, MACROBLOCK *x,
mic->mbmi.angle_delta[0]);
p_angle = mode_to_angle_map[mic->mbmi.mode] +
mic->mbmi.angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle))
if (vp10_is_intra_filter_switchable(p_angle))
this_rate +=
cpi->intra_filter_cost[intra_filter_ctx][mic->mbmi.intra_filter];
}
......@@ -8333,7 +8333,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
mbmi->angle_delta[0]);
p_angle = mode_to_angle_map[mbmi->mode] +
mbmi->angle_delta[0] * ANGLE_STEP;
if (pick_intra_filter(p_angle))
if (vp10_is_intra_filter_switchable(p_angle))
rate2 += cpi->intra_filter_cost[intra_filter_ctx][mbmi->intra_filter];
}
......
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