Commit 87aeeb85 authored by Thomas Davies's avatar Thomas Davies
Browse files

Use default CDF tables when initialising coef probs.

When creating the CDF head, do not use 8-bit probabilities
to make the CDF tables, but load them directly.

CDF tail values are created from the ONE_TOKEN relative
probability as before.

No change to BDR.

Change-Id: I7386b8952f6f69cc9b77aa1b2bee71cf8e3cc9ff
parent c21acce2
This diff is collapsed.
...@@ -215,6 +215,9 @@ extern const aom_cdf_prob av1_pareto8_token_probs[COEFF_PROB_MODELS] ...@@ -215,6 +215,9 @@ extern const aom_cdf_prob av1_pareto8_token_probs[COEFF_PROB_MODELS]
extern const aom_cdf_prob av1_pareto8_tail_probs[COEFF_PROB_MODELS] extern const aom_cdf_prob av1_pareto8_tail_probs[COEFF_PROB_MODELS]
[ENTROPY_TOKENS - 3]; [ENTROPY_TOKENS - 3];
struct frame_contexts; struct frame_contexts;
#if CONFIG_NEW_TOKENSET
void av1_coef_head_cdfs(struct frame_contexts *fc);
#endif
void av1_coef_pareto_cdfs(struct frame_contexts *fc); void av1_coef_pareto_cdfs(struct frame_contexts *fc);
#endif // CONFIG_EC_MULTISYMBOL #endif // CONFIG_EC_MULTISYMBOL
......
...@@ -4713,6 +4713,10 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data, ...@@ -4713,6 +4713,10 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#endif // EC_ADAPT, DAALA_EC #endif // EC_ADAPT, DAALA_EC
} }
#if CONFIG_EC_MULTISYMBOL #if CONFIG_EC_MULTISYMBOL
#if CONFIG_NEW_TOKENSET
av1_coef_head_cdfs(fc);
#endif
/* Make tail distribution from head */
av1_coef_pareto_cdfs(fc); av1_coef_pareto_cdfs(fc);
#if CONFIG_REF_MV #if CONFIG_REF_MV
for (i = 0; i < NMV_CONTEXTS; ++i) av1_set_mv_cdfs(&fc->nmvc[i]); for (i = 0; i < NMV_CONTEXTS; ++i) av1_set_mv_cdfs(&fc->nmvc[i]);
......
...@@ -3302,9 +3302,6 @@ static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) { ...@@ -3302,9 +3302,6 @@ static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) {
const TX_MODE tx_mode = cpi->common.tx_mode; const TX_MODE tx_mode = cpi->common.tx_mode;
const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode]; const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
TX_SIZE tx_size; TX_SIZE tx_size;
#if CONFIG_EC_MULTISYMBOL
int update = 0;
#endif // CONFIG_EC_MULTISYMBOL
#if CONFIG_ENTROPY #if CONFIG_ENTROPY
AV1_COMMON *cm = &cpi->common; AV1_COMMON *cm = &cpi->common;
SUBFRAME_STATS *subframe_stats = &cpi->subframe_stats; SUBFRAME_STATS *subframe_stats = &cpi->subframe_stats;
...@@ -3352,18 +3349,12 @@ static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) { ...@@ -3352,18 +3349,12 @@ static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) {
update_coef_probs_subframe(w, cpi, tx_size, cpi->branch_ct_buf, update_coef_probs_subframe(w, cpi, tx_size, cpi->branch_ct_buf,
frame_coef_probs); frame_coef_probs);
#if CONFIG_EC_MULTISYMBOL
update = 1;
#endif // CONFIG_EC_MULTISYMBOL
} else { } else {
#endif // CONFIG_ENTROPY #endif // CONFIG_ENTROPY
build_tree_distribution(cpi, tx_size, frame_branch_ct, build_tree_distribution(cpi, tx_size, frame_branch_ct,
frame_coef_probs); frame_coef_probs);
update_coef_probs_common(w, cpi, tx_size, frame_branch_ct, update_coef_probs_common(w, cpi, tx_size, frame_branch_ct,
frame_coef_probs); frame_coef_probs);
#if CONFIG_EC_MULTISYMBOL
update = 1;
#endif // CONFIG_EC_MULTISYMBOL
#if CONFIG_ENTROPY #if CONFIG_ENTROPY
} }
#endif // CONFIG_ENTROPY #endif // CONFIG_ENTROPY
...@@ -3390,9 +3381,6 @@ static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) { ...@@ -3390,9 +3381,6 @@ static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) {
av1_copy(cm->counts.eob_branch, eob_counts_copy); av1_copy(cm->counts.eob_branch, eob_counts_copy);
} }
#endif // CONFIG_ENTROPY #endif // CONFIG_ENTROPY
#if CONFIG_EC_MULTISYMBOL
if (update) av1_coef_pareto_cdfs(cpi->common.fc);
#endif // CONFIG_EC_MULTISYMBOL
} }
#endif #endif
#endif // !CONFIG_EC_ADAPT #endif // !CONFIG_EC_ADAPT
...@@ -4886,6 +4874,9 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) { ...@@ -4886,6 +4874,9 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
} }
#if CONFIG_EC_MULTISYMBOL #if CONFIG_EC_MULTISYMBOL
#if CONFIG_NEW_TOKENSET
av1_coef_head_cdfs(fc);
#endif
av1_coef_pareto_cdfs(fc); av1_coef_pareto_cdfs(fc);
#if CONFIG_REF_MV #if CONFIG_REF_MV
for (i = 0; i < NMV_CONTEXTS; ++i) av1_set_mv_cdfs(&fc->nmvc[i]); for (i = 0; i < NMV_CONTEXTS; ++i) av1_set_mv_cdfs(&fc->nmvc[i]);
......
Supports Markdown
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