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
98ec18e6
Commit
98ec18e6
authored
1 year ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Refactor compression size bound calculation
parent
bb25700a
Branches
Branches containing commit
No related tags found
1 merge request
!26
Adapt cmp_tool to the chunk decompression
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/cmp_chunk.h
+15
-4
15 additions, 4 deletions
lib/cmp_chunk.h
lib/icu_compress/cmp_icu.c
+1
-1
1 addition, 1 deletion
lib/icu_compress/cmp_icu.c
with
16 additions
and
5 deletions
lib/cmp_chunk.h
+
15
−
4
View file @
98ec18e6
...
@@ -24,7 +24,14 @@
...
@@ -24,7 +24,14 @@
#include
"common/cmp_entity.h"
#include
"common/cmp_entity.h"
#define ROUND_UP_TO_4(x) ((((x)+3)*4)/4)
#define ROUND_UP_TO_4(x) ((((x)+3)/4)*4)
#define COMPRESS_CHUNK_BOUND_UNSAFE(chunk_size, num_col) ( \
ROUND_UP_TO_4(NON_IMAGETTE_HEADER_SIZE + \
(num_col) * CMP_COLLECTION_FILD_SIZE + \
(chunk_size) \
) \
)
/**
/**
...
@@ -44,8 +51,12 @@
...
@@ -44,8 +51,12 @@
*/
*/
#define COMPRESS_CHUNK_BOUND(chunk_size, num_col) ( \
#define COMPRESS_CHUNK_BOUND(chunk_size, num_col) ( \
(uint32_t)ROUND_UP_TO_4(NON_IMAGETTE_HEADER_SIZE+(chunk_size)+(num_col)*CMP_COLLECTION_FILD_SIZE) > (uint32_t)CMP_ENTITY_MAX_SIZE ? 0 \
(num_col) > 0 && \
: ROUND_UP_TO_4(NON_IMAGETTE_HEADER_SIZE+(chunk_size)+(num_col)*CMP_COLLECTION_FILD_SIZE) \
(num_col) <= CMP_ENTITY_MAX_SIZE/COLLECTION_HDR_SIZE && \
(chunk_size) >= COLLECTION_HDR_SIZE * (num_col) && \
(chunk_size) <= CMP_ENTITY_MAX_SIZE && \
COMPRESS_CHUNK_BOUND_UNSAFE(chunk_size, num_col) <= CMP_ENTITY_MAX_SIZE ? \
COMPRESS_CHUNK_BOUND_UNSAFE(chunk_size, num_col) : 0 \
)
)
...
...
This diff is collapsed.
Click to expand it.
lib/icu_compress/cmp_icu.c
+
1
−
1
View file @
98ec18e6
...
@@ -2737,7 +2737,7 @@ uint32_t compress_chunk_cmp_size_bound(const void *chunk, size_t chunk_size)
...
@@ -2737,7 +2737,7 @@ uint32_t compress_chunk_cmp_size_bound(const void *chunk, size_t chunk_size)
}
}
for
(
read_bytes
=
0
;
for
(
read_bytes
=
0
;
read_bytes
<
(
int32_t
)
chunk_size
-
COLLECTION_HDR_SIZE
;
read_bytes
<
=
(
int32_t
)
chunk_size
-
COLLECTION_HDR_SIZE
;
read_bytes
+=
cmp_col_get_size
((
const
struct
collection_hdr
*
)((
const
uint8_t
*
)
chunk
+
read_bytes
)))
read_bytes
+=
cmp_col_get_size
((
const
struct
collection_hdr
*
)((
const
uint8_t
*
)
chunk
+
read_bytes
)))
num_col
++
;
num_col
++
;
...
...
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