Commit 717ce090 authored by Hui Su's avatar Hui Su

Remove kf_ctx experiment flag

Change-Id: I829da5fc8007589a1323b49eecf6fa741d51c0e7
parent 02e84155
......@@ -1090,11 +1090,9 @@ static const struct {
};
/* clang-format on */
#if CONFIG_KF_CTX
static const int intra_mode_context[INTRA_MODES] = {
0, 1, 2, 3, 4, 4, 4, 4, 3, 0, 1, 2, 0,
};
#endif
#if CONFIG_JNT_COMP
// Note: this is also used in unit tests. So whenever one changes the table,
......
This diff is collapsed.
......@@ -57,9 +57,7 @@ extern "C" {
// 4096(BLOCK_64X64) -> 8
#define PALATTE_BSIZE_CTXS 9
#if CONFIG_KF_CTX
#define KF_MODE_CONTEXTS 5
#endif
// A define to configure whether 4:1 and 1:4 partitions are allowed for 128x128
// blocks. They seem not to be giving great results (and might be expensive to
......@@ -176,16 +174,12 @@ typedef struct frame_contexts {
#endif
aom_cdf_prob switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS]
[CDF_SIZE(SWITCHABLE_FILTERS)];
/* kf_y_cdf is discarded after use, so does not require persistent storage.
However, we keep it with the other CDFs in this struct since it needs to
be copied to each tile to support parallelism just like the others.
*/
#if CONFIG_KF_CTX
/* kf_y_cdf is discarded after use, so does not require persistent storage.
However, we keep it with the other CDFs in this struct since it needs to
be copied to each tile to support parallelism just like the others.
*/
aom_cdf_prob kf_y_cdf[KF_MODE_CONTEXTS][KF_MODE_CONTEXTS]
[CDF_SIZE(INTRA_MODES)];
#else
aom_cdf_prob kf_y_cdf[INTRA_MODES][INTRA_MODES][CDF_SIZE(INTRA_MODES)];
#endif
#if CONFIG_EXT_INTRA_MOD
aom_cdf_prob angle_delta_cdf[DIRECTIONAL_MODES]
......@@ -215,11 +209,7 @@ typedef struct FRAME_COUNTS {
// Note: This structure should only contain 'unsigned int' fields, or
// aggregates built solely from 'unsigned int' fields/elements
#if CONFIG_ENTROPY_STATS
#if CONFIG_KF_CTX
unsigned int kf_y_mode[KF_MODE_CONTEXTS][KF_MODE_CONTEXTS][INTRA_MODES];
#else
unsigned int kf_y_mode[INTRA_MODES][INTRA_MODES][INTRA_MODES];
#endif
unsigned int angle_delta[DIRECTIONAL_MODES][2 * MAX_ANGLE_DELTA + 1];
unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
#if CONFIG_CFL
......@@ -323,14 +313,9 @@ typedef struct FRAME_COUNTS {
#endif // CONFIG_FILTER_INTRA
} FRAME_COUNTS;
#if CONFIG_KF_CTX
extern const aom_cdf_prob default_kf_y_mode_cdf[KF_MODE_CONTEXTS]
[KF_MODE_CONTEXTS]
[CDF_SIZE(INTRA_MODES)];
#else
extern const aom_cdf_prob default_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES]
[CDF_SIZE(INTRA_MODES)];
#endif
// Decides what set to assign to 16x16 transforms.
// Set 0:
......
......@@ -925,14 +925,9 @@ static INLINE aom_cdf_prob *get_y_mode_cdf(FRAME_CONTEXT *tile_ctx,
const MODE_INFO *left_mi) {
const PREDICTION_MODE above = av1_above_block_mode(above_mi);
const PREDICTION_MODE left = av1_left_block_mode(left_mi);
#if CONFIG_KF_CTX
int above_ctx = intra_mode_context[above];
int left_ctx = intra_mode_context[left];
const int above_ctx = intra_mode_context[above];
const int left_ctx = intra_mode_context[left];
return tile_ctx->kf_y_cdf[above_ctx][left_ctx];
#else
return tile_ctx->kf_y_cdf[above][left];
#endif
}
static INLINE void update_partition_context(MACROBLOCKD *xd, int mi_row,
......
......@@ -815,13 +815,9 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
#if CONFIG_ENTROPY_STATS
const PREDICTION_MODE above = av1_above_block_mode(above_mi);
const PREDICTION_MODE left = av1_left_block_mode(left_mi);
#if CONFIG_KF_CTX
int above_ctx = intra_mode_context[above];
int left_ctx = intra_mode_context[left];
const int above_ctx = intra_mode_context[above];
const int left_ctx = intra_mode_context[left];
++counts->kf_y_mode[above_ctx][left_ctx][y_mode];
#else
++counts->kf_y_mode[above][left][y_mode];
#endif
#endif // CONFIG_ENTROPY_STATS
if (allow_update_cdf)
update_cdf(get_y_mode_cdf(fc, above_mi, left_mi), y_mode, INTRA_MODES);
......
......@@ -127,15 +127,9 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
av1_cost_tokens_from_cdf(x->skip_cost[i], fc->skip_cdfs[i], NULL);
}
#if CONFIG_KF_CTX
for (i = 0; i < KF_MODE_CONTEXTS; ++i)
for (j = 0; j < KF_MODE_CONTEXTS; ++j)
av1_cost_tokens_from_cdf(x->y_mode_costs[i][j], fc->kf_y_cdf[i][j], NULL);
#else
for (i = 0; i < INTRA_MODES; ++i)
for (j = 0; j < INTRA_MODES; ++j)
av1_cost_tokens_from_cdf(x->y_mode_costs[i][j], fc->kf_y_cdf[i][j], NULL);
#endif
for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
av1_cost_tokens_from_cdf(x->mbmode_cost[i], fc->y_mode_cdf[i], NULL);
......
......@@ -3436,14 +3436,9 @@ static int64_t rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
const MODE_INFO *left_mi = xd->left_mi;
const PREDICTION_MODE A = av1_above_block_mode(above_mi);
const PREDICTION_MODE L = av1_left_block_mode(left_mi);
#if CONFIG_KF_CTX
const int above_ctx = intra_mode_context[A];
const int left_ctx = intra_mode_context[L];
bmode_costs = x->y_mode_costs[above_ctx][left_ctx];
#else
bmode_costs = x->y_mode_costs[A][L];
#endif
mbmi->angle_delta[0] = 0;
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
......
......@@ -128,7 +128,6 @@ set(CONFIG_INTER_STATS_ONLY 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_INTRABC 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_INTRA_EDGE 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_JNT_COMP 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_KF_CTX 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_LOOPFILTERING_ACROSS_TILES 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_LOOPFILTERING_ACROSS_TILES_EXT 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_LOOPFILTER_LEVEL 1 CACHE NUMBER "AV1 experiment flag.")
......
......@@ -274,8 +274,7 @@ int main(int argc, const char **argv) {
int cts_each_dim[10];
/* Intra mode (keyframe luma) */
#if CONFIG_KF_CTX
/* Intra mode (keyframe luma) */
cts_each_dim[0] = KF_MODE_CONTEXTS;
cts_each_dim[1] = KF_MODE_CONTEXTS;
cts_each_dim[2] = INTRA_MODES;
......@@ -283,15 +282,6 @@ int main(int argc, const char **argv) {
"const aom_cdf_prob\n"
"default_kf_y_mode_cdf[KF_MODE_CONTEXTS][KF_MODE_CONTEXTS]"
"[CDF_SIZE(INTRA_MODES)]");
#else
cts_each_dim[0] = INTRA_MODES;
cts_each_dim[1] = INTRA_MODES;
cts_each_dim[2] = INTRA_MODES;
optimize_cdf_table(
&fc.kf_y_mode[0][0][0], probsfile, 3, cts_each_dim,
"const aom_cdf_prob\n"
"default_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES][CDF_SIZE(INTRA_MODES)]");
#endif
cts_each_dim[0] = DIRECTIONAL_MODES;
cts_each_dim[1] = 2 * MAX_ANGLE_DELTA + 1;
......
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