Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
libaec
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mathis Rosenhauer
libaec
Commits
69837c2f
Commit
69837c2f
authored
Dec 07, 2012
by
Mathis Rosenhauer
Committed by
Thomas Jahns
Feb 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use gcc intrinsic for BSR. TODO: look into gcc sources for better C version
parent
ce2f70dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
configure.ac
configure.ac
+10
-0
src/decode.c
src/decode.c
+8
-2
No files found.
configure.ac
View file @
69837c2f
...
@@ -30,6 +30,16 @@ AC_TYPE_UINT8_T
...
@@ -30,6 +30,16 @@ AC_TYPE_UINT8_T
# Checks for library functions.
# Checks for library functions.
AC_CHECK_FUNCS([memset strstr])
AC_CHECK_FUNCS([memset strstr])
AC_MSG_CHECKING(for __builtin_clzl)
AC_TRY_LINK([],[
__builtin_clzl(1);
],[
AC_DEFINE(AEC_HAVE___BUILTIN_CLZL, 1, \
[Define to 1 if you have the '__builtin__clzl' function.])
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
])
AC_CONFIG_FILES([Makefile \
AC_CONFIG_FILES([Makefile \
src/Makefile \
src/Makefile \
...
...
src/decode.c
View file @
69837c2f
...
@@ -255,15 +255,21 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
...
@@ -255,15 +255,21 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
uint32_t
fs
=
0
;
uint32_t
fs
=
0
;
struct
internal_state
*
state
=
strm
->
state
;
struct
internal_state
*
state
=
strm
->
state
;
if
((
state
->
acc
&
((
1ULL
<<
state
->
bitp
)
-
1
))
==
0
)
state
->
acc
&=
((
1ULL
<<
state
->
bitp
)
-
1
);
if
(
state
->
acc
==
0
)
fill_acc
(
strm
);
fill_acc
(
strm
);
#ifdef AEC_HAVE___BUILTIN_CLZL
fs
=
__builtin_clzll
(
state
->
acc
)
-
(
64
-
state
->
bitp
);
state
->
bitp
-=
fs
+
1
;
#else
state
->
bitp
--
;
state
->
bitp
--
;
while
((
state
->
acc
&
(
1ULL
<<
state
->
bitp
))
==
0
)
{
while
((
state
->
acc
&
(
1ULL
<<
state
->
bitp
))
==
0
)
{
state
->
bitp
--
;
state
->
bitp
--
;
fs
++
;
fs
++
;
}
}
#endif
return
fs
;
return
fs
;
}
}
...
...
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