Commit 2bdb9e63 authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review

Merge changes Ie43c599f,Icd0dbed4,Ic04e180b into nextgenv2

* changes:
  Move av1_indices_from_tree() to common code space.
  Add code to compute in-order mappings for tokens.
  Fix bug in av1_tree_to_cdf_2D() macro.
parents 73d702db 8abf8673
......@@ -205,4 +205,20 @@ int tree_to_cdf(const aom_tree_index *tree, const aom_prob *probs,
}
return nsymbs;
}
/* This code assumes that tree contains as unique leaf nodes the integer values
0 to len - 1 and produces the forward and inverse mapping tables in ind[]
and inv[] respectively. */
void av1_indices_from_tree(int *ind, int *inv, int len,
const aom_tree_index *tree) {
int i;
int index;
for (i = index = 0; i < TREE_SIZE(len); i++) {
const aom_tree_index j = tree[i];
if (j <= 0) {
inv[index] = -j;
ind[-j] = index++;
}
}
}
#endif
......@@ -117,7 +117,7 @@ static INLINE void av1_tree_to_cdf(const aom_tree_index *tree,
} \
} while (0)
#define av1_tree_to_cdf_2D(tree, probs, cdf, u, v) \
#define av1_tree_to_cdf_2D(tree, probs, cdf, v, u) \
do { \
int j; \
int i; \
......@@ -127,6 +127,9 @@ static INLINE void av1_tree_to_cdf(const aom_tree_index *tree,
} \
} \
} while (0)
void av1_indices_from_tree(int *ind, int *inv, int len,
const aom_tree_index *tree);
#endif
DECLARE_ALIGNED(16, extern const uint8_t, aom_norm[256]);
......
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