Commit 0c628e64 authored by hui su's avatar hui su Committed by Hui Su
Browse files

Make alt-intra work with ext-intra

Change-Id: I2a814ba878a57c6b73f8f9e29bea6c7edfe7c789
parent e166e25f
......@@ -12,6 +12,9 @@
#include "av1/common/common.h"
#include "av1/common/pred_common.h"
#include "av1/common/reconinter.h"
#if CONFIG_EXT_INTRA
#include "av1/common/reconintra.h"
#endif // CONFIG_EXT_INTRA
#include "av1/common/seg_common.h"
// Returns a context number for the given MB prediction signal
......@@ -112,7 +115,7 @@ static INTRA_FILTER get_ref_intra_filter(const MB_MODE_INFO *ref_mbmi) {
default: break;
}
} else {
if (mode != DC_PRED && mode != TM_PRED) {
if (av1_is_directional_mode(mode, ref_mbmi->sb_type)) {
int p_angle =
mode_to_angle_map[mode] + ref_mbmi->angle_delta[0] * ANGLE_STEP;
if (av1_is_intra_filter_switchable(p_angle)) {
......
......@@ -1251,8 +1251,7 @@ static void build_intra_predictors_high(
const uint16_t *above_ref = ref - ref_stride;
#if CONFIG_EXT_INTRA
int p_angle = 0;
const int is_dr_mode = mode != DC_PRED && mode != TM_PRED &&
xd->mi[0]->mbmi.sb_type >= BLOCK_8X8;
const int is_dr_mode = av1_is_directional_mode(mode, xd->mi[0]->mbmi.sb_type);
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
const FILTER_INTRA_MODE_INFO *filter_intra_mode_info =
......@@ -1411,8 +1410,7 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
int need_above_left = extend_modes[mode] & NEED_ABOVELEFT;
#if CONFIG_EXT_INTRA
int p_angle = 0;
const int is_dr_mode = mode != DC_PRED && mode != TM_PRED &&
xd->mi[0]->mbmi.sb_type >= BLOCK_8X8;
const int is_dr_mode = av1_is_directional_mode(mode, xd->mi[0]->mbmi.sb_type);
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
const FILTER_INTRA_MODE_INFO *filter_intra_mode_info =
......@@ -1531,8 +1529,7 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
}
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
if (mode != DC_PRED && mode != TM_PRED &&
xd->mi[0]->mbmi.sb_type >= BLOCK_8X8) {
if (is_dr_mode) {
INTRA_FILTER filter = INTRA_FILTER_LINEAR;
if (plane == 0 && av1_is_intra_filter_switchable(p_angle))
filter = xd->mi[0]->mbmi.intra_filter;
......
......@@ -48,4 +48,15 @@ static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
extern int av1_filter_intra_taps_4[TX_SIZES][INTRA_MODES][4];
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
static INLINE int av1_is_directional_mode(PREDICTION_MODE mode,
BLOCK_SIZE bsize) {
return mode != DC_PRED && mode != TM_PRED &&
#if CONFIG_ALT_INTRA
mode != SMOOTH_PRED &&
#endif // CONFIG_ALT_INTRA
bsize >= BLOCK_8X8;
}
#endif // CONFIG_EXT_INTRA
#endif // AV1_COMMON_RECONINTRA_H_
......@@ -4079,11 +4079,11 @@ static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
mbmi->uv_mode = mode;
#if CONFIG_EXT_INTRA
is_directional_mode = (mode != DC_PRED && mode != TM_PRED);
is_directional_mode = av1_is_directional_mode(mode, mbmi->sb_type);
rate_overhead = cpi->intra_uv_mode_cost[mbmi->mode][mode] +
write_uniform_cost(2 * MAX_ANGLE_DELTAS + 1, 0);
mbmi->angle_delta[1] = 0;
if (mbmi->sb_type >= BLOCK_8X8 && is_directional_mode) {
if (is_directional_mode) {
if (!rd_pick_intra_angle_sbuv(
cpi, x, &this_rate, &tokenonly_rd_stats.rate,
&tokenonly_rd_stats.dist, &tokenonly_rd_stats.skip, bsize,
......@@ -4099,7 +4099,7 @@ static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
}
this_rate =
tokenonly_rd_stats.rate + cpi->intra_uv_mode_cost[mbmi->mode][mode];
if (mbmi->sb_type >= BLOCK_8X8 && is_directional_mode)
if (is_directional_mode)
this_rate += write_uniform_cost(2 * MAX_ANGLE_DELTAS + 1,
MAX_ANGLE_DELTAS + mbmi->angle_delta[1]);
#else
......
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