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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
315ce82b
Commit
315ce82b
authored
2 years ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
fix some type stuff
parent
d63effd9
No related branches found
No related tags found
1 merge request
!11
decompression/compression for non-imagette data
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/cmp_data_types.c
+10
-7
10 additions, 7 deletions
lib/cmp_data_types.c
with
10 additions
and
7 deletions
lib/cmp_data_types.c
+
10
−
7
View file @
315ce82b
...
...
@@ -17,11 +17,14 @@
*/
#include
<stdint.h>
#include
<stdio.h>
#include
<limits.h>
#include
<cmp_data_types.h>
#include
<cmp_debug.h>
#include
<byteorder.h>
#include
<stdint.h>
#include
<stdio.h>
/* the maximum length of the different data products types in bits */
...
...
@@ -187,12 +190,12 @@ size_t size_of_a_sample(enum cmp_data_type data_type)
*
* @note for non-imagette data program types the multi entry header size is added
*
* @returns the size in bytes to store the data sample
* @returns the size in bytes to store the data sample
; zero on failure
*/
unsigned
int
cmp_cal_size_of_data
(
unsigned
int
samples
,
enum
cmp_data_type
data_type
)
{
unsigned
in
t
s
=
size_of_a_sample
(
data_type
);
size_
t
s
=
size_of_a_sample
(
data_type
);
uint64_t
x
;
/* use 64 bit to catch overflow */
if
(
!
s
)
...
...
@@ -203,7 +206,7 @@ unsigned int cmp_cal_size_of_data(unsigned int samples, enum cmp_data_type data_
if
(
!
rdcu_supported_data_type_is_used
(
data_type
))
x
+=
MULTI_ENTRY_HDR_SIZE
;
if
(
x
>
UINT
32
_MAX
)
/* catch overflow */
if
(
x
>
UINT_MAX
)
/* catch overflow */
return
0
;
return
(
unsigned
int
)
x
;
...
...
@@ -222,7 +225,7 @@ unsigned int cmp_cal_size_of_data(unsigned int samples, enum cmp_data_type data_
int
cmp_input_size_to_samples
(
unsigned
int
size
,
enum
cmp_data_type
data_type
)
{
int
samples_size
=
(
int
)
size_of_a_sample
(
data_type
);
u
int
32_t
samples_size
=
size_of_a_sample
(
data_type
);
if
(
!
samples_size
)
return
-
1
;
...
...
@@ -236,7 +239,7 @@ int cmp_input_size_to_samples(unsigned int size, enum cmp_data_type data_type)
if
(
size
%
samples_size
)
return
-
1
;
return
size
/
samples_size
;
return
(
int
)(
size
/
samples_size
)
;
}
...
...
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