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
ca3e3ed1
Commit
ca3e3ed1
authored
1 year ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Fix decompression for sparc compiler
parent
0b5b76ba
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!28
Updated debug_print(): Enhanced Adaptability for Various Environments
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/decompress/read_bitstream.h
+7
-1
7 additions, 1 deletion
lib/decompress/read_bitstream.h
test/cmp_decmp/test_cmp_decmp.c
+4
-5
4 additions, 5 deletions
test/cmp_decmp/test_cmp_decmp.c
test/test_common/test_common.c
+1
-0
1 addition, 0 deletions
test/test_common/test_common.c
with
12 additions
and
6 deletions
lib/decompress/read_bitstream.h
+
7
−
1
View file @
ca3e3ed1
...
@@ -106,8 +106,15 @@ static const uint32_t BIT_MASK[] = {
...
@@ -106,8 +106,15 @@ static const uint32_t BIT_MASK[] = {
static
__inline
uint64_t
bit_read_unaligned_64be
(
const
void
*
ptr
)
static
__inline
uint64_t
bit_read_unaligned_64be
(
const
void
*
ptr
)
{
{
#ifdef __sparc__
uint64_t
v
;
memcpy
(
&
v
,
ptr
,
sizeof
(
v
));
return
cpu_to_be64
(
v
);
#else
typedef
__attribute__
((
aligned
(
1
)))
uint64_t
unalign64
;
typedef
__attribute__
((
aligned
(
1
)))
uint64_t
unalign64
;
return
cpu_to_be64
(
*
(
const
unalign64
*
)
ptr
);
return
cpu_to_be64
(
*
(
const
unalign64
*
)
ptr
);
#endif
}
}
...
@@ -184,7 +191,6 @@ static __inline size_t bit_init_decoder(struct bit_decoder *dec, const void *buf
...
@@ -184,7 +191,6 @@ static __inline size_t bit_init_decoder(struct bit_decoder *dec, const void *buf
*
*
* @returns extracted value
* @returns extracted value
*/
*/
static
__inline
uint64_t
bit_peek_bits
(
const
struct
bit_decoder
*
dec
,
unsigned
int
nb_bits
)
static
__inline
uint64_t
bit_peek_bits
(
const
struct
bit_decoder
*
dec
,
unsigned
int
nb_bits
)
{
{
/* mask for the shift value register to prevent undefined behaviour */
/* mask for the shift value register to prevent undefined behaviour */
...
...
This diff is collapsed.
Click to expand it.
test/cmp_decmp/test_cmp_decmp.c
+
4
−
5
View file @
ca3e3ed1
...
@@ -53,7 +53,7 @@ void setUp(void)
...
@@ -53,7 +53,7 @@ void setUp(void)
uint64_t
seed
;
uint64_t
seed
;
static
int
n
;
static
int
n
;
#if HAS_TIME_H
#if
def
HAS_TIME_H
seed
=
(
uint64_t
)(
time
(
NULL
)
^
getpid
()
^
(
intptr_t
)
&
setUp
);
seed
=
(
uint64_t
)(
time
(
NULL
)
^
getpid
()
^
(
intptr_t
)
&
setUp
);
#else
#else
seed
=
1
;
seed
=
1
;
...
@@ -968,16 +968,15 @@ static int32_t chunk_round_trip(void *data, uint32_t data_size,
...
@@ -968,16 +968,15 @@ static int32_t chunk_round_trip(void *data, uint32_t data_size,
* @test decompress_cmp_entiy
* @test decompress_cmp_entiy
*/
*/
void
test_random_collection_round_trip
(
void
)
void
test_random_chunk_round_trip
(
void
)
{
{
enum
cmp_data_type
data_type
;
enum
cmp_data_type
data_type
;
enum
cmp_mode
cmp_mode
;
enum
cmp_mode
cmp_mode
;
enum
{
MAX_DATA_TO_COMPRESS_SIZE
=
CMP_ENTITY_MAX_ORIGINAL_SIZE
};
enum
{
MAX_DATA_TO_COMPRESS_SIZE
=
UINT16_MAX
};
uint32_t
cmp_data_capacity
=
COMPRESS_CHUNK_BOUND
(
MAX_DATA_TO_COMPRESS_SIZE
,
1
);
void
*
data
=
malloc
(
CMP_ENTITY_MAX_ORIGINAL_SIZE
);
void
*
data
=
malloc
(
CMP_ENTITY_MAX_ORIGINAL_SIZE
);
void
*
model
=
malloc
(
MAX_DATA_TO_COMPRESS_SIZE
);
void
*
model
=
malloc
(
MAX_DATA_TO_COMPRESS_SIZE
);
void
*
updated_model
=
calloc
(
1
,
MAX_DATA_TO_COMPRESS_SIZE
);
void
*
updated_model
=
calloc
(
1
,
MAX_DATA_TO_COMPRESS_SIZE
);
uint32_t
cmp_data_capacity
=
CMP_ENTITY_MAX_SIZE
-
NON_IMAGETTE_HEADER_SIZE
;
void
*
cmp_data
=
malloc
(
cmp_data_capacity
);
void
*
cmp_data
=
malloc
(
cmp_data_capacity
);
for
(
data_type
=
1
;
data_type
<=
DATA_TYPE_F_CAM_BACKGROUND
;
data_type
++
)
{
for
(
data_type
=
1
;
data_type
<=
DATA_TYPE_F_CAM_BACKGROUND
;
data_type
++
)
{
...
...
This diff is collapsed.
Click to expand it.
test/test_common/test_common.c
+
1
−
0
View file @
ca3e3ed1
#include
<stddef.h>
#include
<stddef.h>
#include
<stdint.h>
#include
<stdlib.h>
#include
<stdlib.h>
#include
<string.h>
#include
<string.h>
...
...
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