Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathis Rosenhauer
libaec
Commits
12a94f75
Commit
12a94f75
authored
Feb 06, 2014
by
Mathis Rosenhauer
Browse files
56 bits for FS are not enough for lage block situations. Fixed
parent
67aee429
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/decode.c
View file @
12a94f75
...
...
@@ -271,16 +271,23 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
*/
uint32_t
fs
=
0
;
#ifdef HAVE_DECL___BUILTIN_CLZLL
uint32_t
clz
;
#endif
struct
internal_state
*
state
=
strm
->
state
;
state
->
acc
&=
((
1ULL
<<
state
->
bitp
)
-
1
);
if
(
state
->
acc
==
0
)
while
(
state
->
acc
==
0
)
{
fs
+=
state
->
bitp
;
state
->
bitp
=
0
;
fill_acc
(
strm
);
}
#ifdef HAVE_DECL___BUILTIN_CLZLL
fs
=
__builtin_clzll
(
state
->
acc
)
-
(
64
-
state
->
bitp
);
state
->
bitp
-=
fs
+
1
;
clz
=
__builtin_clzll
(
state
->
acc
);
fs
+=
clz
+
state
->
bitp
-
64
;
state
->
bitp
=
63
-
clz
;
#else
state
->
bitp
--
;
while
((
state
->
acc
&
(
1ULL
<<
state
->
bitp
))
==
0
)
{
...
...
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