Commit 9af97721 authored by Moritz Hanke's avatar Moritz Hanke Committed by Mathis Rosenhauer

makes last_out int32_t

parent 19f3f8e7
...@@ -68,8 +68,7 @@ ...@@ -68,8 +68,7 @@
static void flush_##KIND(struct aec_stream *strm) \ static void flush_##KIND(struct aec_stream *strm) \
{ \ { \
uint32_t *flush_end, *bp, half_d; \ uint32_t *flush_end, *bp, half_d; \
int32_t data; \ int32_t data, m; \
int64_t m; \
struct internal_state *state = strm->state; \ struct internal_state *state = strm->state; \
\ \
flush_end = state->rsip; \ flush_end = state->rsip; \
...@@ -79,7 +78,7 @@ ...@@ -79,7 +78,7 @@
state->last_out = *state->rsi_buffer; \ state->last_out = *state->rsi_buffer; \
\ \
if (strm->flags & AEC_DATA_SIGNED) { \ 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 */ \ /* Reference samples have to be sign extended */ \
state->last_out = (state->last_out ^ m) - m; \ state->last_out = (state->last_out ^ m) - m; \
} \ } \
...@@ -87,11 +86,12 @@ ...@@ -87,11 +86,12 @@
state->flush_start++; \ state->flush_start++; \
} \ } \
\ \
data = state->last_out; \
\
if (state->xmin == 0) { \ if (state->xmin == 0) { \
\ \
uint32_t xmax, med, d; \ uint32_t xmax, med, d; \
med = state->xmax / 2 + 1; \ med = state->xmax / 2 + 1; \
data = (uint32_t)state->last_out; \
xmax = state->xmax; \ xmax = state->xmax; \
\ \
for (bp = state->flush_start; bp < flush_end; bp++) { \ for (bp = state->flush_start; bp < flush_end; bp++) { \
...@@ -118,7 +118,6 @@ ...@@ -118,7 +118,6 @@
} else { \ } else { \
\ \
int32_t xmax, d; \ int32_t xmax, d; \
data = state->last_out; \
xmax = state->xmax; \ xmax = state->xmax; \
\ \
for (bp = state->flush_start; bp < flush_end; bp++) { \ for (bp = state->flush_start; bp < flush_end; bp++) { \
......
...@@ -78,7 +78,7 @@ struct internal_state { ...@@ -78,7 +78,7 @@ struct internal_state {
void (*flush_output)(struct aec_stream *); void (*flush_output)(struct aec_stream *);
/* previous output for post-processing */ /* previous output for post-processing */
int64_t last_out; int32_t last_out;
/* minimum integer for post-processing */ /* minimum integer for post-processing */
int64_t xmin; int64_t xmin;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment