Commit 7fb93975 authored by Hui Su's avatar Hui Su

Do not fall back to 4x4 VP9 style intra predictors

Always use ext-intra style intra predictors. This is the same behavior
as when intra-edge(adopted) is on.

BUG=aomedia:1399

Change-Id: I404923844e4cc81162fa649fc8b7dc695af63545
parent c89a294a
......@@ -1648,7 +1648,7 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
const uint16_t *above_ref = ref - ref_stride;
const uint16_t *left_ref = ref - 1;
int p_angle = 0;
const int is_dr_mode = av1_is_directional_mode(mode, xd->mi[0]->mbmi.sb_type);
const int is_dr_mode = av1_is_directional_mode(mode);
#if CONFIG_FILTER_INTRA
const int use_filter_intra =
plane > 0 ? 0 : xd->mi[0]->mbmi.filter_intra_mode_info.use_filter_intra;
......@@ -1874,8 +1874,7 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
int need_above = extend_modes[mode] & NEED_ABOVE;
int need_above_left = extend_modes[mode] & NEED_ABOVELEFT;
int p_angle = 0;
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const int is_dr_mode = av1_is_directional_mode(mode, mbmi->sb_type);
const int is_dr_mode = av1_is_directional_mode(mode);
#if CONFIG_FILTER_INTRA
const int use_filter_intra =
plane > 0 ? 0 : xd->mi[0]->mbmi.filter_intra_mode_info.use_filter_intra;
......
......@@ -47,14 +47,8 @@ static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
#define CONFIG_USE_ANGLE_DELTA_SUB8X8 0
static INLINE int av1_is_directional_mode(PREDICTION_MODE mode,
BLOCK_SIZE bsize) {
#if CONFIG_INTRA_EDGE
(void)bsize;
static INLINE int av1_is_directional_mode(PREDICTION_MODE mode) {
return mode >= V_PRED && mode <= D67_PRED;
#else
return mode >= V_PRED && mode <= D67_PRED && bsize >= BLOCK_8X8;
#endif
}
static INLINE int av1_use_angle_delta(BLOCK_SIZE bsize) {
......
......@@ -1057,7 +1057,7 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
const int use_angle_delta = av1_use_angle_delta(bsize);
mbmi->angle_delta[PLANE_TYPE_Y] =
(use_angle_delta && av1_is_directional_mode(mbmi->mode, bsize))
(use_angle_delta && av1_is_directional_mode(mbmi->mode))
? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED])
: 0;
......@@ -1084,8 +1084,7 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
}
#endif // !CONFIG_CFL
mbmi->angle_delta[PLANE_TYPE_UV] =
(use_angle_delta &&
av1_is_directional_mode(get_uv_mode(mbmi->uv_mode), bsize))
(use_angle_delta && av1_is_directional_mode(get_uv_mode(mbmi->uv_mode)))
? read_angle_delta(r,
ec_ctx->angle_delta_cdf[mbmi->uv_mode - V_PRED])
: 0;
......@@ -1377,7 +1376,7 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row,
mbmi->mode = read_intra_mode(r, ec_ctx->y_mode_cdf[size_group_lookup[bsize]]);
mbmi->angle_delta[PLANE_TYPE_Y] =
use_angle_delta && av1_is_directional_mode(mbmi->mode, bsize)
use_angle_delta && av1_is_directional_mode(mbmi->mode)
? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED])
: 0;
#if CONFIG_MONO_VIDEO
......@@ -1403,8 +1402,7 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row,
}
#endif // !CONFIG_CFL
mbmi->angle_delta[PLANE_TYPE_UV] =
use_angle_delta &&
av1_is_directional_mode(get_uv_mode(mbmi->uv_mode), bsize)
use_angle_delta && av1_is_directional_mode(get_uv_mode(mbmi->uv_mode))
? read_angle_delta(r,
ec_ctx->angle_delta_cdf[mbmi->uv_mode - V_PRED])
: 0;
......
......@@ -1184,7 +1184,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
write_intra_mode(ec_ctx, bsize, mode, w);
const int use_angle_delta = av1_use_angle_delta(bsize);
if (use_angle_delta && av1_is_directional_mode(mode, bsize)) {
if (use_angle_delta && av1_is_directional_mode(mode)) {
write_angle_delta(w, mbmi->angle_delta[PLANE_TYPE_Y],
ec_ctx->angle_delta_cdf[mode - V_PRED]);
}
......@@ -1206,8 +1206,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
if (uv_mode == UV_CFL_PRED)
write_cfl_alphas(ec_ctx, mbmi->cfl_alpha_idx, mbmi->cfl_alpha_signs, w);
#endif
if (use_angle_delta &&
av1_is_directional_mode(get_uv_mode(uv_mode), bsize)) {
if (use_angle_delta && av1_is_directional_mode(get_uv_mode(uv_mode))) {
write_angle_delta(w, mbmi->angle_delta[PLANE_TYPE_UV],
ec_ctx->angle_delta_cdf[uv_mode - V_PRED]);
}
......@@ -1516,7 +1515,7 @@ static void write_mb_modes_kf(AV1_COMP *cpi, MACROBLOCKD *xd,
write_intra_mode_kf(ec_ctx, mi, above_mi, left_mi, mode, w);
const int use_angle_delta = av1_use_angle_delta(bsize);
if (use_angle_delta && av1_is_directional_mode(mode, bsize)) {
if (use_angle_delta && av1_is_directional_mode(mode)) {
write_angle_delta(w, mbmi->angle_delta[PLANE_TYPE_Y],
ec_ctx->angle_delta_cdf[mode - V_PRED]);
}
......@@ -1538,8 +1537,7 @@ static void write_mb_modes_kf(AV1_COMP *cpi, MACROBLOCKD *xd,
if (uv_mode == UV_CFL_PRED)
write_cfl_alphas(ec_ctx, mbmi->cfl_alpha_idx, mbmi->cfl_alpha_signs, w);
#endif
if (use_angle_delta &&
av1_is_directional_mode(get_uv_mode(uv_mode), bsize)) {
if (use_angle_delta && av1_is_directional_mode(get_uv_mode(uv_mode))) {
write_angle_delta(w, mbmi->angle_delta[PLANE_TYPE_UV],
ec_ctx->angle_delta_cdf[uv_mode - V_PRED]);
}
......
......@@ -840,8 +840,7 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
}
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA_MOD
if (av1_is_directional_mode(mbmi->mode, bsize) &&
av1_use_angle_delta(bsize)) {
if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) {
#if CONFIG_ENTROPY_STATS
++counts->angle_delta[mbmi->mode - V_PRED]
[mbmi->angle_delta[PLANE_TYPE_Y] + MAX_ANGLE_DELTA];
......@@ -859,7 +858,7 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
xd->plane[AOM_PLANE_U].subsampling_y))
return;
#if CONFIG_EXT_INTRA_MOD
if (av1_is_directional_mode(get_uv_mode(mbmi->uv_mode), bsize) &&
if (av1_is_directional_mode(get_uv_mode(mbmi->uv_mode)) &&
av1_use_angle_delta(bsize)) {
#if CONFIG_ENTROPY_STATS
++counts->angle_delta[mbmi->uv_mode - V_PRED]
......
......@@ -2750,7 +2750,7 @@ static int intra_mode_info_cost_y(const AV1_COMP *cpi, const MACROBLOCK *x,
}
}
#endif // CONFIG_FILTER_INTRA
if (av1_is_directional_mode(mbmi->mode, bsize)) {
if (av1_is_directional_mode(mbmi->mode)) {
if (av1_use_angle_delta(bsize)) {
#if CONFIG_EXT_INTRA_MOD
total_rate += x->angle_delta_cost[mbmi->mode - V_PRED]
......@@ -2806,7 +2806,7 @@ static int intra_mode_info_cost_uv(const AV1_COMP *cpi, const MACROBLOCK *x,
total_rate += palette_mode_cost;
}
}
if (av1_is_directional_mode(get_uv_mode(mode), mbmi->sb_type)) {
if (av1_is_directional_mode(get_uv_mode(mode))) {
if (av1_use_angle_delta(bsize)) {
#if CONFIG_EXT_INTRA_MOD
total_rate +=
......@@ -2870,8 +2870,7 @@ static int64_t intra_model_yrd(const AV1_COMP *const cpi, MACROBLOCK *const x,
// RD estimation.
model_rd_for_sb(cpi, bsize, x, xd, 0, 0, &this_rd_stats.rate,
&this_rd_stats.dist, &this_rd_stats.skip, &temp_sse);
if (av1_is_directional_mode(mbmi->mode, bsize) &&
av1_use_angle_delta(bsize)) {
if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) {
#if CONFIG_EXT_INTRA_MOD
mode_cost +=
x->angle_delta_cost[mbmi->mode - V_PRED]
......@@ -3408,7 +3407,7 @@ static void angle_estimation(const uint8_t *src, int src_stride, int rows,
uint64_t hist_sum = 0;
for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i];
for (i = 0; i < INTRA_MODES; ++i) {
if (av1_is_directional_mode(i, bsize)) {
if (av1_is_directional_mode(i)) {
const uint8_t angle_bin = mode_to_angle_bin[i];
uint64_t score = 2 * hist[angle_bin];
int weight = 2;
......@@ -3463,7 +3462,7 @@ static void highbd_angle_estimation(const uint8_t *src8, int src_stride,
uint64_t hist_sum = 0;
for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i];
for (i = 0; i < INTRA_MODES; ++i) {
if (av1_is_directional_mode(i, bsize)) {
if (av1_is_directional_mode(i)) {
const uint8_t angle_bin = mode_to_angle_bin[i];
uint64_t score = 2 * hist[angle_bin];
int weight = 2;
......@@ -3580,7 +3579,7 @@ static int64_t rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
this_model_rd > best_model_rd + (best_model_rd >> 1))
continue;
if (this_model_rd < best_model_rd) best_model_rd = this_model_rd;
is_directional_mode = av1_is_directional_mode(mbmi->mode, bsize);
is_directional_mode = av1_is_directional_mode(mbmi->mode);
if (is_directional_mode && directional_mode_skip_mask[mbmi->mode]) continue;
if (is_directional_mode && av1_use_angle_delta(bsize)) {
this_rd_stats.rate = INT_MAX;
......@@ -5561,8 +5560,7 @@ static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
int this_rate;
RD_STATS tokenonly_rd_stats;
UV_PREDICTION_MODE mode = uv_rd_search_mode_order[mode_idx];
const int is_directional_mode =
av1_is_directional_mode(get_uv_mode(mode), mbmi->sb_type);
const int is_directional_mode = av1_is_directional_mode(get_uv_mode(mode));
if (!(cpi->sf.intra_uv_mode_mask[txsize_sqr_up_map[max_tx_size]] &
(1 << mode)))
continue;
......@@ -9815,7 +9813,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
if (ref_frame == INTRA_FRAME) {
RD_STATS rd_stats_y;
TX_SIZE uv_tx;
is_directional_mode = av1_is_directional_mode(mbmi->mode, bsize);
is_directional_mode = av1_is_directional_mode(mbmi->mode);
if (is_directional_mode && av1_use_angle_delta(bsize)) {
int rate_dummy;
int64_t model_rd = INT64_MAX;
......
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