}
if (strm->flags & AEC_DATA_SIGNED) {
- state->xmin = -(INT64_C(1) << (strm->bits_per_sample - 1));
- state->xmax = (UINT64_C(1) << (strm->bits_per_sample - 1)) - 1;
+ state->xmax = UINT32_MAX >> (32 - strm->bits_per_sample + 1);
+ state->xmin = ~state->xmax;
} else {
state->xmin = 0;
- state->xmax = (UINT64_C(1) << strm->bits_per_sample) - 1;
+ state->xmax = UINT32_MAX >> (32 - strm->bits_per_sample);
}
state->in_blklen = (strm->block_size * strm->bits_per_sample
int32_t last_out;
/* minimum integer for post-processing */
- int64_t xmin;
+ uint32_t xmin;
/* maximum integer for post-processing */
- int64_t xmax;
+ uint32_t xmax;
/* length of uncompressed input block should be the longest
possible block */
state->rsi_len = strm->rsi * strm->block_size * state->bytes_per_sample;
if (strm->flags & AEC_DATA_SIGNED) {
- state->xmax = (UINT64_C(1) << (strm->bits_per_sample - 1)) - 1;
+ state->xmax = UINT32_MAX >> (32 - strm->bits_per_sample + 1);
state->xmin = ~state->xmax;
state->preprocess = preprocess_signed;
} else {
state->xmin = 0;
- state->xmax = (UINT64_C(1) << strm->bits_per_sample) - 1;
+ state->xmax = UINT32_MAX >> (32 - strm->bits_per_sample);
state->preprocess = preprocess_unsigned;
}