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
72f36241
Commit
72f36241
authored
12 years ago
by
Mathis Rosenhauer
Committed by
Thomas Jahns
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve compatibility with HDF5 - all checks passed
parent
b63f830b
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/libaec.h
+7
-8
7 additions, 8 deletions
src/libaec.h
src/sz_compat.c
+25
-2
25 additions, 2 deletions
src/sz_compat.c
src/szlib.h
+14
-4
14 additions, 4 deletions
src/szlib.h
with
46 additions
and
14 deletions
src/libaec.h
+
7
−
8
View file @
72f36241
...
...
@@ -30,19 +30,18 @@ struct aec_stream {
};
/* Sample data description flags */
#define AEC_DATA_UNSIGNED 0
/* Samples are unsigned integers (default) */
#define AEC_DATA_SIGNED 1
/* Samples are signed. Telling libaec
#define AEC_DATA_SIGNED 1
/* Samples are signed. Telling libaec
* this results in a slightly better
* compression ratio.
* compression ratio. Default is
* unsigned.
*/
#define AEC_DATA_3BYTE
2
/* 24 bit samples are coded in 3 bytes */
#define AEC_DATA_MSB
16
/* Samples are stored with their most
#define AEC_DATA_3BYTE
2
/* 24 bit samples are coded in 3 bytes */
#define AEC_DATA_MSB
4
/* Samples are stored with their most
* significant bit first. This has
* nothing to do with the endianness
* of the host.
* of the host.
Default is LSB.
*/
#define AEC_DATA_LSB 0
/* Samples are stored LSB first (default) */
#define AEC_DATA_PREPROCESS 32
/* Set if preprocessor should be used */
#define AEC_DATA_PREPROCESS 8
/* Set if preprocessor should be used */
/* Return codes of library functions */
#define AEC_OK 0
...
...
This diff is collapsed.
Click to expand it.
src/sz_compat.c
+
25
−
2
View file @
72f36241
...
...
@@ -3,6 +3,24 @@
#include
"szlib.h"
#include
"libaec.h"
#define NOPTS 129
static
int
convert_options
(
int
sz_opts
)
{
int
co
[
NOPTS
];
int
i
;
int
opts
=
0
;
memset
(
co
,
0
,
sizeof
(
int
)
*
NOPTS
);
co
[
SZ_MSB_OPTION_MASK
]
=
AEC_DATA_MSB
;
co
[
SZ_NN_OPTION_MASK
]
=
AEC_DATA_PREPROCESS
;
for
(
i
=
1
;
i
<
NOPTS
;
i
<<=
1
)
opts
|=
co
[
i
];
return
opts
;
}
int
SZ_BufftoBuffCompress
(
void
*
dest
,
size_t
*
destLen
,
const
void
*
source
,
size_t
sourceLen
,
SZ_com_t
*
param
)
...
...
@@ -13,7 +31,7 @@ int SZ_BufftoBuffCompress(void *dest, size_t *destLen,
strm
.
bit_per_sample
=
param
->
bits_per_pixel
;
strm
.
block_size
=
param
->
pixels_per_block
;
strm
.
rsi
=
param
->
pixels_per_scanline
/
param
->
pixels_per_block
;
strm
.
flags
=
param
->
options_mask
;
strm
.
flags
=
convert_options
(
param
->
options_mask
)
;
strm
.
avail_in
=
sourceLen
;
strm
.
avail_out
=
*
destLen
;
strm
.
next_out
=
dest
;
...
...
@@ -37,7 +55,7 @@ int SZ_BufftoBuffDecompress(void *dest, size_t *destLen,
strm
.
bit_per_sample
=
param
->
bits_per_pixel
;
strm
.
block_size
=
param
->
pixels_per_block
;
strm
.
rsi
=
param
->
pixels_per_scanline
/
param
->
pixels_per_block
;
strm
.
flags
=
param
->
options_mask
;
strm
.
flags
=
convert_options
(
param
->
options_mask
)
;
strm
.
avail_in
=
sourceLen
;
strm
.
avail_out
=
*
destLen
;
strm
.
next_out
=
dest
;
...
...
@@ -50,3 +68,8 @@ int SZ_BufftoBuffDecompress(void *dest, size_t *destLen,
*
destLen
=
strm
.
total_out
;
return
SZ_OK
;
}
int
SZ_encoder_enabled
(
void
)
{
return
1
;
}
This diff is collapsed.
Click to expand it.
src/szlib.h
+
14
−
4
View file @
72f36241
...
...
@@ -3,16 +3,24 @@
#include
"libaec.h"
#define SZ_ALLOW_K13_OPTION_MASK 1
#define SZ_CHIP_OPTION_MASK 2
#define SZ_EC_OPTION_MASK 4
#define SZ_LSB_OPTION_MASK 8
#define SZ_MSB_OPTION_MASK 16
#define SZ_NN_OPTION_MASK 32
#define SZ_RAW_OPTION_MASK 128
#define SZ_OK AEC_OK
#define SZ_NO_ENCODER_ERROR -1
#define SZ_PARAM_ERROR AEC_CONF_ERROR
#define SZ_MEM_ERROR AEC_MEM_ERROR
#define SZ_OUTBUFF_FULL -2
#define SZ_
RAW_OPTION_MASK 128
#define SZ_
NN_OPTION_MASK AEC_DATA_PREPROCESS
#define SZ_
LSB_OPTION_MASK AEC_DATA_LSB
#define SZ_MSB_OPTION_MASK AEC_DATA_MSB
#define SZ_
MAX_PIXELS_PER_BLOCK 32
#define SZ_
MAX_BLOCKS_PER_SCANLINE 128
#define SZ_
MAX_PIXELS_PER_SCANLINE \
(SZ_MAX_BLOCKS_PER_SCANLINE) * (SZ_MAX_PIXELS_PER_BLOCK)
typedef
struct
SZ_com_t_s
{
...
...
@@ -29,4 +37,6 @@ int SZ_BufftoBuffDecompress(void *dest, size_t *destLen,
const
void
*
source
,
size_t
sourceLen
,
SZ_com_t
*
param
);
int
SZ_encoder_enabled
(
void
);
#endif
/* SZLIB_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