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
Stefan Strogin
flac
Commits
bf26db91
Commit
bf26db91
authored
Oct 04, 2002
by
Josh Coalson
Browse files
add wide version of silog2
parent
881a36d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libFLAC/bitmath.c
View file @
bf26db91
...
...
@@ -98,3 +98,27 @@ unsigned FLAC__bitmath_silog2(int v)
}
}
}
unsigned
FLAC__bitmath_silog2_wide
(
FLAC__int64
v
)
{
while
(
1
)
{
if
(
v
==
0
)
{
return
0
;
}
else
if
(
v
>
0
)
{
unsigned
l
=
0
;
while
(
v
)
{
l
++
;
v
>>=
1
;
}
return
l
+
1
;
}
else
if
(
v
==
-
1
)
{
return
2
;
}
else
{
v
++
;
v
=
-
v
;
}
}
}
src/libFLAC/include/private/bitmath.h
View file @
bf26db91
...
...
@@ -24,5 +24,6 @@
unsigned
FLAC__bitmath_ilog2
(
unsigned
v
);
unsigned
FLAC__bitmath_silog2
(
int
v
);
unsigned
FLAC__bitmath_silog2_wide
(
FLAC__int64
v
);
#endif
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