summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathis Rosenhauer <rosenhauer@dkrz.de>2012-11-20 14:34:45 +0100
committerThomas Jahns <jahns@dkrz.de>2013-02-19 11:33:00 +0100
commit3d5b023dedf57b4c447a0a8c89c4057bb67a3ac0 (patch)
tree1108c35332167fc9a6c9823a5beaa9149badd7ac /src
parent2a2e588b28df54c3ef91b32b65d4f1aeca6c779c (diff)
downloadlibaec-3d5b023dedf57b4c447a0a8c89c4057bb67a3ac0.tar.gz
libaec-3d5b023dedf57b4c447a0a8c89c4057bb67a3ac0.tar.bz2
libaec-3d5b023dedf57b4c447a0a8c89c4057bb67a3ac0.zip
pluralization
Diffstat (limited to 'src')
-rw-r--r--src/aec.c10
-rw-r--r--src/decode.c44
-rw-r--r--src/decode.h2
-rw-r--r--src/encode.c28
-rw-r--r--src/libaec.h2
-rw-r--r--src/sz_compat.c12
6 files changed, 49 insertions, 49 deletions
diff --git a/src/aec.c b/src/aec.c
index 14064f1..df94f14 100644
--- a/src/aec.c
+++ b/src/aec.c
@@ -25,7 +25,7 @@ int main(int argc, char *argv[])
int dflag = 0;
chunk = CHUNK;
- strm.bit_per_sample = 8;
+ strm.bits_per_sample = 8;
strm.block_size = 8;
strm.rsi = 2;
strm.flags = AEC_DATA_PREPROCESS;
@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
chunk = atoi(optarg);
break;
case 'B':
- strm.bit_per_sample = atoi(optarg);
+ strm.bits_per_sample = atoi(optarg);
break;
case 'J':
strm.block_size = atoi(optarg);
@@ -85,14 +85,14 @@ int main(int argc, char *argv[])
exit(-1);
}
- if (strm.bit_per_sample > 16)
+ if (strm.bits_per_sample > 16)
{
- if (strm.bit_per_sample <= 24 && strm.flags & AEC_DATA_3BYTE)
+ if (strm.bits_per_sample <= 24 && strm.flags & AEC_DATA_3BYTE)
chunk *= 3;
else
chunk *= 4;
}
- else if (strm.bit_per_sample > 8)
+ else if (strm.bits_per_sample > 8)
{
chunk *= 2;
}
diff --git a/src/decode.c b/src/decode.c
index 2efb12b..3454977 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -35,7 +35,7 @@
state->last_out = state->buf[0]; \
\
if (strm->flags & AEC_DATA_SIGNED) { \
- m = 1ULL << (strm->bit_per_sample - 1); \
+ m = 1ULL << (strm->bits_per_sample - 1); \
/* Reference samples have to be sign extended */ \
state->last_out = (state->last_out ^ m) - m; \
} \
@@ -136,8 +136,8 @@ static void put_sample(struct aec_stream *strm, uint32_t s)
struct internal_state *state = strm->state;
state->buf[state->buf_i++] = s;
- strm->avail_out -= state->byte_per_sample;
- strm->total_out += state->byte_per_sample;
+ strm->avail_out -= state->bytes_per_sample;
+ strm->total_out += state->bytes_per_sample;
if (state->buf_i == state->buf_size) {
state->flush_output(strm);
@@ -206,7 +206,7 @@ static void fast_split(struct aec_stream *strm)
k = state->id - 1;
if (state->ref)
- put_sample(strm, direct_get(strm, strm->bit_per_sample));
+ put_sample(strm, direct_get(strm, strm->bits_per_sample));
for (i = state->ref; i < strm->block_size; i++)
state->block[i] = direct_get_fs(strm) << k;
@@ -249,7 +249,7 @@ static void fast_uncomp(struct aec_stream *strm)
int i;
for (i = 0; i < strm->block_size; i++)
- put_sample(strm, direct_get(strm, strm->bit_per_sample));
+ put_sample(strm, direct_get(strm, strm->bits_per_sample));
}
static uint32_t bits_ask(struct aec_stream *strm, int n)
@@ -310,12 +310,12 @@ static void fs_drop(struct aec_stream *strm)
static uint32_t copysample(struct aec_stream *strm)
{
- if (bits_ask(strm, strm->bit_per_sample) == 0
+ if (bits_ask(strm, strm->bits_per_sample) == 0
|| strm->avail_out == 0)
return 0;
- put_sample(strm, bits_get(strm, strm->bit_per_sample));
- bits_drop(strm, strm->bit_per_sample);
+ put_sample(strm, bits_get(strm, strm->bits_per_sample));
+ bits_drop(strm, strm->bits_per_sample);
return 1;
}
@@ -429,7 +429,7 @@ static int m_zero_block(struct aec_stream *strm)
else
state->i = zero_blocks * strm->block_size;
- if (strm->avail_out >= state->i * state->byte_per_sample) {
+ if (strm->avail_out >= state->i * state->bytes_per_sample) {
fast_zero(strm);
state->mode = m_id;
return M_CONTINUE;
@@ -559,7 +559,7 @@ int aec_decode_init(struct aec_stream *strm)
int i, modi;
struct internal_state *state;
- if (strm->bit_per_sample > 32 || strm->bit_per_sample == 0)
+ if (strm->bits_per_sample > 32 || strm->bits_per_sample == 0)
return AEC_CONF_ERROR;
state = (struct internal_state *) malloc(sizeof(struct internal_state));
@@ -574,27 +574,27 @@ int aec_decode_init(struct aec_stream *strm)
strm->state = state;
- if (strm->bit_per_sample > 16) {
+ if (strm->bits_per_sample > 16) {
state->id_len = 5;
- if (strm->bit_per_sample <= 24 && strm->flags & AEC_DATA_3BYTE) {
- state->byte_per_sample = 3;
+ if (strm->bits_per_sample <= 24 && strm->flags & AEC_DATA_3BYTE) {
+ state->bytes_per_sample = 3;
if (strm->flags & AEC_DATA_MSB)
state->flush_output = flush_msb_24;
else
state->flush_output = flush_lsb_24;
} else {
- state->byte_per_sample = 4;
+ state->bytes_per_sample = 4;
if (strm->flags & AEC_DATA_MSB)
state->flush_output = flush_msb_32;
else
state->flush_output = flush_lsb_32;
}
state->out_blklen = strm->block_size
- * state->byte_per_sample;
+ * state->bytes_per_sample;
}
- else if (strm->bit_per_sample > 8) {
- state->byte_per_sample = 2;
+ else if (strm->bits_per_sample > 8) {
+ state->bytes_per_sample = 2;
state->id_len = 4;
state->out_blklen = strm->block_size * 2;
if (strm->flags & AEC_DATA_MSB)
@@ -602,22 +602,22 @@ int aec_decode_init(struct aec_stream *strm)
else
state->flush_output = flush_lsb_16;
} else {
- state->byte_per_sample = 1;
+ state->bytes_per_sample = 1;
state->id_len = 3;
state->out_blklen = strm->block_size;
state->flush_output = flush_8;
}
if (strm->flags & AEC_DATA_SIGNED) {
- state->xmin = -(1ULL << (strm->bit_per_sample - 1));
- state->xmax = (1ULL << (strm->bit_per_sample - 1)) - 1;
+ state->xmin = -(1ULL << (strm->bits_per_sample - 1));
+ state->xmax = (1ULL << (strm->bits_per_sample - 1)) - 1;
} else {
state->xmin = 0;
- state->xmax = (1ULL << strm->bit_per_sample) - 1;
+ state->xmax = (1ULL << strm->bits_per_sample) - 1;
}
state->ref_int = strm->block_size * strm->rsi;
- state->in_blklen = (strm->block_size * strm->bit_per_sample
+ state->in_blklen = (strm->block_size * strm->bits_per_sample
+ state->id_len) / 8 + 1;
modi = 1UL << state->id_len;
diff --git a/src/decode.h b/src/decode.h
index a1fd3cd..230e8f3 100644
--- a/src/decode.h
+++ b/src/decode.h
@@ -39,7 +39,7 @@ struct internal_state {
int fs; /* last fundamental sequence in accumulator */
int ref; /* 1 if current block has reference sample */
int pp; /* 1 if postprocessor has to be used */
- int byte_per_sample;
+ int bytes_per_sample;
int *se_table;
uint32_t *buf;
uint32_t buf_i;
diff --git a/src/encode.c b/src/encode.c
index 9ee9803..cc7eae1 100644
--- a/src/encode.c
+++ b/src/encode.c
@@ -202,7 +202,7 @@ static void preprocess_signed(struct aec_stream *strm)
struct internal_state *state = strm->state;
uint32_t *d = state->data_pp;
int32_t *x = (int32_t *)state->data_raw;
- uint64_t m = 1ULL << (strm->bit_per_sample - 1);
+ uint64_t m = 1ULL << (strm->bits_per_sample - 1);
int64_t xmax = state->xmax;
int64_t xmin = state->xmin;
uint32_t rsi = strm->rsi * strm->block_size - 1;
@@ -272,7 +272,7 @@ static int assess_splitting_option(struct aec_stream *strm)
Length of CDS encoded with splitting option and optimal k.
In Rice coding each sample in a block of samples is split at
- the same position into k LSB and bit_per_sample - k MSB. The
+ the same position into k LSB and bits_per_sample - k MSB. The
LSB part is left binary and the MSB part is coded as a
fundamental sequence a.k.a. unary (see CCSDS 121.0-B-2). The
function of the length of the Coded Data Set (CDS) depending on
@@ -438,7 +438,7 @@ static int m_encode_splitting(struct aec_stream *strm)
if (state->ref)
{
- emit(state, state->block[0], strm->bit_per_sample);
+ emit(state, state->block[0], strm->bits_per_sample);
emitblock_fs_1(strm, k);
if (k)
emitblock_1(strm, k);
@@ -458,7 +458,7 @@ static int m_encode_uncomp(struct aec_stream *strm)
struct internal_state *state = strm->state;
emit(state, (1U << state->id_len) - 1, state->id_len);
- emitblock_0(strm, strm->bit_per_sample);
+ emitblock_0(strm, strm->bits_per_sample);
return m_flush_block(strm);
}
@@ -471,7 +471,7 @@ static int m_encode_se(struct aec_stream *strm)
emit(state, 1, state->id_len + 1);
if (state->ref)
- emit(state, state->block[0], strm->bit_per_sample);
+ emit(state, state->block[0], strm->bits_per_sample);
for (i = 0; i < strm->block_size; i+= 2) {
d = state->block[i] + state->block[i + 1];
@@ -488,7 +488,7 @@ static int m_encode_zero(struct aec_stream *strm)
emit(state, 0, state->id_len + 1);
if (state->zero_ref)
- emit(state, state->zero_ref_sample, strm->bit_per_sample);
+ emit(state, state->zero_ref_sample, strm->bits_per_sample);
if (state->zero_blocks == ROS)
emitfs(state, 4);
@@ -513,7 +513,7 @@ static int m_select_code_option(struct aec_stream *strm)
struct internal_state *state = strm->state;
uncomp_len = (strm->block_size - state->ref)
- * strm->bit_per_sample;
+ * strm->bits_per_sample;
split_len = assess_splitting_option(strm);
se_len = assess_se_option(split_len, strm);
@@ -688,7 +688,7 @@ int aec_encode_init(struct aec_stream *strm)
{
struct internal_state *state;
- if (strm->bit_per_sample > 32 || strm->bit_per_sample == 0)
+ if (strm->bits_per_sample > 32 || strm->bits_per_sample == 0)
return AEC_CONF_ERROR;
if (strm->block_size != 8
@@ -707,11 +707,11 @@ int aec_encode_init(struct aec_stream *strm)
memset(state, 0, sizeof(struct internal_state));
strm->state = state;
- if (strm->bit_per_sample > 16) {
+ if (strm->bits_per_sample > 16) {
/* 24/32 input bit settings */
state->id_len = 5;
- if (strm->bit_per_sample <= 24
+ if (strm->bits_per_sample <= 24
&& strm->flags & AEC_DATA_3BYTE) {
state->block_len = 3 * strm->block_size;
if (strm->flags & AEC_DATA_MSB) {
@@ -732,7 +732,7 @@ int aec_encode_init(struct aec_stream *strm)
}
}
}
- else if (strm->bit_per_sample > 8) {
+ else if (strm->bits_per_sample > 8) {
/* 16 bit settings */
state->id_len = 4;
state->block_len = 2 * strm->block_size;
@@ -754,12 +754,12 @@ int aec_encode_init(struct aec_stream *strm)
}
if (strm->flags & AEC_DATA_SIGNED) {
- state->xmin = -(1ULL << (strm->bit_per_sample - 1));
- state->xmax = (1ULL << (strm->bit_per_sample - 1)) - 1;
+ state->xmin = -(1ULL << (strm->bits_per_sample - 1));
+ state->xmax = (1ULL << (strm->bits_per_sample - 1)) - 1;
state->preprocess = preprocess_signed;
} else {
state->xmin = 0;
- state->xmax = (1ULL << strm->bit_per_sample) - 1;
+ state->xmax = (1ULL << strm->bits_per_sample) - 1;
state->preprocess = preprocess_unsigned;
}
diff --git a/src/libaec.h b/src/libaec.h
index 91c8485..9129a32 100644
--- a/src/libaec.h
+++ b/src/libaec.h
@@ -16,7 +16,7 @@ struct aec_stream {
unsigned char *next_out;
size_t avail_out; /* remaining free space at next_out */
size_t total_out; /* total number of bytes output so far */
- int bit_per_sample; /* resolution in bits per sample (n =
+ int bits_per_sample; /* resolution in bits per sample (n =
* 1, ..., 32)
*/
int block_size; /* block size in samples */
diff --git a/src/sz_compat.c b/src/sz_compat.c
index 3d4ffed..fdb07b8 100644
--- a/src/sz_compat.c
+++ b/src/sz_compat.c
@@ -133,17 +133,17 @@ int SZ_BufftoBuffCompress(void *dest, size_t *destLen,
interleave = param->bits_per_pixel == 32 || param->bits_per_pixel == 64;
if (interleave) {
- strm.bit_per_sample = 8;
+ strm.bits_per_sample = 8;
buf = malloc(sourceLen);
if (buf == NULL)
return SZ_MEM_ERROR;
interleave_buffer(buf, source, sourceLen, param->bits_per_pixel / 8);
} else {
- strm.bit_per_sample = param->bits_per_pixel;
+ strm.bits_per_sample = param->bits_per_pixel;
buf = (void *)source;
}
- pixel_size = bits_to_bytes(strm.bit_per_sample);
+ pixel_size = bits_to_bytes(strm.bits_per_sample);
if (pad_scanline) {
scanlines = (sourceLen / pixel_size + param->pixels_per_scanline - 1)
@@ -213,11 +213,11 @@ int SZ_BufftoBuffDecompress(void *dest, size_t *destLen,
extra_buffer = pad_scanline || deinterleave;
if (deinterleave)
- strm.bit_per_sample = 8;
+ strm.bits_per_sample = 8;
else
- strm.bit_per_sample = param->bits_per_pixel;
+ strm.bits_per_sample = param->bits_per_pixel;
- pixel_size = bits_to_bytes(strm.bit_per_sample);
+ pixel_size = bits_to_bytes(strm.bits_per_sample);
if (extra_buffer) {
if (pad_scanline) {