Port folder renaming changes from AOM
Manually cherry-picked commits:
ceef058 libvpx->libaom part2
3d26d91 libvpx -> libaom
cfea7dd vp10/ -> av1/
3a8eff7 Fix a build issue for a test
bf4202e Rename vpx to aom
Change-Id: I1b0eb5a40796e3aaf41c58984b4229a439a597dc
diff --git a/av1/encoder/buf_ans.c b/av1/encoder/buf_ans.c
new file mode 100644
index 0000000..f87c1e1
--- /dev/null
+++ b/av1/encoder/buf_ans.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <string.h>
+
+#include "av1/common/common.h"
+#include "av1/encoder/buf_ans.h"
+#include "av1/encoder/encoder.h"
+#include "aom_mem/vpx_mem.h"
+
+void vp10_buf_ans_alloc(struct BufAnsCoder *c, struct VP10Common *cm,
+ int size_hint) {
+ c->cm = cm;
+ c->size = size_hint;
+ CHECK_MEM_ERROR(cm, c->buf, vpx_malloc(c->size * sizeof(*c->buf)));
+ // Initialize to overfull to trigger the assert in write.
+ c->offset = c->size + 1;
+}
+
+void vp10_buf_ans_free(struct BufAnsCoder *c) {
+ vpx_free(c->buf);
+ c->buf = NULL;
+ c->size = 0;
+}
+
+void vp10_buf_ans_grow(struct BufAnsCoder *c) {
+ struct buffered_ans_symbol *new_buf = NULL;
+ int new_size = c->size * 2;
+ CHECK_MEM_ERROR(c->cm, new_buf, vpx_malloc(new_size * sizeof(*new_buf)));
+ memcpy(new_buf, c->buf, c->size * sizeof(*c->buf));
+ vpx_free(c->buf);
+ c->buf = new_buf;
+ c->size = new_size;
+}