Update y_mode_cdf tables once per frame.
Move computing the y_mode_cdf tables per coded intra mode symbol to
computing them only when the probabilities are updated.
Change-Id: I8c43d09b8ef5febe2a3ec64bd51d28bd78ea73ed
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index b579934..060c79c 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -3817,9 +3817,14 @@
read_frame_reference_mode_probs(cm, &r);
- for (j = 0; j < BLOCK_SIZE_GROUPS; j++)
+ for (j = 0; j < BLOCK_SIZE_GROUPS; j++) {
for (i = 0; i < INTRA_MODES - 1; ++i)
av1_diff_update_prob(&r, &fc->y_mode_prob[j][i], ACCT_STR);
+#if CONFIG_DAALA_EC
+ av1_tree_to_cdf(av1_intra_mode_tree, fc->y_mode_prob[j],
+ fc->y_mode_cdf[j]);
+#endif
+ }
#if CONFIG_REF_MV
for (i = 0; i < NMV_CONTEXTS; ++i)
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index 68eb482..9d8bb5c 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -91,7 +91,11 @@
static PREDICTION_MODE read_intra_mode_y(AV1_COMMON *cm, MACROBLOCKD *xd,
aom_reader *r, int size_group) {
const PREDICTION_MODE y_mode =
+#if CONFIG_DAALA_EC
+ read_intra_mode_cdf(r, cm->fc->y_mode_cdf[size_group]);
+#else
read_intra_mode(r, cm->fc->y_mode_prob[size_group]);
+#endif
FRAME_COUNTS *counts = xd->counts;
if (counts) ++counts->y_mode[size_group][y_mode];
return y_mode;