Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
Opus
Commits
7909d8af
Commit
7909d8af
authored
12 years ago
by
Rafaël Carré
Committed by
Gregory Maxwell
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Guard _MSC_VER tests, remove FLOAT2INT16 when DISABLE_FLOAT_API.
parent
66d429ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
celt/float_cast.h
+4
-2
4 additions, 2 deletions
celt/float_cast.h
include/opus_defines.h
+1
-1
1 addition, 1 deletion
include/opus_defines.h
with
5 additions
and
3 deletions
celt/float_cast.h
+
4
−
2
View file @
7909d8af
...
...
@@ -90,14 +90,14 @@
#include
<math.h>
#define float2int(x) lrint(x)
#elif (_MSC_VER >= 1400) && (defined (WIN64) || defined (_WIN64))
#elif (
defined(_MSC_VER) &&
_MSC_VER >= 1400) && (defined (WIN64) || defined (_WIN64))
#include
<xmmintrin.h>
__inline
long
int
float2int
(
float
value
)
{
return
_mm_cvtss_si32
(
_mm_load_ss
(
&
value
));
}
#elif (_MSC_VER >= 1400) && (defined (WIN32) || defined (_WIN32))
#elif (
defined(_MSC_VER) &&
_MSC_VER >= 1400) && (defined (WIN32) || defined (_WIN32))
#include
<math.h>
/* Win32 doesn't seem to have these functions.
...
...
@@ -127,6 +127,7 @@
#define float2int(flt) ((int)(floor(.5+flt)))
#endif
#ifndef DISABLE_FLOAT_API
static
inline
opus_int16
FLOAT2INT16
(
float
x
)
{
x
=
x
*
CELT_SIG_SCALE
;
...
...
@@ -134,5 +135,6 @@ static inline opus_int16 FLOAT2INT16(float x)
x
=
MIN32
(
x
,
32767
);
return
(
opus_int16
)
float2int
(
x
);
}
#endif
/* DISABLE_FLOAT_API */
#endif
/* FLOAT_CAST_H */
This diff is collapsed.
Click to expand it.
include/opus_defines.h
+
1
−
1
View file @
7909d8af
...
...
@@ -87,7 +87,7 @@ extern "C" {
#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
# if OPUS_GNUC_PREREQ(3,0)
# define OPUS_RESTRICT __restrict__
# elif (_MSC_VER >= 1400)
# elif (
defined(_MSC_VER) &&
_MSC_VER >= 1400)
# define OPUS_RESTRICT __restrict
# else
# define OPUS_RESTRICT
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment