Commit 5bb3a74a authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge

Remove the symbol counts for intra with EC_ADAPT.

This commit has no change to metrics.

Change-Id: I363f18698117dc9c3de10e3ae46cbc5a6ce840d0
parent 788ed89f
......@@ -335,11 +335,13 @@ typedef struct frame_contexts {
} FRAME_CONTEXT;
typedef struct FRAME_COUNTS {
// Note: This structure should only contain 'unsigned int' fields, or
// aggregates built solely from 'unsigned int' fields/elements
// Note: This structure should only contain 'unsigned int' fields, or
// aggregates built solely from 'unsigned int' fields/elements
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
unsigned int kf_y_mode[INTRA_MODES][INTRA_MODES][INTRA_MODES];
unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
#if CONFIG_EXT_PARTITION_TYPES
unsigned int partition[PARTITION_CONTEXTS][EXT_PARTITION_TYPES];
#else
......
......@@ -5225,10 +5225,12 @@ static void debug_check_frame_counts(const AV1_COMMON *const cm) {
av1_zero(zero_counts);
assert(cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_BACKWARD ||
cm->error_resilient_mode);
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
assert(!memcmp(cm->counts.y_mode, zero_counts.y_mode,
sizeof(cm->counts.y_mode)));
assert(!memcmp(cm->counts.uv_mode, zero_counts.uv_mode,
sizeof(cm->counts.uv_mode)));
#endif
assert(!memcmp(cm->counts.partition, zero_counts.partition,
sizeof(cm->counts.partition)));
assert(!memcmp(cm->counts.coef, zero_counts.coef, sizeof(cm->counts.coef)));
......
......@@ -145,8 +145,13 @@ static PREDICTION_MODE read_intra_mode_y(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
aom_reader *r, int size_group) {
const PREDICTION_MODE y_mode =
read_intra_mode(r, ec_ctx->y_mode_cdf[size_group]);
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
FRAME_COUNTS *counts = xd->counts;
if (counts) ++counts->y_mode[size_group][y_mode];
#else
/* TODO(negge): Can we remove this parameter? */
(void)xd;
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
return y_mode;
}
......@@ -155,8 +160,13 @@ static PREDICTION_MODE read_intra_mode_uv(FRAME_CONTEXT *ec_ctx,
PREDICTION_MODE y_mode) {
const PREDICTION_MODE uv_mode =
read_intra_mode(r, ec_ctx->uv_mode_cdf[y_mode]);
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
FRAME_COUNTS *counts = xd->counts;
if (counts) ++counts->uv_mode[y_mode][uv_mode];
#else
/* TODO(negge): Can we remove this parameter? */
(void)xd;
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
return uv_mode;
}
......
......@@ -5441,12 +5441,20 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
const MODE_INFO *left_mi, const int intraonly,
const int mi_row, const int mi_col) {
const MB_MODE_INFO *const mbmi = &mi->mbmi;
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
const PREDICTION_MODE y_mode = mbmi->mode;
const PREDICTION_MODE uv_mode = mbmi->uv_mode;
#else
(void)counts;
(void)above_mi;
(void)left_mi;
(void)intraonly;
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
const BLOCK_SIZE bsize = mbmi->sb_type;
const int unify_bsize = CONFIG_CB4X4;
if (bsize < BLOCK_8X8 && !unify_bsize) {
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
int idx, idy;
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
const int num_4x4_h = num_4x4_blocks_high_lookup[bsize];
......@@ -5462,7 +5470,9 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
++counts->y_mode[0][bmode];
}
}
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
} else {
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
if (intraonly) {
const PREDICTION_MODE above = av1_above_block_mode(mi, above_mi, 0);
const PREDICTION_MODE left = av1_left_block_mode(mi, left_mi, 0);
......@@ -5470,6 +5480,7 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
} else {
++counts->y_mode[size_group_lookup[bsize]][y_mode];
}
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
#if CONFIG_FILTER_INTRA
if (mbmi->mode == DC_PRED
#if CONFIG_PALETTE
......@@ -5515,7 +5526,9 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
(void)mi_col;
(void)xd;
#endif
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
++counts->uv_mode[y_mode][uv_mode];
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
}
#if CONFIG_VAR_TX
......
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