Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VVCSoftware_VTM
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jvet
VVCSoftware_VTM
Commits
e6fc135b
Commit
e6fc135b
authored
5 years ago
by
Karsten Suehring
Browse files
Options
Downloads
Patches
Plain Diff
handle x==0 case in ceilLog2()
parent
dc6eb6e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!881
refactor ceil/floor log2 handling
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Lib/CommonLib/CommonDef.h
+2
-1
2 additions, 1 deletion
source/Lib/CommonLib/CommonDef.h
with
2 additions
and
1 deletion
source/Lib/CommonLib/CommonDef.h
+
2
−
1
View file @
e6fc135b
...
...
@@ -685,6 +685,7 @@ static inline int floorLog2(uint32_t x)
{
if
(
x
==
0
)
{
// note: ceilLog2() expects -1 as return value
return
-
1
;
}
#ifdef __GNUC__
...
...
@@ -728,7 +729,7 @@ static inline int floorLog2(uint32_t x)
static
inline
int
ceilLog2
(
uint32_t
x
)
{
return
floorLog2
(
x
-
1
)
+
1
;
return
(
x
==
0
)
?
-
1
:
floorLog2
(
x
-
1
);
}
...
...
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