Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/celt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy B. Terriberry <tterribe@xiph.org>2011-03-01 23:54:04 +0300
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2011-03-02 02:13:48 +0300
commit6c8acbf1f2185d2e362df120131ed05d7c6556d3 (patch)
tree656046f2eaf411741c6f439f43ef9353ff4d5063
parent3beb70e54926899dc67f46005662c663babf4bf4 (diff)
EC_ILOG cleanups.
Mark _BitScanReverse as an intrinsic, as this is not done by default in _DEBUG mode (thanks to Bjoern D. Rasmussen for the suggestion). Move the declaration of ec_ilog() to where the macro using it is defined, to ensure it is available when the macro is used. Thanks to John Ridges for the report.
-rw-r--r--libcelt/ecintrin.h5
-rw-r--r--libcelt/entcode.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/libcelt/ecintrin.h b/libcelt/ecintrin.h
index 4591d07..9222a3c 100644
--- a/libcelt/ecintrin.h
+++ b/libcelt/ecintrin.h
@@ -81,6 +81,9 @@
All other code should use EC_ILOG() instead.*/
#if defined(_MSC_VER)
# include <intrin.h>
+/*In _DEBUG mode this is not an intrinsic by default.*/
+# pragma intrinsic(_BitScanReverse)
+
static __inline int ec_bsr(unsigned long _x){
unsigned long ret;
_BitScanReverse(&ret,_x);
@@ -111,6 +114,8 @@ static __inline int ec_bsr(unsigned long _x){
When we need to, it can be special cased.*/
# define EC_ILOG(_x) (EC_CLZ0-EC_CLZ(_x))
#else
+int ec_ilog(ec_uint32 _v);
+
# define EC_ILOG(_x) (ec_ilog(_x))
#endif
diff --git a/libcelt/entcode.h b/libcelt/entcode.h
index 581a07b..56f7ffe 100644
--- a/libcelt/entcode.h
+++ b/libcelt/entcode.h
@@ -127,6 +127,4 @@ static inline int ec_tell(ec_ctx *_this){
rounding error is in the positive direction).*/
ec_uint32 ec_tell_frac(ec_ctx *_this);
-int ec_ilog(ec_uint32 _v);
-
#endif