summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Hanke <hanke@dkrz.de>2014-09-09 16:25:12 +0200
committerMathis Rosenhauer <rosenhauer@dkrz.de>2014-10-24 16:08:26 +0200
commit19f3f8e7c222a52bd6448f6d18ce91ecc3f05fb4 (patch)
treeb85cb1102bbdcab03bd7f49f15a3d7dc01593cdc
parentef5715db84e889f8e3ef28d7d5c8129879555047 (diff)
downloadlibaec-19f3f8e7c222a52bd6448f6d18ce91ecc3f05fb4.tar.gz
libaec-19f3f8e7c222a52bd6448f6d18ce91ecc3f05fb4.tar.bz2
libaec-19f3f8e7c222a52bd6448f6d18ce91ecc3f05fb4.zip
removes "int32_t xmin" from FLUSH
-rw-r--r--src/decode.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/decode.c b/src/decode.c
index 526a643..099fc44 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -117,9 +117,8 @@
\
} else { \
\
- int32_t xmax, xmin, d; \
+ int32_t xmax, d; \
data = state->last_out; \
- xmin = state->xmin; \
xmax = state->xmax; \
\
for (bp = state->flush_start; bp < flush_end; bp++) { \
@@ -127,10 +126,10 @@
half_d = ((uint32_t)d >> 1) + (d & 1); \
\
if (data < 0) { \
- if (half_d <= data - xmin) { \
+ if (half_d <= xmax + data + 1) { \
data += ((uint32_t)d >> 1)^(~((d & 1) - 1)); \
} else { \
- data = xmin + d; \
+ data = d - xmax - 1; \
} \
} else { \
if (half_d <= xmax - data) { \