Commit a6a486c1 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove UNPOISON_PARTITION_CTX experiment

This experiment has been abandonned for AV1.

Change-Id: I07be0876b21ee20a1eb2490bb98e4f84978ff001
parent a097204a
......@@ -621,22 +621,6 @@ static const aom_prob
{ 58, 32, 12, 128, 128, 128, 255, 128, 255 }, // l split, a not split
{ 10, 7, 6, 128, 128, 128, 255, 128, 255 }, // a/l both split
#endif // CONFIG_EXT_PARTITION
#if CONFIG_UNPOISON_PARTITION_CTX
{ 0, 0, 141, 0, 0, 0, 0, 0, 0 }, // 8x8 -> 4x4
{ 0, 0, 87, 0, 0, 0, 0, 0, 0 }, // 16x16 -> 8x8
{ 0, 0, 59, 0, 0, 0, 0, 0, 0 }, // 32x32 -> 16x16
{ 0, 0, 30, 0, 0, 0, 0, 0, 0 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 0, 30, 0, 0, 0, 0, 0, 0 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
{ 0, 122, 0, 0, 0, 0, 0, 0, 0 }, // 8x8 -> 4x4
{ 0, 73, 0, 0, 0, 0, 0, 0, 0 }, // 16x16 -> 8x8
{ 0, 58, 0, 0, 0, 0, 0, 0, 0 }, // 32x32 -> 16x16
{ 0, 34, 0, 0, 0, 0, 0, 0, 0 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 34, 0, 0, 0, 0, 0, 0, 0 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_UNPOISON_PARTITION_CTX
};
#else
static const aom_prob
......@@ -668,22 +652,6 @@ static const aom_prob
{ 58, 32, 12 }, // l split, a not split
{ 10, 7, 6 }, // a/l both split
#endif // CONFIG_EXT_PARTITION
#if CONFIG_UNPOISON_PARTITION_CTX
{ 0, 0, 141 }, // 8x8 -> 4x4
{ 0, 0, 87 }, // 16x16 -> 8x8
{ 0, 0, 59 }, // 32x32 -> 16x16
{ 0, 0, 30 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 0, 30 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
{ 0, 122, 0 }, // 8x8 -> 4x4
{ 0, 73, 0 }, // 16x16 -> 8x8
{ 0, 58, 0 }, // 32x32 -> 16x16
{ 0, 34, 0 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 34, 0 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_UNPOISON_PARTITION_CTX
};
#endif // CONFIG_EXT_PARTITION_TYPES
......@@ -3468,30 +3436,6 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
counts->partition[i], fc->partition_prob[i]);
}
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_UNPOISON_PARTITION_CTX
for (i = PARTITION_CONTEXTS_PRIMARY;
i < PARTITION_CONTEXTS_PRIMARY + PARTITION_BLOCK_SIZES; ++i) {
unsigned int ct[2] = { counts->partition[i][PARTITION_VERT],
counts->partition[i][PARTITION_SPLIT] };
assert(counts->partition[i][PARTITION_NONE] == 0);
assert(counts->partition[i][PARTITION_HORZ] == 0);
assert(fc->partition_prob[i][PARTITION_NONE] == 0);
assert(fc->partition_prob[i][PARTITION_HORZ] == 0);
fc->partition_prob[i][PARTITION_VERT] =
av1_mode_mv_merge_probs(pre_fc->partition_prob[i][PARTITION_VERT], ct);
}
for (i = PARTITION_CONTEXTS_PRIMARY + PARTITION_BLOCK_SIZES;
i < PARTITION_CONTEXTS_PRIMARY + 2 * PARTITION_BLOCK_SIZES; ++i) {
unsigned int ct[2] = { counts->partition[i][PARTITION_HORZ],
counts->partition[i][PARTITION_SPLIT] };
assert(counts->partition[i][PARTITION_NONE] == 0);
assert(counts->partition[i][PARTITION_VERT] == 0);
assert(fc->partition_prob[i][PARTITION_NONE] == 0);
assert(fc->partition_prob[i][PARTITION_VERT] == 0);
fc->partition_prob[i][PARTITION_HORZ] =
av1_mode_mv_merge_probs(pre_fc->partition_prob[i][PARTITION_HORZ], ct);
}
#endif
for (i = 0; i < DELTA_Q_PROBS; ++i)
fc->delta_q_prob[i] =
mode_mv_merge_probs(pre_fc->delta_q_prob[i], counts->delta_q[i]);
......
......@@ -196,13 +196,7 @@ typedef char PARTITION_CONTEXT;
#define PARTITION_PLOFFSET 4 // number of probability models per block size
#define PARTITION_BLOCK_SIZES (4 + CONFIG_EXT_PARTITION)
#define PARTITION_CONTEXTS_PRIMARY (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
#if CONFIG_UNPOISON_PARTITION_CTX
#define INVALID_PARTITION_CTX (-1)
#define PARTITION_CONTEXTS \
(PARTITION_CONTEXTS_PRIMARY + 2 * PARTITION_BLOCK_SIZES)
#else
#define PARTITION_CONTEXTS PARTITION_CONTEXTS_PRIMARY
#endif
// block transform size
#if defined(_MSC_VER)
......
......@@ -1073,11 +1073,7 @@ static INLINE void update_ext_partition_context(MACROBLOCKD *xd, int mi_row,
#endif // CONFIG_EXT_PARTITION_TYPES
static INLINE int partition_plane_context(const MACROBLOCKD *xd, int mi_row,
int mi_col,
#if CONFIG_UNPOISON_PARTITION_CTX
int has_rows, int has_cols,
#endif
BLOCK_SIZE bsize) {
int mi_col, BLOCK_SIZE bsize) {
const PARTITION_CONTEXT *above_ctx = xd->above_seg_context + mi_col;
const PARTITION_CONTEXT *left_ctx =
xd->left_seg_context + (mi_row & MAX_MIB_MASK);
......@@ -1088,18 +1084,7 @@ static INLINE int partition_plane_context(const MACROBLOCKD *xd, int mi_row,
assert(b_width_log2_lookup[bsize] == b_height_log2_lookup[bsize]);
assert(bsl >= 0);
#if CONFIG_UNPOISON_PARTITION_CTX
if (has_rows && has_cols)
return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
else if (has_rows && !has_cols)
return PARTITION_CONTEXTS_PRIMARY + bsl;
else if (!has_rows && has_cols)
return PARTITION_CONTEXTS_PRIMARY + PARTITION_BLOCK_SIZES + bsl;
else
return INVALID_PARTITION_CTX; // Bogus context, forced SPLIT
#else
return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
#endif
}
static INLINE int max_block_wide(const MACROBLOCKD *xd, BLOCK_SIZE bsize,
......
......@@ -756,12 +756,7 @@ static PARTITION_TYPE read_partition(AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col, aom_reader *r,
int has_rows, int has_cols,
BLOCK_SIZE bsize) {
#if CONFIG_UNPOISON_PARTITION_CTX
const int ctx =
partition_plane_context(xd, mi_row, mi_col, has_rows, has_cols, bsize);
#else
const int ctx = partition_plane_context(xd, mi_row, mi_col, bsize);
#endif
PARTITION_TYPE p;
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
(void)cm;
......
......@@ -2232,11 +2232,7 @@ static void write_partition(const AV1_COMMON *const cm,
const int has_cols = (mi_col + hbs) < cm->mi_cols;
const int is_partition_point = bsize >= BLOCK_8X8;
const int ctx = is_partition_point
? partition_plane_context(xd, mi_row, mi_col,
#if CONFIG_UNPOISON_PARTITION_CTX
has_rows, has_cols,
#endif
bsize)
? partition_plane_context(xd, mi_row, mi_col, bsize)
: 0;
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
(void)cm;
......
......@@ -235,11 +235,9 @@ struct macroblock {
#endif
int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
#if CONFIG_EXT_PARTITION_TYPES
int partition_cost[PARTITION_CONTEXTS + CONFIG_UNPOISON_PARTITION_CTX]
[EXT_PARTITION_TYPES];
int partition_cost[PARTITION_CONTEXTS][EXT_PARTITION_TYPES];
#else
int partition_cost[PARTITION_CONTEXTS + CONFIG_UNPOISON_PARTITION_CTX]
[PARTITION_TYPES];
int partition_cost[PARTITION_CONTEXTS][PARTITION_TYPES];
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_MRC_TX
int mrc_mask_inter_cost[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS]
......
......@@ -1520,12 +1520,7 @@ static void encode_sb(const AV1_COMP *const cpi, ThreadData *td,
#endif
const int is_partition_root = bsize >= BLOCK_8X8;
const int ctx = is_partition_root
? partition_plane_context(xd, mi_row, mi_col,
#if CONFIG_UNPOISON_PARTITION_CTX
mi_row + hbs < cm->mi_rows,
mi_col + hbs < cm->mi_cols,
#endif
bsize)
? partition_plane_context(xd, mi_row, mi_col, bsize)
: -1;
const PARTITION_TYPE partition = pc_tree->partitioning;
const BLOCK_SIZE subsize = get_subsize(bsize, partition);
......@@ -1783,12 +1778,7 @@ static void rd_use_partition(AV1_COMP *cpi, ThreadData *td,
const int hbs = bs / 2;
int i;
const int pl = (bsize >= BLOCK_8X8)
? partition_plane_context(xd, mi_row, mi_col,
#if CONFIG_UNPOISON_PARTITION_CTX
mi_row + hbs < cm->mi_rows,
mi_col + hbs < cm->mi_cols,
#endif
bsize)
? partition_plane_context(xd, mi_row, mi_col, bsize)
: 0;
const PARTITION_TYPE partition =
(bsize >= BLOCK_8X8) ? get_partition(cm, mi_row, mi_col, bsize)
......@@ -2436,12 +2426,6 @@ static void rd_test_partition3(const AV1_COMP *const cpi, ThreadData *td,
MACROBLOCK *const x = &td->mb;
MACROBLOCKD *const xd = &x->e_mbd;
RD_STATS sum_rdc, this_rdc;
#if CONFIG_UNPOISON_PARTITION_CTX
const AV1_COMMON *const cm = &cpi->common;
const int hbs = mi_size_wide[bsize] / 2;
const int has_rows = mi_row + hbs < cm->mi_rows;
const int has_cols = mi_col + hbs < cm->mi_cols;
#endif // CONFIG_UNPOISON_PARTITION_CTX
#if CONFIG_EXT_PARTITION_TYPES_AB
const AV1_COMMON *const cm = &cpi->common;
#endif
......@@ -2475,11 +2459,7 @@ static void rd_test_partition3(const AV1_COMP *const cpi, ThreadData *td,
if (sum_rdc.rdcost >= best_rdc->rdcost) return;
int pl = partition_plane_context(xd, mi_row, mi_col,
#if CONFIG_UNPOISON_PARTITION_CTX
has_rows, has_cols,
#endif
bsize);
int pl = partition_plane_context(xd, mi_row, mi_col, bsize);
sum_rdc.rate += x->partition_cost[pl][partition];
sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist);
......@@ -2551,23 +2531,13 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
RD_SEARCH_MACROBLOCK_CONTEXT x_ctx;
const TOKENEXTRA *const tp_orig = *tp;
PICK_MODE_CONTEXT *ctx_none = &pc_tree->none;
#if CONFIG_UNPOISON_PARTITION_CTX
const int hbs = mi_size_wide[bsize] / 2;
const int has_rows = mi_row + hbs < cm->mi_rows;
const int has_cols = mi_col + hbs < cm->mi_cols;
#else
int tmp_partition_cost[PARTITION_TYPES];
#endif
BLOCK_SIZE subsize;
RD_STATS this_rdc, sum_rdc, best_rdc;
const int bsize_at_least_8x8 = (bsize >= BLOCK_8X8);
int do_square_split = bsize_at_least_8x8;
const int pl = bsize_at_least_8x8
? partition_plane_context(xd, mi_row, mi_col,
#if CONFIG_UNPOISON_PARTITION_CTX
has_rows, has_cols,
#endif
bsize)
? partition_plane_context(xd, mi_row, mi_col, bsize)
: 0;
const int *partition_cost =
pl >= 0 ? x->partition_cost[pl] : x->partition_cost[0];
......@@ -2606,7 +2576,6 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
(void)*tp_orig;
#if !CONFIG_UNPOISON_PARTITION_CTX
if (force_horz_split || force_vert_split) {
tmp_partition_cost[PARTITION_NONE] = INT_MAX;
......@@ -2630,7 +2599,6 @@ static void rd_pick_partition(const AV1_COMP *const cpi, ThreadData *td,
partition_cost = tmp_partition_cost;
}
#endif
#ifndef NDEBUG
// Nothing should rely on the default value of this array (which is just
......
......@@ -91,28 +91,6 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
for (i = 0; i < PARTITION_CONTEXTS_PRIMARY; ++i)
av1_cost_tokens_from_cdf(x->partition_cost[i], fc->partition_cdf[i],
NULL);
#if CONFIG_UNPOISON_PARTITION_CTX
for (; i < PARTITION_CONTEXTS_PRIMARY + PARTITION_BLOCK_SIZES; ++i) {
aom_prob p = fc->partition_prob[i][PARTITION_VERT];
assert(p > 0);
x->partition_cost[i][PARTITION_NONE] = INT_MAX;
x->partition_cost[i][PARTITION_HORZ] = INT_MAX;
x->partition_cost[i][PARTITION_VERT] = av1_cost_bit(p, 0);
x->partition_cost[i][PARTITION_SPLIT] = av1_cost_bit(p, 1);
}
for (; i < PARTITION_CONTEXTS_PRIMARY + 2 * PARTITION_BLOCK_SIZES; ++i) {
aom_prob p = fc->partition_prob[i][PARTITION_HORZ];
assert(p > 0);
x->partition_cost[i][PARTITION_NONE] = INT_MAX;
x->partition_cost[i][PARTITION_HORZ] = av1_cost_bit(p, 0);
x->partition_cost[i][PARTITION_VERT] = INT_MAX;
x->partition_cost[i][PARTITION_SPLIT] = av1_cost_bit(p, 1);
}
x->partition_cost[PARTITION_CONTEXTS][PARTITION_NONE] = INT_MAX;
x->partition_cost[PARTITION_CONTEXTS][PARTITION_HORZ] = INT_MAX;
x->partition_cost[PARTITION_CONTEXTS][PARTITION_VERT] = INT_MAX;
x->partition_cost[PARTITION_CONTEXTS][PARTITION_SPLIT] = 0;
#endif // CONFIG_UNPOISON_PARTITION_CTX
}
for (i = 0; i < SKIP_CONTEXTS; ++i) {
......
......@@ -195,6 +195,5 @@ set(CONFIG_TPL_MV 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_TX64X64 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_TXK_SEL 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_TXMG 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_UNPOISON_PARTITION_CTX 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_VAR_TX_NO_TX_MODE 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_XIPHRC 0 CACHE NUMBER "AV1 experiment flag.")
......@@ -267,7 +267,6 @@ EXPERIMENT_LIST="
ext_partition
ext_partition_types
ext_partition_types_ab
unpoison_partition_ctx
ext_tile
ncobmc
q_adapt_probs
......
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