Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
83006eec
Commit
83006eec
authored
Mar 21, 2008
by
Jean-Marc Valin
Browse files
fixed-point: using TI intrinsic for celt_ilog2() if available.
parent
983f6387
Changes
2
Hide whitespace changes
Inline
Side-by-side
libcelt/fixed_c5x.h
View file @
83006eec
...
@@ -59,4 +59,7 @@
...
@@ -59,4 +59,7 @@
#undef MULT_16_16
#undef MULT_16_16
#define MULT_16_16(a,b) _lmpy(a,b)
#define MULT_16_16(a,b) _lmpy(a,b)
#define celt_ilog2(x) (30 - _lnorm(x))
#define OVERRIDE_CELT_ILOG2
#endif
/* FIXED_C5X_H */
#endif
/* FIXED_C5X_H */
libcelt/mathops.h
View file @
83006eec
...
@@ -55,12 +55,15 @@
...
@@ -55,12 +55,15 @@
#include "entcode.h"
#include "entcode.h"
#include "os_support.h"
#include "os_support.h"
#ifndef OVERRIDE_CELT_ILOG2
/** Integer log in base2. Undefined for zero and negative numbers */
/** Integer log in base2. Undefined for zero and negative numbers */
static
inline
celt_int16_t
celt_ilog2
(
celt_word32_t
x
)
static
inline
celt_int16_t
celt_ilog2
(
celt_word32_t
x
)
{
{
celt_assert2
(
x
>
0
,
"celt_ilog2() only defined for strictly positive numbers"
);
celt_assert2
(
x
>
0
,
"celt_ilog2() only defined for strictly positive numbers"
);
return
EC_ILOG
(
x
)
-
1
;
return
EC_ILOG
(
x
)
-
1
;
}
}
#endif
/** Integer log in base2. Defined for zero, but not for negative numbers */
/** Integer log in base2. Defined for zero, but not for negative numbers */
static
inline
celt_int16_t
celt_zlog2
(
celt_word32_t
x
)
static
inline
celt_int16_t
celt_zlog2
(
celt_word32_t
x
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment