### Add macro to build a simple cdf table.

```Add the av1_tree_to_cdf() macro which takes a aom_tree_index tree and
associated aom_prob probabilities and constructs a daala uint16_t cdf.
The av1_tree_to_cdf_1D() and av1_tree_to_cdf_2D() apply av1_tree_to_cdf()
across 1D and 2D arrays respectively.

Change-Id: If79fa5ae034263f279d7d0842493570885272fb2```
parent 43acafde
 ... ... @@ -100,6 +100,33 @@ void aom_tree_merge_probs(const aom_tree_index *tree, const aom_prob *pre_probs, int tree_to_cdf(const aom_tree_index *tree, const aom_prob *probs, aom_tree_index root, uint16_t *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) { aom_tree_index index; int path; int dist; tree_to_cdf(tree, probs, 0, cdf, index, path, dist); } #define av1_tree_to_cdf_1D(tree, probs, cdf, u) \ do { \ int i; \ for (i = 0; i < u; i++) { \ av1_tree_to_cdf(tree, probs[i], cdf[i]); \ } \ } while (0) #define av1_tree_to_cdf_2D(tree, probs, cdf, u, v) \ do { \ int j; \ int i; \ for (j = 0; j < v; j++) { \ for (i = 0; i < u; i++) { \ av1_tree_to_cdf(tree, probs[j][i], cdf[j][i]); \ } \ } \ } while (0) #endif DECLARE_ALIGNED(16, extern const uint8_t, aom_norm); ... ...
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