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
b94e56ea
Commit
b94e56ea
authored
Oct 29, 2014
by
Mathis Rosenhauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase code sharing between CLZ implementations.
parent
b9f9312b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
src/decode.c
src/decode.c
+11
-15
No files found.
src/decode.c
View file @
b94e56ea
...
@@ -271,10 +271,10 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
...
@@ -271,10 +271,10 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
*/
*/
uint32_t
fs
=
0
;
uint32_t
fs
=
0
;
#if HAVE_
DECL___BUILTIN_CLZLL
#if HAVE_
BSR64
int
lz
;
unsigned
long
i
;
#el
if HAVE_BSR64
#el
se
unsigned
long
lz
;
int
i
;
#endif
#endif
struct
internal_state
*
state
=
strm
->
state
;
struct
internal_state
*
state
=
strm
->
state
;
...
@@ -290,20 +290,16 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
...
@@ -290,20 +290,16 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
}
}
#if HAVE_DECL___BUILTIN_CLZLL
#if HAVE_DECL___BUILTIN_CLZLL
lz
=
__builtin_clzll
(
state
->
acc
);
i
=
63
-
__builtin_clzll
(
state
->
acc
);
fs
+=
lz
+
state
->
bitp
-
64
;
state
->
bitp
=
63
-
lz
;
#elif HAVE_BSR64
#elif HAVE_BSR64
_BitScanReverse64
(
&
lz
,
state
->
acc
);
_BitScanReverse64
(
&
i
,
state
->
acc
);
fs
+=
state
->
bitp
-
1
-
lz
;
state
->
bitp
=
lz
;
#else
#else
state
->
bitp
--
;
i
=
state
->
bitp
-
1
;
while
((
state
->
acc
&
(
UINT64_C
(
1
)
<<
state
->
bitp
))
==
0
)
{
while
((
state
->
acc
&
(
UINT64_C
(
1
)
<<
i
))
==
0
)
state
->
bitp
--
;
i
--
;
fs
++
;
}
#endif
#endif
fs
+=
state
->
bitp
-
i
-
1
;
state
->
bitp
=
i
;
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