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
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 6326001..a4bd8d9 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -125,7 +125,7 @@
{ { 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 @@
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 @@
}
}
-#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 @@
&& 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 @@
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 @@
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