summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Hanke <hanke@dkrz.de>2014-09-09 16:40:36 +0200
committerMathis Rosenhauer <rosenhauer@dkrz.de>2014-10-24 16:08:26 +0200
commit9af97721e78da0c2e5be2f82ee8ca9d0fb951ddc (patch)
tree12f18b3e0f9466b8f10b2b791d5a2cb5826e0296
parent19f3f8e7c222a52bd6448f6d18ce91ecc3f05fb4 (diff)
downloadlibaec-9af97721e78da0c2e5be2f82ee8ca9d0fb951ddc.tar.gz
libaec-9af97721e78da0c2e5be2f82ee8ca9d0fb951ddc.tar.bz2
libaec-9af97721e78da0c2e5be2f82ee8ca9d0fb951ddc.zip
makes last_out int32_t
-rw-r--r--src/decode.c9
-rw-r--r--src/decode.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/decode.c b/src/decode.c
index 099fc44..a8c0afc 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -68,8 +68,7 @@
static void flush_##KIND(struct aec_stream *strm) \
{ \
uint32_t *flush_end, *bp, half_d; \
- int32_t data; \
- int64_t m; \
+ int32_t data, m; \
struct internal_state *state = strm->state; \
\
flush_end = state->rsip; \
@@ -79,7 +78,7 @@
state->last_out = *state->rsi_buffer; \
\
if (strm->flags & AEC_DATA_SIGNED) { \
- m = UINT64_C(1) << (strm->bits_per_sample - 1); \
+ m = UINT32_C(1) << (strm->bits_per_sample - 1); \
/* Reference samples have to be sign extended */ \
state->last_out = (state->last_out ^ m) - m; \
} \
@@ -87,11 +86,12 @@
state->flush_start++; \
} \
\
+ data = state->last_out; \
+ \
if (state->xmin == 0) { \
\
uint32_t xmax, med, d; \
med = state->xmax / 2 + 1; \
- data = (uint32_t)state->last_out; \
xmax = state->xmax; \
\
for (bp = state->flush_start; bp < flush_end; bp++) { \
@@ -118,7 +118,6 @@
} else { \
\
int32_t xmax, d; \
- data = state->last_out; \
xmax = state->xmax; \
\
for (bp = state->flush_start; bp < flush_end; bp++) { \
diff --git a/src/decode.h b/src/decode.h
index d3c6bb7..57a2ec8 100644
--- a/src/decode.h
+++ b/src/decode.h
@@ -78,7 +78,7 @@ struct internal_state {
void (*flush_output)(struct aec_stream *);
/* previous output for post-processing */
- int64_t last_out;
+ int32_t last_out;
/* minimum integer for post-processing */
int64_t xmin;