Commit be34c188 authored by James Zern's avatar James Zern Committed by Gerrit Code Review

Merge "vp9_systemdependent.h: relocate system includes"

parents 0dc535ec d89f861f
...@@ -11,13 +11,17 @@ ...@@ -11,13 +11,17 @@
#ifndef VP9_COMMON_VP9_SYSTEMDEPENDENT_H_ #ifndef VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
#define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_ #define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
#ifdef __cplusplus #ifdef _MSC_VER
extern "C" { # if _MSC_VER > 1310 && (defined(_M_X64) || defined(_M_IX86))
# include <intrin.h>
# define USE_MSC_INTRIN
# endif
# include <math.h>
# define snprintf _snprintf
#endif #endif
#ifdef _MSC_VER #ifdef __cplusplus
#include <math.h> extern "C" {
#define snprintf _snprintf
#endif #endif
#include "./vpx_config.h" #include "./vpx_config.h"
...@@ -44,9 +48,7 @@ static int round(double x) { ...@@ -44,9 +48,7 @@ static int round(double x) {
static INLINE int get_msb(unsigned int n) { static INLINE int get_msb(unsigned int n) {
return 31 ^ __builtin_clz(n); return 31 ^ __builtin_clz(n);
} }
#elif defined(_MSC_VER) && _MSC_VER > 1310 && \ #elif defined(USE_MSC_INTRIN)
(defined(_M_X64) || defined(_M_IX86))
#include <intrin.h>
#pragma intrinsic(_BitScanReverse) #pragma intrinsic(_BitScanReverse)
static INLINE int get_msb(unsigned int n) { static INLINE int get_msb(unsigned int n) {
...@@ -54,6 +56,7 @@ static INLINE int get_msb(unsigned int n) { ...@@ -54,6 +56,7 @@ static INLINE int get_msb(unsigned int n) {
_BitScanReverse(&first_set_bit, n); _BitScanReverse(&first_set_bit, n);
return first_set_bit; return first_set_bit;
} }
#undef USE_MSC_INTRIN
#else #else
// Returns (int)floor(log2(n)). n must be > 0. // Returns (int)floor(log2(n)). n must be > 0.
static INLINE int get_msb(unsigned int n) { static INLINE int get_msb(unsigned int n) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment