Remove PALETTE flag
This experiment is now adopted as it was cleared by Tapas.
Note: Palette use can still be controlled by command-line option
"--tune-content=..." in 'aomenc'.
Change-Id: I832f49f20f60c34bdef5b424755849c496687e87
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 1b572ae..2d2f113 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -1898,12 +1898,10 @@
int row_y, col_y, row_c, col_c;
int plane;
-#if CONFIG_PALETTE
for (plane = 0; plane <= 1; ++plane) {
if (mbmi->palette_mode_info.palette_size[plane])
av1_decode_palette_tokens(xd, plane, r);
}
-#endif
for (row_y = 0; row_y < tu_num_h_y; row_y++) {
for (col_y = 0; col_y < tu_num_w_y; col_y++) {
@@ -1983,12 +1981,10 @@
#else // CONFIG_COEF_INTERLEAVE
if (!is_inter_block(mbmi)) {
int plane;
-#if CONFIG_PALETTE
for (plane = 0; plane <= 1; ++plane) {
if (mbmi->palette_mode_info.palette_size[plane])
av1_decode_palette_tokens(xd, plane, r);
}
-#endif // CONFIG_PALETTE
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
@@ -3841,10 +3837,8 @@
td->xd.daala_dec.state.adapt = &td->tctx.pvq_context;
#endif
-#if CONFIG_PALETTE
td->xd.plane[0].color_index_map = td->color_index_map[0];
td->xd.plane[1].color_index_map = td->color_index_map[1];
-#endif // CONFIG_PALETTE
}
}
@@ -4223,10 +4217,8 @@
// Initialise the tile context from the frame context
twd->tctx = *cm->fc;
twd->xd.tile_ctx = &twd->tctx;
-#if CONFIG_PALETTE
twd->xd.plane[0].color_index_map = twd->color_index_map[0];
twd->xd.plane[1].color_index_map = twd->color_index_map[1];
-#endif // CONFIG_PALETTE
worker->had_error = 0;
if (i == num_workers - 1 || tile_col == tile_cols_end - 1) {
@@ -4561,17 +4553,13 @@
#if CONFIG_ANS && ANS_MAX_SYMBOLS
cm->ans_window_size_log2 = aom_rb_read_literal(rb, 4) + 8;
#endif // CONFIG_ANS && ANS_MAX_SYMBOLS
-#if CONFIG_PALETTE || CONFIG_INTRABC
cm->allow_screen_content_tools = aom_rb_read_bit(rb);
-#endif // CONFIG_PALETTE || CONFIG_INTRABC
#if CONFIG_TEMPMV_SIGNALING
cm->use_prev_frame_mvs = 0;
#endif
} else {
cm->intra_only = cm->show_frame ? 0 : aom_rb_read_bit(rb);
-#if CONFIG_PALETTE || CONFIG_INTRABC
if (cm->intra_only) cm->allow_screen_content_tools = aom_rb_read_bit(rb);
-#endif // CONFIG_PALETTE || CONFIG_INTRABC
#if CONFIG_TEMPMV_SIGNALING
if (cm->intra_only || cm->error_resilient_mode) cm->use_prev_frame_mvs = 0;
#endif
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index 13720b0..848772b 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -691,7 +691,6 @@
}
}
-#if CONFIG_PALETTE
#if CONFIG_PALETTE_DELTA_ENCODING
static int uint16_compare(const void *a, const void *b) {
const uint16_t va = *(const uint16_t *)a;
@@ -840,7 +839,6 @@
}
}
}
-#endif // CONFIG_PALETTE
#if CONFIG_FILTER_INTRA
static void read_filter_intra_mode_info(AV1_COMMON *const cm,
@@ -852,11 +850,7 @@
FILTER_INTRA_MODE_INFO *filter_intra_mode_info =
&mbmi->filter_intra_mode_info;
- if (mbmi->mode == DC_PRED
-#if CONFIG_PALETTE
- && mbmi->palette_mode_info.palette_size[0] == 0
-#endif // CONFIG_PALETTE
- ) {
+ if (mbmi->mode == DC_PRED && mbmi->palette_mode_info.palette_size[0] == 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]) {
@@ -879,11 +873,8 @@
(void)mi_col;
#endif // CONFIG_CB4X4
- if (mbmi->uv_mode == UV_DC_PRED
-#if CONFIG_PALETTE
- && mbmi->palette_mode_info.palette_size[1] == 0
-#endif // CONFIG_PALETTE
- ) {
+ if (mbmi->uv_mode == UV_DC_PRED &&
+ mbmi->palette_mode_info.palette_size[1] == 0) {
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]) {
@@ -1210,13 +1201,11 @@
#if CONFIG_EXT_INTRA
read_intra_angle_info(cm, xd, r);
#endif // CONFIG_EXT_INTRA
-#if CONFIG_PALETTE
mbmi->palette_mode_info.palette_size[0] = 0;
mbmi->palette_mode_info.palette_size[1] = 0;
if (bsize >= BLOCK_8X8 && bsize <= BLOCK_LARGEST &&
cm->allow_screen_content_tools)
read_palette_mode_info(cm, xd, r);
-#endif // CONFIG_PALETTE
#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;
@@ -1818,12 +1807,10 @@
#if CONFIG_EXT_INTRA
read_intra_angle_info(cm, xd, r);
#endif // CONFIG_EXT_INTRA
-#if CONFIG_PALETTE
mbmi->palette_mode_info.palette_size[0] = 0;
mbmi->palette_mode_info.palette_size[1] = 0;
if (bsize >= BLOCK_8X8 && cm->allow_screen_content_tools)
read_palette_mode_info(cm, xd, r);
-#endif // CONFIG_PALETTE
#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;
@@ -2241,10 +2228,8 @@
assert(NELEMENTS(mode_2_counter) == MB_MODE_COUNT);
-#if CONFIG_PALETTE
mbmi->palette_mode_info.palette_size[0] = 0;
mbmi->palette_mode_info.palette_size[1] = 0;
-#endif // CONFIG_PALETTE
memset(ref_mvs, 0, sizeof(ref_mvs));
diff --git a/av1/decoder/decoder.h b/av1/decoder/decoder.h
index 5e6afc2..b3784e1 100644
--- a/av1/decoder/decoder.h
+++ b/av1/decoder/decoder.h
@@ -54,9 +54,7 @@
CFL_CTX cfl;
#endif
DECLARE_ALIGNED(16, FRAME_CONTEXT, tctx);
-#if CONFIG_PALETTE
DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_SB_SQUARE]);
-#endif // CONFIG_PALETTE
} TileData;
typedef struct TileWorkerData {
@@ -74,9 +72,7 @@
CFL_CTX cfl;
#endif
FRAME_CONTEXT tctx;
-#if CONFIG_PALETTE
DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_SB_SQUARE]);
-#endif // CONFIG_PALETTE
struct aom_internal_error_info error_info;
} TileWorkerData;
@@ -213,7 +209,6 @@
}
#endif // CONFIG_EXT_REFS
-#if CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA || CONFIG_PALETTE
#define ACCT_STR __func__
static INLINE int av1_read_uniform(aom_reader *r, int n) {
const int l = get_unsigned_bits(n);
@@ -225,7 +220,6 @@
else
return (v << 1) - m + aom_read_literal(r, 1, ACCT_STR);
}
-#endif // CONFIG_EXT_INTRA || CONFIG_FILTER_INTRA || CONFIG_PALETTE
#ifdef __cplusplus
} // extern "C"
diff --git a/av1/decoder/detokenize.c b/av1/decoder/detokenize.c
index 89d9ef3..052ba73 100644
--- a/av1/decoder/detokenize.c
+++ b/av1/decoder/detokenize.c
@@ -218,7 +218,6 @@
}
#endif // !CONFIG_PVQ
-#if CONFIG_PALETTE
void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
aom_reader *r) {
const MODE_INFO *const mi = xd->mi[0];
@@ -281,7 +280,6 @@
color_map + (rows - 1) * plane_block_width, plane_block_width);
}
}
-#endif // CONFIG_PALETTE
#if !CONFIG_PVQ || CONFIG_VAR_TX
int av1_decode_block_tokens(AV1_COMMON *cm, MACROBLOCKD *const xd, int plane,
diff --git a/av1/decoder/detokenize.h b/av1/decoder/detokenize.h
index 0e58a28..eb31d58 100644
--- a/av1/decoder/detokenize.h
+++ b/av1/decoder/detokenize.h
@@ -22,9 +22,7 @@
extern "C" {
#endif
-#if CONFIG_PALETTE
void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r);
-#endif // CONFIG_PALETTE
#if !CONFIG_PVQ || CONFIG_VAR_TX
int av1_decode_block_tokens(AV1_COMMON *cm, MACROBLOCKD *const xd, int plane,