summaryrefslogtreecommitdiff
path: root/src/encode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/encode.c')
-rw-r--r--src/encode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/encode.c b/src/encode.c
index dd72239..1c36008 100644
--- a/src/encode.c
+++ b/src/encode.c
@@ -851,12 +851,12 @@ int aec_encode_init(struct aec_stream *strm)
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;
}