diff options
author | Yaowu Xu <yaowu@google.com> | 2012-12-13 14:51:27 -0800 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2012-12-13 15:15:56 -0800 |
commit | c681887652abbf750f72f11e35d37a86f42e1fb8 (patch) | |
tree | fc8e368510c28b7c3097962c2aae6e3ceb4d1a94 /vp9/common/vp9_systemdependent.h | |
parent | 7fa3deb1f5a4d131e590b871bc2012f54bb5379b (diff) | |
download | libvpx-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.h | 14 |
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 |