Commit 5db9743f authored by hui su's avatar hui su

Seperate FILTER_INTRA from EXT_INTRA experiment

Prepare for the av1/nextgenv2 merge.

Coding gain (%):

               lowres     midres
ext-intra       0.69       0.97
filter-intra    0.67       0.83
both            1.05       1.48

Change-Id: Ia24d6fafb3e484c4f92192e0b7eee5e39f4f4ee6
parent cfc5ac50
......@@ -139,7 +139,7 @@ AV1_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iht4x4_add_neon.c
AV1_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iht8x8_add_neon.c
endif
ifeq ($(CONFIG_EXT_INTRA),yes)
ifeq ($(CONFIG_FILTER_INTRA),yes)
AV1_COMMON_SRCS-yes += common/intra_filters.h
AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/reconintra_sse4.c
endif
......
......@@ -199,8 +199,8 @@ if (aom_config("CONFIG_NEW_QUANT") eq "yes") {
specialize qw/quantize_32x32_fp_nuq/;
}
# EXT_INTRA predictor functions
if (aom_config("CONFIG_EXT_INTRA") eq "yes") {
# FILTER_INTRA predictor functions
if (aom_config("CONFIG_FILTER_INTRA") eq "yes") {
add_proto qw/void av1_dc_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, int bs, const uint8_t *above, const uint8_t *left";
specialize qw/av1_dc_filter_predictor sse4_1/;
add_proto qw/void av1_v_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, int bs, const uint8_t *above, const uint8_t *left";
......
......@@ -150,8 +150,6 @@ const int16_t dr_intra_derivative[90] = {
54, 49, 45, 40, 35, 31, 26, 22, 17, 13, 8, 4,
};
// Returns whether filter selection is needed for a given
// intra prediction angle.
int av1_is_intra_filter_switchable(int angle) {
assert(angle > 0 && angle < 270);
if (angle % 45 == 0) return 0;
......
......@@ -171,13 +171,13 @@ typedef struct {
} PALETTE_MODE_INFO;
#endif // CONFIG_PALETTE
#if CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
typedef struct {
// 1: an ext intra mode is used; 0: otherwise.
uint8_t use_ext_intra_mode[PLANE_TYPES];
EXT_INTRA_MODE ext_intra_mode[PLANE_TYPES];
} EXT_INTRA_MODE_INFO;
#endif // CONFIG_EXT_INTRA
uint8_t use_filter_intra_mode[PLANE_TYPES];
FILTER_INTRA_MODE filter_intra_mode[PLANE_TYPES];
} FILTER_INTRA_MODE_INFO;
#endif // CONFIG_FILTER_INTRA
// This structure now relates to 8x8 block regions.
typedef struct {
......@@ -214,8 +214,10 @@ typedef struct {
MV_REFERENCE_FRAME ref_frame[2];
TX_TYPE tx_type;
#if CONFIG_FILTER_INTRA
FILTER_INTRA_MODE_INFO filter_intra_mode_info;
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
EXT_INTRA_MODE_INFO ext_intra_mode_info;
int8_t angle_delta[2];
// To-Do (huisu): this may be replaced by interp_filter
INTRA_FILTER intra_filter;
......@@ -563,17 +565,7 @@ static INLINE TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode,
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
}
#if CONFIG_EXT_INTRA
#define ALLOW_FILTER_INTRA_MODES 1
#define ANGLE_STEP 3
#define MAX_ANGLE_DELTAS 3
extern const int16_t dr_intra_derivative[90];
static const uint8_t mode_to_angle_map[INTRA_MODES] = {
0, 90, 180, 45, 135, 111, 157, 203, 67, 0,
};
#if CONFIG_FILTER_INTRA
static const TX_TYPE filter_intra_mode_to_tx_type_lookup[FILTER_INTRA_MODES] = {
DCT_DCT, // FILTER_DC
ADST_DCT, // FILTER_V
......@@ -586,7 +578,18 @@ static const TX_TYPE filter_intra_mode_to_tx_type_lookup[FILTER_INTRA_MODES] = {
ADST_DCT, // FILTER_D63
ADST_ADST, // FILTER_TM
};
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
#define ANGLE_STEP 3
#define MAX_ANGLE_DELTAS 3
extern const int16_t dr_intra_derivative[90];
static const uint8_t mode_to_angle_map[INTRA_MODES] = {
0, 90, 180, 45, 135, 111, 157, 203, 67, 0,
};
// Returns whether filter selection is needed for a given
// intra prediction angle.
int av1_is_intra_filter_switchable(int angle);
#endif // CONFIG_EXT_INTRA
......@@ -618,15 +621,19 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, const MACROBLOCKD *xd,
if (FIXED_TX_TYPE)
return get_default_tx_type(plane_type, xd, block_idx, tx_size);
#if CONFIG_EXT_INTRA
#if CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA
if (!is_inter_block(mbmi)) {
const int use_ext_intra_mode_info =
mbmi->ext_intra_mode_info.use_ext_intra_mode[plane_type];
const EXT_INTRA_MODE ext_intra_mode =
mbmi->ext_intra_mode_info.ext_intra_mode[plane_type];
#if CONFIG_FILTER_INTRA
const int use_filter_intra_mode_info =
mbmi->filter_intra_mode_info.use_filter_intra_mode[plane_type];
const FILTER_INTRA_MODE filter_intra_mode =
mbmi->filter_intra_mode_info.filter_intra_mode[plane_type];
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
const PREDICTION_MODE mode = (plane_type == PLANE_TYPE_Y)
? get_y_mode(mi, block_idx)
: mbmi->uv_mode;
#endif // CONFIG_EXT_INTRA
if (xd->lossless[mbmi->segment_id] || tx_size >= TX_32X32) return DCT_DCT;
......@@ -637,9 +644,11 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, const MACROBLOCKD *xd,
#endif // ALLOW_INTRA_EXT_TX
#endif // CONFIG_EXT_TX
if (use_ext_intra_mode_info)
return filter_intra_mode_to_tx_type_lookup[ext_intra_mode];
#if CONFIG_FILTER_INTRA
if (use_filter_intra_mode_info)
return filter_intra_mode_to_tx_type_lookup[filter_intra_mode];
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
if (mode == DC_PRED) {
return DCT_DCT;
} else if (mode == TM_PRED) {
......@@ -658,8 +667,9 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, const MACROBLOCKD *xd,
else
return DCT_ADST;
}
}
#endif // CONFIG_EXT_INTRA
}
#endif // CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA
#if CONFIG_EXT_TX
#if EXT_TX_SIZES == 4
......
......@@ -1313,14 +1313,16 @@ static const aom_prob default_intra_filter_probs[INTRA_FILTERS + 1]
{ 49, 25, 24 },
{ 72, 38, 50 },
};
static const aom_prob default_ext_intra_probs[2] = { 230, 230 };
const aom_tree_index av1_intra_filter_tree[TREE_SIZE(INTRA_FILTERS)] = {
-INTRA_FILTER_LINEAR, 2, -INTRA_FILTER_8TAP, 4, -INTRA_FILTER_8TAP_SHARP,
-INTRA_FILTER_8TAP_SMOOTH,
};
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
static const aom_prob default_filter_intra_probs[2] = { 230, 230 };
#endif // CONFIG_FILTER_INTRA
#if CONFIG_SUPERTX
static const aom_prob default_supertx_prob[PARTITION_SUPERTX_CONTEXTS]
[TX_SIZES] = {
......@@ -1385,9 +1387,11 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->seg.tree_probs, default_segment_tree_probs);
av1_copy(fc->seg.pred_probs, default_segment_pred_probs);
#if CONFIG_EXT_INTRA
av1_copy(fc->ext_intra_probs, default_ext_intra_probs);
av1_copy(fc->intra_filter_probs, default_intra_filter_probs);
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
av1_copy(fc->filter_intra_probs, default_filter_intra_probs);
#endif // CONFIG_FILTER_INTRA
av1_copy(fc->inter_ext_tx_prob, default_inter_ext_tx_prob);
av1_copy(fc->intra_ext_tx_prob, default_intra_ext_tx_prob);
#if CONFIG_LOOP_RESTORATION
......@@ -1657,22 +1661,23 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
#endif
}
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_DELTA_Q
for (i = 0; i < DELTA_Q_CONTEXTS; ++i)
fc->delta_q_prob[i] =
mode_mv_merge_probs(pre_fc->delta_q_prob[i], counts->delta_q[i]);
#endif
#if CONFIG_EXT_INTRA
for (i = 0; i < PLANE_TYPES; ++i) {
fc->ext_intra_probs[i] = av1_mode_mv_merge_probs(pre_fc->ext_intra_probs[i],
counts->ext_intra[i]);
}
for (i = 0; i < INTRA_FILTERS + 1; ++i)
for (i = 0; i < INTRA_FILTERS + 1; ++i) {
aom_tree_merge_probs(av1_intra_filter_tree, pre_fc->intra_filter_probs[i],
counts->intra_filter[i], fc->intra_filter_probs[i]);
}
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
for (i = 0; i < PLANE_TYPES; ++i) {
fc->filter_intra_probs[i] = av1_mode_mv_merge_probs(
pre_fc->filter_intra_probs[i], counts->filter_intra[i]);
}
#endif // CONFIG_FILTER_INTRA
}
static void set_default_lf_deltas(struct loopfilter *lf) {
......
......@@ -122,9 +122,11 @@ typedef struct frame_contexts {
#endif // CONFIG_SUPERTX
struct segmentation_probs seg;
#if CONFIG_EXT_INTRA
aom_prob ext_intra_probs[PLANE_TYPES];
aom_prob intra_filter_probs[INTRA_FILTERS + 1][INTRA_FILTERS - 1];
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
aom_prob filter_intra_probs[PLANE_TYPES];
#endif // CONFIG_FILTER_INTRA
#if CONFIG_GLOBAL_MOTION
aom_prob global_motion_types_prob[GLOBAL_MOTION_TYPES - 1];
#endif // CONFIG_GLOBAL_MOTION
......@@ -226,9 +228,11 @@ typedef struct FRAME_COUNTS {
#endif // CONFIG_SUPERTX
struct seg_counts seg;
#if CONFIG_EXT_INTRA
unsigned int ext_intra[PLANE_TYPES][2];
unsigned int intra_filter[INTRA_FILTERS + 1][INTRA_FILTERS];
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
unsigned int filter_intra[PLANE_TYPES][2];
#endif // CONFIG_FILTER_INTRA
} FRAME_COUNTS;
extern const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
......
......@@ -318,7 +318,7 @@ typedef enum {
#endif // CONFIG_EXT_INTER
#if CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
typedef enum {
FILTER_DC_PRED,
FILTER_V_PRED,
......@@ -330,10 +330,11 @@ typedef enum {
FILTER_D207_PRED,
FILTER_D63_PRED,
FILTER_TM_PRED,
EXT_INTRA_MODES,
} EXT_INTRA_MODE;
FILTER_INTRA_MODES,
} FILTER_INTRA_MODE;
#endif // CONFIG_FILTER_INTRA
#define FILTER_INTRA_MODES (FILTER_TM_PRED + 1)
#if CONFIG_EXT_INTRA
#define DIRECTIONAL_MODES (INTRA_MODES - 2)
#endif // CONFIG_EXT_INTRA
......
This diff is collapsed.
......@@ -25,9 +25,6 @@ void av1_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, int bhl_in,
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride, uint8_t *dst,
int dst_stride, int aoff, int loff, int plane);
#if CONFIG_EXT_INTRA
int av1_is_intra_filter_switchable(int angle);
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTER
// Mapping of interintra to intra mode for use in the intra component
......
......@@ -27,7 +27,7 @@
#define ACCT_STR __func__
#if CONFIG_EXT_INTRA || CONFIG_PALETTE
#if CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA || CONFIG_PALETTE
static INLINE int read_uniform(aom_reader *r, int n) {
int l = get_unsigned_bits(n);
int m = (1 << l) - n;
......@@ -40,7 +40,7 @@ static INLINE int read_uniform(aom_reader *r, int n) {
else
return (v << 1) - m + aom_read_literal(r, 1, ACCT_STR);
}
#endif // CONFIG_EXT_INTRA || CONFIG_PALETTE
#endif // CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA || CONFIG_PALETTE
static PREDICTION_MODE read_intra_mode(aom_reader *r, const aom_prob *p) {
return (PREDICTION_MODE)aom_read_tree(r, av1_intra_mode_tree, p, ACCT_STR);
......@@ -545,46 +545,51 @@ static void read_palette_mode_info(AV1_COMMON *const cm, MACROBLOCKD *const xd,
}
#endif // CONFIG_PALETTE
#if CONFIG_EXT_INTRA
static void read_ext_intra_mode_info(AV1_COMMON *const cm,
MACROBLOCKD *const xd, aom_reader *r) {
#if CONFIG_FILTER_INTRA
static void read_filter_intra_mode_info(AV1_COMMON *const cm,
MACROBLOCKD *const xd, aom_reader *r) {
MODE_INFO *const mi = xd->mi[0];
MB_MODE_INFO *const mbmi = &mi->mbmi;
FRAME_COUNTS *counts = xd->counts;
FILTER_INTRA_MODE_INFO *filter_intra_mode_info =
&mbmi->filter_intra_mode_info;
#if !ALLOW_FILTER_INTRA_MODES
return;
#endif
if (mbmi->mode == DC_PRED
#if CONFIG_PALETTE
&& mbmi->palette_mode_info.palette_size[0] == 0
#endif // CONFIG_PALETTE
) {
mbmi->ext_intra_mode_info.use_ext_intra_mode[0] =
aom_read(r, cm->fc->ext_intra_probs[0], ACCT_STR);
if (mbmi->ext_intra_mode_info.use_ext_intra_mode[0]) {
mbmi->ext_intra_mode_info.ext_intra_mode[0] =
filter_intra_mode_info->use_filter_intra_mode[0] =
aom_read(r, cm->fc->filter_intra_probs[0], ACCT_STR);
if (filter_intra_mode_info->use_filter_intra_mode[0]) {
filter_intra_mode_info->filter_intra_mode[0] =
read_uniform(r, FILTER_INTRA_MODES);
}
if (counts)
++counts->ext_intra[0][mbmi->ext_intra_mode_info.use_ext_intra_mode[0]];
if (counts) {
++counts->filter_intra[0]
[filter_intra_mode_info->use_filter_intra_mode[0]];
}
}
if (mbmi->uv_mode == DC_PRED
#if CONFIG_PALETTE
&& mbmi->palette_mode_info.palette_size[1] == 0
#endif // CONFIG_PALETTE
) {
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] =
aom_read(r, cm->fc->ext_intra_probs[1], ACCT_STR);
if (mbmi->ext_intra_mode_info.use_ext_intra_mode[1]) {
mbmi->ext_intra_mode_info.ext_intra_mode[1] =
filter_intra_mode_info->use_filter_intra_mode[1] =
aom_read(r, cm->fc->filter_intra_probs[1], ACCT_STR);
if (filter_intra_mode_info->use_filter_intra_mode[1]) {
filter_intra_mode_info->filter_intra_mode[1] =
read_uniform(r, FILTER_INTRA_MODES);
}
if (counts)
++counts->ext_intra[1][mbmi->ext_intra_mode_info.use_ext_intra_mode[1]];
if (counts) {
++counts->filter_intra[1]
[filter_intra_mode_info->use_filter_intra_mode[1]];
}
}
}
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
static void read_intra_angle_info(AV1_COMMON *const cm, MACROBLOCKD *const xd,
aom_reader *r) {
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
......@@ -682,11 +687,11 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
if (bsize >= BLOCK_8X8 && cm->allow_screen_content_tools)
read_palette_mode_info(cm, xd, r);
#endif // CONFIG_PALETTE
#if CONFIG_EXT_INTRA
mbmi->ext_intra_mode_info.use_ext_intra_mode[0] = 0;
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0;
if (bsize >= BLOCK_8X8) read_ext_intra_mode_info(cm, xd, r);
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
mbmi->filter_intra_mode_info.use_filter_intra_mode[0] = 0;
mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
if (bsize >= BLOCK_8X8) read_filter_intra_mode_info(cm, xd, r);
#endif // CONFIG_FILTER_INTRA
if (!FIXED_TX_TYPE) {
#if CONFIG_EXT_TX
......@@ -986,11 +991,11 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm,
if (bsize >= BLOCK_8X8 && cm->allow_screen_content_tools)
read_palette_mode_info(cm, xd, r);
#endif // CONFIG_PALETTE
#if CONFIG_EXT_INTRA
mbmi->ext_intra_mode_info.use_ext_intra_mode[0] = 0;
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0;
if (bsize >= BLOCK_8X8) read_ext_intra_mode_info(cm, xd, r);
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
mbmi->filter_intra_mode_info.use_filter_intra_mode[0] = 0;
mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
if (bsize >= BLOCK_8X8) read_filter_intra_mode_info(cm, xd, r);
#endif // CONFIG_FILTER_INTRA
}
static INLINE int is_mv_valid(const MV *mv) {
......@@ -1604,12 +1609,14 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
mbmi->ref_frame[1] = INTRA_FRAME;
mbmi->interintra_mode = interintra_mode;
#if CONFIG_EXT_INTRA
mbmi->ext_intra_mode_info.use_ext_intra_mode[0] = 0;
mbmi->ext_intra_mode_info.use_ext_intra_mode[1] = 0;
mbmi->angle_delta[0] = 0;
mbmi->angle_delta[1] = 0;
mbmi->intra_filter = INTRA_FILTER_LINEAR;
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
mbmi->filter_intra_mode_info.use_filter_intra_mode[0] = 0;
mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
#endif // CONFIG_FILTER_INTRA
if (is_interintra_wedge_used(bsize)) {
mbmi->use_wedge_interintra =
aom_read(r, cm->fc->wedge_interintra_prob[bsize], ACCT_STR);
......
......@@ -125,7 +125,7 @@ static const struct av1_token tx_size_encodings[TX_SIZES - 1][TX_SIZES] = {
{ { 0, 1 }, { 2, 2 }, { 6, 3 }, { 7, 3 } }, // Max tx_size is 32X32
};
#if CONFIG_EXT_INTRA || CONFIG_PALETTE
#if CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA || CONFIG_PALETTE
static INLINE void write_uniform(aom_writer *w, int n, int v) {
int l = get_unsigned_bits(n);
int m = (1 << l) - n;
......@@ -137,7 +137,7 @@ static INLINE void write_uniform(aom_writer *w, int n, int v) {
aom_write_literal(w, (v - m) & 1, 1);
}
}
#endif // CONFIG_EXT_INTRA || CONFIG_PALETTE
#endif // CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA || CONFIG_PALETTE
#if CONFIG_EXT_TX
static struct av1_token ext_tx_inter_encodings[EXT_TX_SETS_INTER][TX_TYPES];
......@@ -931,22 +931,20 @@ static void write_ref_frames(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
}
#if CONFIG_EXT_INTRA
static void write_ext_intra_mode_info(const AV1_COMMON *const cm,
const MB_MODE_INFO *const mbmi,
aom_writer *w) {
#if !ALLOW_FILTER_INTRA_MODES
return;
#endif
#if CONFIG_FILTER_INTRA
static void write_filter_intra_mode_info(const AV1_COMMON *const cm,
const MB_MODE_INFO *const mbmi,
aom_writer *w) {
if (mbmi->mode == DC_PRED
#if CONFIG_PALETTE
&& mbmi->palette_mode_info.palette_size[0] == 0
#endif // CONFIG_PALETTE
) {
aom_write(w, mbmi->ext_intra_mode_info.use_ext_intra_mode[0],
cm->fc->ext_intra_probs[0]);
if (mbmi->ext_intra_mode_info.use_ext_intra_mode[0]) {
EXT_INTRA_MODE mode = mbmi->ext_intra_mode_info.ext_intra_mode[0];
aom_write(w, mbmi->filter_intra_mode_info.use_filter_intra_mode[0],
cm->fc->filter_intra_probs[0]);
if (mbmi->filter_intra_mode_info.use_filter_intra_mode[0]) {
const FILTER_INTRA_MODE mode =
mbmi->filter_intra_mode_info.filter_intra_mode[0];
write_uniform(w, FILTER_INTRA_MODES, mode);
}
}
......@@ -956,15 +954,18 @@ static void write_ext_intra_mode_info(const AV1_COMMON *const cm,
&& mbmi->palette_mode_info.palette_size[1] == 0
#endif // CONFIG_PALETTE
) {
aom_write(w, mbmi->ext_intra_mode_info.use_ext_intra_mode[1],
cm->fc->ext_intra_probs[1]);
if (mbmi->ext_intra_mode_info.use_ext_intra_mode[1]) {
EXT_INTRA_MODE mode = mbmi->ext_intra_mode_info.ext_intra_mode[1];
aom_write(w, mbmi->filter_intra_mode_info.use_filter_intra_mode[1],
cm->fc->filter_intra_probs[1]);
if (mbmi->filter_intra_mode_info.use_filter_intra_mode[1]) {
const FILTER_INTRA_MODE mode =
mbmi->filter_intra_mode_info.filter_intra_mode[1];
write_uniform(w, FILTER_INTRA_MODES, mode);
}
}
}
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
static void write_intra_angle_info(const AV1_COMMON *cm, const MACROBLOCKD *xd,
aom_writer *w) {
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
......@@ -1230,9 +1231,9 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
if (bsize >= BLOCK_8X8 && cm->allow_screen_content_tools)
write_palette_mode_info(cm, xd, mi, w);
#endif // CONFIG_PALETTE
#if CONFIG_EXT_INTRA
if (bsize >= BLOCK_8X8) write_ext_intra_mode_info(cm, mbmi, w);
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
if (bsize >= BLOCK_8X8) write_filter_intra_mode_info(cm, mbmi, w);
#endif // CONFIG_FILTER_INTRA
} else {
int16_t mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
write_ref_frames(cm, xd, w);
......@@ -1623,9 +1624,9 @@ static void write_mb_modes_kf(const AV1_COMMON *cm, const MACROBLOCKD *xd,
if (bsize >= BLOCK_8X8 && cm->allow_screen_content_tools)
write_palette_mode_info(cm, xd, mi, w);
#endif // CONFIG_PALETTE
#if CONFIG_EXT_INTRA
if (bsize >= BLOCK_8X8) write_ext_intra_mode_info(cm, mbmi, w);
#endif // CONFIG_EXT_INTRA
#if CONFIG_FILTER_INTRA
if (bsize >= BLOCK_8X8) write_filter_intra_mode_info(cm, mbmi, w);
#endif // CONFIG_FILTER_INTRA
if (!FIXED_TX_TYPE) {
#if CONFIG_EXT_TX
......
......@@ -5108,21 +5108,31 @@ static void encode_superblock(const AV1_COMP *const cpi, ThreadData *td,
sum_intra_stats(td->counts, mi, xd->above_mi, xd->left_mi,
frame_is_intra_only(cm));
#if CONFIG_EXT_INTRA
// TODO(huisu): move this into sum_intra_stats().
if (!dry_run && bsize >= BLOCK_8X8) {
FRAME_COUNTS *counts = td->counts;
(void)counts;
#if CONFIG_FILTER_INTRA
if (mbmi->mode == DC_PRED
#if CONFIG_PALETTE
&& mbmi->palette_mode_info.palette_size[0] == 0
#endif // CONFIG_PALETTE
)
++counts->ext_intra[0][mbmi->ext_intra_mode_info.use_ext_intra_mode[0]];
) {
const int use_filter_intra_mode =
mbmi->filter_intra_mode_info.use_filter_intra_mode[0];
++counts->filter_intra[0][use_filter_intra_mode];
}
if (mbmi->uv_mode == DC_PRED
#if CONFIG_PALETTE
&& mbmi->palette_mode_info.palette_size[1] == 0
#endif // CONFIG_PALETTE
)
++counts->ext_intra[1][mbmi->ext_intra_mode_info.use_ext_intra_mode[1]];
) {
const int use_filter_intra_mode =
mbmi->filter_intra_mode_info.use_filter_intra_mode[1];
++counts->filter_intra[1][use_filter_intra_mode];
}
#endif // CONFIG_FILTER_INTRA
#if CONFIG_EXT_INTRA
if (mbmi->mode != DC_PRED && mbmi->mode != TM_PRED) {
int p_angle;
const int intra_filter_ctx = av1_get_pred_context_intra_interp(xd);
......@@ -5131,8 +5141,8 @@ static void encode_superblock(const AV1_COMP *const cpi, ThreadData *td,
if (av1_is_intra_filter_switchable(p_angle))
++counts->intra_filter[intra_filter_ctx][mbmi->intra_filter];
}
}
#endif // CONFIG_EXT_INTRA
}
#if CONFIG_PALETTE
if (bsize >= BLOCK_8X8 && !dry_run) {
......
This diff is collapsed.
......@@ -162,7 +162,7 @@ LIBAOM_TEST_SRCS-$(HAVE_SSSE3) += masked_sad_test.cc
LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_wedge_utils_test.cc
endif
ifeq ($(CONFIG_EXT_INTRA),yes)
ifeq ($(CONFIG_FILTER_INTRA),yes)
LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += reconintra_predictors_test.cc
endif
......
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