summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_systemdependent.h
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2012-12-13 14:51:27 -0800
committerYaowu Xu <yaowu@google.com>2012-12-13 15:15:56 -0800
commitc681887652abbf750f72f11e35d37a86f42e1fb8 (patch)
treefc8e368510c28b7c3097962c2aae6e3ceb4d1a94 /vp9/common/vp9_systemdependent.h
parent7fa3deb1f5a4d131e590b871bc2012f54bb5379b (diff)
downloadlibvpx-c681887652abbf750f72f11e35d37a86f42e1fb8.tar
libvpx-c681887652abbf750f72f11e35d37a86f42e1fb8.tar.gz
libvpx-c681887652abbf750f72f11e35d37a86f42e1fb8.tar.bz2
libvpx-c681887652abbf750f72f11e35d37a86f42e1fb8.zip
fixed build issue with round()
not defined in msvc Change-Id: I8fe8462a0c2f636d8b43c0243832ca67578f3665
Diffstat (limited to 'vp9/common/vp9_systemdependent.h')
-rw-r--r--vp9/common/vp9_systemdependent.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/vp9/common/vp9_systemdependent.h b/vp9/common/vp9_systemdependent.h
index 91a50607a..5bc6237e6 100644
--- a/vp9/common/vp9_systemdependent.h
+++ b/vp9/common/vp9_systemdependent.h
@@ -10,6 +10,10 @@
#ifndef VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
#define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
+#ifdef _MSC_VER
+#include <math.h>
+#endif
+
#include "vpx_ports/config.h"
#if ARCH_X86 || ARCH_X86_64
void vpx_reset_mmx_state(void);
@@ -18,6 +22,16 @@ void vpx_reset_mmx_state(void);
#define vp9_clear_system_state()
#endif
+#ifdef _MSC_VER
+// round is not defined in MSVC
+static int round(double x) {
+ if (x < 0)
+ return (int)ceil(x - 0.5);
+ else
+ return (int)floor(x + 0.5);
+}
+#endif
+
struct VP9Common;
void vp9_machine_specific_config(struct VP9Common *);
#endif