Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-eiger
Commits
f2e3e6b2
Commit
f2e3e6b2
authored
Jan 27, 2020
by
Alejandro Homs Puron
Committed by
operator for beamline
Jan 27, 2020
Browse files
Fix Stream BSLZ4 decompression
parent
b68d5dae
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/EigerDecompress.cpp
View file @
f2e3e6b2
...
...
@@ -63,9 +63,8 @@ Data _DecompressTask::process(Data& out)
void
*
lima_buffer
=
out
.
data
();
if
(
!
m_stream
.
get_msg
(
lima_buffer
,
msg_data
,
msg_size
,
depth
))
throw
ProcessException
(
"_DecompressTask: can't find compressed message"
);
int
size
;
bool
expand_16_to_32bit
=
((
out
.
depth
()
==
4
)
&&
(
depth
==
2
));
size
=
out
.
size
()
/
(
expand_16_to_32bit
?
2
:
1
);
int
size
=
out
.
size
()
/
(
expand_16_to_32bit
?
2
:
1
);
Camera
::
CompressionType
type
;
m_stream
.
getCompressionType
(
type
);
bool
decompress
=
(
type
!=
Camera
::
NoCompression
);
...
...
@@ -79,8 +78,17 @@ Data _DecompressTask::process(Data& out)
if
(
type
==
Camera
::
LZ4
)
{
return_code
=
LZ4_decompress_fast
((
const
char
*
)
msg_data
,(
char
*
)
decompress_out
,
size
);
}
else
if
(
type
==
Camera
::
BSLZ4
)
{
size_t
nb_elements
=
size
/
depth
;
return_code
=
bshuf_decompress_lz4
(
msg_data
,
decompress_out
,
nb_elements
,
depth
,
0
);
struct
bslz4_data
{
uint64_t
data_size
;
uint32_t
block_size
;
char
data
[
1
];
}
*
d
=
(
bslz4_data
*
)
msg_data
;
size_t
data_size
=
be64toh
(
d
->
data_size
);
if
(
data_size
!=
size
)
throw
ProcessException
(
"Data size mismatch"
);
size_t
nb_elements
=
data_size
/
depth
;
size_t
block_size
=
be32toh
(
d
->
block_size
)
/
depth
;
return_code
=
bshuf_decompress_lz4
(
d
->
data
,
decompress_out
,
nb_elements
,
depth
,
block_size
);
}
if
(
return_code
<
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment