Create aom_cdf_prob type for 16-bit probabilities.

Change-Id: I33899eca44300037816c9f20c965aa8311a1ef52
diff --git a/aom_dsp/daalaboolreader.h b/aom_dsp/daalaboolreader.h
index cb7581e..0ed0de4 100644
--- a/aom_dsp/daalaboolreader.h
+++ b/aom_dsp/daalaboolreader.h
@@ -52,7 +52,7 @@
                                        const aom_prob *probs) {
   aom_tree_index i = 0;
   do {
-    uint16_t cdf[16];
+    aom_cdf_prob cdf[16];
     aom_tree_index index[16];
     int path[16];
     int dist[16];
@@ -66,7 +66,7 @@
   return -i;
 }
 
-static INLINE int daala_read_symbol(daala_reader *r, const uint16_t *cdf,
+static INLINE int daala_read_symbol(daala_reader *r, const aom_cdf_prob *cdf,
                                     int nsymbs) {
   return od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs, "aom");
 }
diff --git a/aom_dsp/daalaboolwriter.h b/aom_dsp/daalaboolwriter.h
index c80cd4f..5183a90 100644
--- a/aom_dsp/daalaboolwriter.h
+++ b/aom_dsp/daalaboolwriter.h
@@ -46,7 +46,7 @@
   aom_tree_index root;
   root = i;
   do {
-    uint16_t cdf[16];
+    aom_cdf_prob cdf[16];
     aom_tree_index index[16];
     int path[16];
     int dist[16];
@@ -79,7 +79,7 @@
 }
 
 static INLINE void daala_write_symbol(daala_writer *w, int symb,
-                                      const uint16_t *cdf, int nsymbs) {
+                                      const aom_cdf_prob *cdf, int nsymbs) {
   od_ec_encode_cdf_q15(&w->ec, symb, cdf, nsymbs);
 }
 
diff --git a/aom_dsp/prob.c b/aom_dsp/prob.c
index d65ace8..d3556cb 100644
--- a/aom_dsp/prob.c
+++ b/aom_dsp/prob.c
@@ -68,7 +68,7 @@
   int len;
   int l;
   int r;
-  uint16_t pdf;
+  aom_cdf_prob pdf;
 };
 
 /* Compute the probability of this node in Q23 */
@@ -96,7 +96,8 @@
 /* Given a Q15 probability for symbol subtree rooted at tree[n], this function
     computes the probability of each symbol (defined as a node that has no
     children). */
-static uint16_t tree_node_compute_probs(tree_node *tree, int n, uint16_t pdf) {
+static aom_cdf_prob tree_node_compute_probs(tree_node *tree, int n,
+                                            aom_cdf_prob pdf) {
   if (tree[n].l == 0) {
     /* This prevents probability computations in Q15 that underflow from
         producing a symbol that has zero probability. */
@@ -106,15 +107,15 @@
   } else {
     /* We process the smaller probability first,  */
     if (tree[n].prob < 128) {
-      uint16_t lp;
-      uint16_t rp;
+      aom_cdf_prob lp;
+      aom_cdf_prob rp;
       lp = (((uint32_t)pdf) * tree[n].prob + 128) >> 8;
       lp = tree_node_compute_probs(tree, tree[n].l, lp);
       rp = tree_node_compute_probs(tree, tree[n].r, lp > pdf ? 0 : pdf - lp);
       return lp + rp;
     } else {
-      uint16_t rp;
-      uint16_t lp;
+      aom_cdf_prob rp;
+      aom_cdf_prob lp;
       rp = (((uint32_t)pdf) * (256 - tree[n].prob) + 128) >> 8;
       rp = tree_node_compute_probs(tree, tree[n].r, rp);
       lp = tree_node_compute_probs(tree, tree[n].l, rp > pdf ? 0 : pdf - rp);
@@ -123,8 +124,9 @@
   }
 }
 
-static int tree_node_extract(tree_node *tree, int n, int symb, uint16_t *pdf,
-                             aom_tree_index *index, int *path, int *len) {
+static int tree_node_extract(tree_node *tree, int n, int symb,
+                             aom_cdf_prob *pdf, aom_tree_index *index,
+                             int *path, int *len) {
   if (tree[n].l == 0) {
     pdf[symb] = tree[n].pdf;
     if (index != NULL) index[symb] = tree[n].index;
@@ -138,7 +140,7 @@
 }
 
 int tree_to_cdf(const aom_tree_index *tree, const aom_prob *probs,
-                aom_tree_index root, uint16_t *cdf, aom_tree_index *index,
+                aom_tree_index root, aom_cdf_prob *cdf, aom_tree_index *index,
                 int *path, int *len) {
   tree_node symb[2 * 16 - 1];
   int nodes;
diff --git a/aom_dsp/prob.h b/aom_dsp/prob.h
index 3ae34b8..bf9abbf 100644
--- a/aom_dsp/prob.h
+++ b/aom_dsp/prob.h
@@ -98,11 +98,11 @@
 
 #if CONFIG_DAALA_EC
 int tree_to_cdf(const aom_tree_index *tree, const aom_prob *probs,
-                aom_tree_index root, uint16_t *cdf, aom_tree_index *ind,
+                aom_tree_index root, aom_cdf_prob *cdf, aom_tree_index *ind,
                 int *pth, int *len);
 
 static INLINE void av1_tree_to_cdf(const aom_tree_index *tree,
-                                   const aom_prob *probs, uint16_t *cdf) {
+                                   const aom_prob *probs, aom_cdf_prob *cdf) {
   aom_tree_index index[16];
   int path[16];
   int dist[16];
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 77c73bf..7821b39 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -55,9 +55,6 @@
 #else
   aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
 #endif
-#if CONFIG_DAALA_EC
-  uint16_t partition_cdf[PARTITION_CONTEXTS][PARTITION_TYPES];
-#endif
   av1_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
 #if CONFIG_ANS || CONFIG_DAALA_EC
   coeff_cdf_model coef_cdfs[TX_SIZES][PLANE_TYPES];
@@ -135,10 +132,11 @@
   aom_prob switchable_restore_prob[RESTORE_SWITCHABLE_TYPES - 1];
 #endif  // CONFIG_LOOP_RESTORATION
 #if CONFIG_DAALA_EC
-  uint16_t switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS]
-                                [SWITCHABLE_FILTERS];
-  uint16_t intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][TX_TYPES];
-  uint16_t inter_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES];
+  aom_cdf_prob partition_cdf[PARTITION_CONTEXTS][PARTITION_TYPES];
+  aom_cdf_prob
+      switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
+  aom_cdf_prob intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][TX_TYPES];
+  aom_cdf_prob inter_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES];
 #endif
 } FRAME_CONTEXT;