Move tree writing code into bitwriter.h.
Rename av1_write_tree() to aom_write_tree() and move it into bitwriter.h
to match aom_read_tree() in bitreader.h.
Manually cherry-picked from aom/master:
33a143fa7ac42d62080bfc20468cb76ad26045db
Change-Id: I6c686cdd3e0f179d7e95c5bc6984558b62d46d67
diff --git a/aom_dsp/bitreader.h b/aom_dsp/bitreader.h
index 611949a..d062e07 100644
--- a/aom_dsp/bitreader.h
+++ b/aom_dsp/bitreader.h
@@ -90,8 +90,8 @@
return literal;
}
-static INLINE int aom_read_tree(aom_reader *r, const aom_tree_index *tree,
- const aom_prob *probs) {
+static INLINE int aom_read_tree_bits(aom_reader *r, const aom_tree_index *tree,
+ const aom_prob *probs) {
aom_tree_index i = 0;
while ((i = tree[i + aom_read(r, probs[i >> 1])]) > 0) continue;
@@ -99,6 +99,11 @@
return -i;
}
+static INLINE int aom_read_tree(aom_reader *r, const aom_tree_index *tree,
+ const aom_prob *probs) {
+ return aom_read_tree_bits(r, tree, probs);
+}
+
#ifdef __cplusplus
} // extern "C"
#endif