Refactor ext-intra
Miscellaneous changes. Mostly code simplification and cleanup.
Make luma max angle delta depend on block size, which is the
way it was before the nextgenv2 branch merge.
Also some fixes for compatibility of ext-intra and alt-intra.
Change-Id: I2ce869e6ba7dee765a8dc4802f5e88040db3df22
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 81d8b39..fe12f67 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -36,6 +36,9 @@
#include "av1/common/odintrin.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"
#include "av1/common/tile_common.h"
@@ -1043,11 +1046,13 @@
(void)cm;
if (bsize < BLOCK_8X8) return;
- if (mbmi->mode != DC_PRED && mbmi->mode != TM_PRED) {
- write_uniform(w, 2 * MAX_ANGLE_DELTAS + 1,
- MAX_ANGLE_DELTAS + mbmi->angle_delta[0]);
+ if (av1_is_directional_mode(mbmi->mode, bsize)) {
+ const int max_angle_delta = av1_get_max_angle_delta(mbmi->sb_type, 0);
+ write_uniform(w, 2 * max_angle_delta + 1,
+ max_angle_delta + mbmi->angle_delta[0]);
#if CONFIG_INTRA_INTERP
- p_angle = mode_to_angle_map[mbmi->mode] + mbmi->angle_delta[0] * ANGLE_STEP;
+ p_angle = mode_to_angle_map[mbmi->mode] +
+ mbmi->angle_delta[0] * av1_get_angle_step(mbmi->sb_type, 0);
if (av1_is_intra_filter_switchable(p_angle)) {
av1_write_token(w, av1_intra_filter_tree,
cm->fc->intra_filter_probs[intra_filter_ctx],
@@ -1056,9 +1061,9 @@
#endif // CONFIG_INTRA_INTERP
}
- if (mbmi->uv_mode != DC_PRED && mbmi->uv_mode != TM_PRED) {
- write_uniform(w, 2 * MAX_ANGLE_DELTAS + 1,
- MAX_ANGLE_DELTAS + mbmi->angle_delta[1]);
+ if (av1_is_directional_mode(mbmi->uv_mode, bsize)) {
+ write_uniform(w, 2 * MAX_ANGLE_DELTA_UV + 1,
+ MAX_ANGLE_DELTA_UV + mbmi->angle_delta[1]);
}
}
#endif // CONFIG_EXT_INTRA