Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
7e54813d
Commit
7e54813d
authored
2 years ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Add const qualifier for constant variable
parent
bbd7795a
No related branches found
No related tags found
1 merge request
!26
Adapt cmp_tool to the chunk decompression
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/cmp_support.c
+6
-6
6 additions, 6 deletions
lib/cmp_support.c
with
6 additions
and
6 deletions
lib/cmp_support.c
+
6
−
6
View file @
7e54813d
...
...
@@ -17,6 +17,7 @@
* @see Data Compression User Manual PLATO-UVIE-PL-UM-0001
*/
#include
<compiler.h>
#include
<cmp_support.h>
#include
<cmp_debug.h>
...
...
@@ -362,8 +363,7 @@ uint32_t cmp_ima_max_spill(unsigned int golomb_par)
452
,
461
,
470
,
479
,
488
,
497
,
506
,
515
,
524
,
533
,
542
,
551
,
560
,
569
,
578
,
587
,
596
,
605
,
614
,
623
};
if
(
golomb_par
>
MAX_IMA_GOLOMB_PAR
)
if
(
golomb_par
>=
ARRAY_SIZE
(
LUT_MAX_RDCU
))
return
0
;
return
LUT_MAX_RDCU
[
golomb_par
];
...
...
@@ -383,14 +383,14 @@ uint32_t cmp_ima_max_spill(unsigned int golomb_par)
uint32_t
cmp_icu_max_spill
(
unsigned
int
cmp_par
)
{
/* the ICU compressor can generate code words with a length of maximal 32 bits. */
unsigned
int
max_cw_bits
=
32
;
unsigned
int
cutoff
=
(
1UL
<<
(
ilog_2
(
cmp_par
)
+
1
))
-
cmp_par
;
unsigned
int
max_n_sym_offset
=
max_cw_bits
/
2
-
1
;
unsigned
int
const
max_cw_bits
=
32
;
unsigned
int
const
cutoff
=
(
unsigned
int
)(((
uint64_t
)
1
<<
(
ilog_2
(
cmp_par
)
+
1
))
-
cmp_par
)
;
unsigned
int
const
max_n_sym_offset
=
max_cw_bits
/
2
-
1
;
if
(
!
cmp_par
||
cmp_par
>
MAX_NON_IMA_GOLOMB_PAR
)
return
0
;
return
(
max_cw_bits
-
1
-
ilog_2
(
cmp_par
))
*
cmp_par
+
cutoff
return
(
max_cw_bits
-
1
-
(
unsigned
int
)
ilog_2
(
cmp_par
))
*
cmp_par
+
cutoff
-
max_n_sym_offset
-
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