Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
libaec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathis Rosenhauer
libaec
Commits
d4d3a273
Commit
d4d3a273
authored
10 years ago
by
Mathis Rosenhauer
Browse files
Options
Downloads
Patches
Plain Diff
Allow nonconforming block sizes in SZ mode.
parent
6c0595c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/encode.c
+12
-5
12 additions, 5 deletions
src/encode.c
src/libaec.h
+3
-0
3 additions, 0 deletions
src/libaec.h
src/sz_compat.c
+3
-3
3 additions, 3 deletions
src/sz_compat.c
with
18 additions
and
8 deletions
src/encode.c
+
12
−
5
View file @
d4d3a273
...
...
@@ -775,11 +775,18 @@ int aec_encode_init(struct aec_stream *strm)
if
(
strm
->
bits_per_sample
>
32
||
strm
->
bits_per_sample
==
0
)
return
AEC_CONF_ERROR
;
if
(
strm
->
block_size
!=
8
&&
strm
->
block_size
!=
16
&&
strm
->
block_size
!=
32
&&
strm
->
block_size
!=
64
)
return
AEC_CONF_ERROR
;
if
(
strm
->
flags
&
AEC_NOT_ENFORCE
)
{
/* All even block sizes are allowed. */
if
(
strm
->
block_size
&
1
)
return
AEC_CONF_ERROR
;
}
else
{
/* Only allow standard conforming block sizes */
if
(
strm
->
block_size
!=
8
&&
strm
->
block_size
!=
16
&&
strm
->
block_size
!=
32
&&
strm
->
block_size
!=
64
)
return
AEC_CONF_ERROR
;
}
if
(
strm
->
rsi
>
4096
)
return
AEC_CONF_ERROR
;
...
...
This diff is collapsed.
Click to expand it.
src/libaec.h
+
3
−
0
View file @
d4d3a273
...
...
@@ -120,6 +120,9 @@ struct aec_stream {
/* Pad RSI to byte boundary. Only for decoding CCSDS sample data. */
#define AEC_PAD_RSI 32
/* Do not enforce standard regarding legal block sizes. */
#define AEC_NOT_ENFORCE 64
/*************************************/
/* Return codes of library functions */
/*************************************/
...
...
This diff is collapsed.
Click to expand it.
src/sz_compat.c
+
3
−
3
View file @
d4d3a273
...
...
@@ -70,8 +70,8 @@ static void deinterleave_buffer(void *dest, const void *src,
}
static
void
add_padding
(
void
*
dest
,
const
void
*
src
,
size_t
total
,
size_t
line_size
,
size_t
padding_size
,
int
pixel_size
,
int
pp
)
size_t
line_size
,
size_t
padding_size
,
int
pixel_size
,
int
pp
)
{
size_t
i
,
j
,
k
,
ls
,
ps
;
const
char
*
pixel
;
...
...
@@ -127,7 +127,7 @@ int SZ_BufftoBuffCompress(void *dest, size_t *destLen,
strm
.
block_size
=
param
->
pixels_per_block
;
strm
.
rsi
=
(
param
->
pixels_per_scanline
+
param
->
pixels_per_block
-
1
)
/
param
->
pixels_per_block
;
strm
.
flags
=
convert_options
(
param
->
options_mask
);
strm
.
flags
=
AEC_NOT_ENFORCE
|
convert_options
(
param
->
options_mask
);
strm
.
avail_out
=
*
destLen
;
strm
.
next_out
=
dest
;
buf
=
0
;
...
...
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