summaryrefslogtreecommitdiff
path: root/vp10/common/common.h
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2015-08-06 21:14:07 -0700
committerJingning Han <jingning@google.com>2015-08-11 21:24:08 -0700
commit54d66ef165a86dd23ca4e5e645288f9ef63b7bb0 (patch)
tree05916e9655ce4eb8b7e731bf6a228b2d86f72990 /vp10/common/common.h
parentb522d1cdffdc060b6bef9fceef9b316316b05d9c (diff)
downloadlibvpx-54d66ef165a86dd23ca4e5e645288f9ef63b7bb0.tar
libvpx-54d66ef165a86dd23ca4e5e645288f9ef63b7bb0.tar.gz
libvpx-54d66ef165a86dd23ca4e5e645288f9ef63b7bb0.tar.bz2
libvpx-54d66ef165a86dd23ca4e5e645288f9ef63b7bb0.zip
Remove vp9_ prefix from vp10 files
Remove the vp9_ prefix from vp10 file names. Change-Id: I513a211b286a57d6126fc1b0fbfd6405120014f1
Diffstat (limited to 'vp10/common/common.h')
-rw-r--r--vp10/common/common.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/vp10/common/common.h b/vp10/common/common.h
new file mode 100644
index 000000000..cccf7c229
--- /dev/null
+++ b/vp10/common/common.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2010 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.
+ */
+
+#ifndef VP9_COMMON_VP9_COMMON_H_
+#define VP9_COMMON_VP9_COMMON_H_
+
+/* Interface header for common constant data structures and lookup tables */
+
+#include <assert.h>
+
+#include "./vpx_config.h"
+#include "vpx_dsp/vpx_dsp_common.h"
+#include "vpx_mem/vpx_mem.h"
+#include "vpx/vpx_integer.h"
+#include "vp10/common/systemdependent.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Only need this for fixed-size arrays, for structs just assign.
+#define vp10_copy(dest, src) { \
+ assert(sizeof(dest) == sizeof(src)); \
+ memcpy(dest, src, sizeof(src)); \
+ }
+
+// Use this for variably-sized arrays.
+#define vp10_copy_array(dest, src, n) { \
+ assert(sizeof(*dest) == sizeof(*src)); \
+ memcpy(dest, src, n * sizeof(*src)); \
+ }
+
+#define vp10_zero(dest) memset(&(dest), 0, sizeof(dest))
+#define vp10_zero_array(dest, n) memset(dest, 0, n * sizeof(*dest))
+
+static INLINE int get_unsigned_bits(unsigned int num_values) {
+ return num_values > 0 ? get_msb(num_values) + 1 : 0;
+}
+
+#if CONFIG_DEBUG
+#define CHECK_MEM_ERROR(cm, lval, expr) do { \
+ lval = (expr); \
+ if (!lval) \
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, \
+ "Failed to allocate "#lval" at %s:%d", \
+ __FILE__, __LINE__); \
+ } while (0)
+#else
+#define CHECK_MEM_ERROR(cm, lval, expr) do { \
+ lval = (expr); \
+ if (!lval) \
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, \
+ "Failed to allocate "#lval); \
+ } while (0)
+#endif
+
+#define VP9_SYNC_CODE_0 0x49
+#define VP9_SYNC_CODE_1 0x83
+#define VP9_SYNC_CODE_2 0x42
+
+#define VP9_FRAME_MARKER 0x2
+
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_COMMON_VP9_COMMON_H_