Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathis Rosenhauer
libaec
Commits
ce2f70dc
Commit
ce2f70dc
authored
Dec 07, 2012
by
Moritz Hanke
Committed by
Thomas Jahns
Feb 19, 2013
Browse files
faster postprocessing
parent
7c3a8b05
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/decode.c
View file @
ce2f70dc
...
...
@@ -75,7 +75,7 @@
{ \
uint32_t *bp, *flush_end; \
int64_t d, m, th2; \
int64_t data, med
;
\
int64_t data, med
, half_d, xmin, xmax;
\
struct internal_state *state = strm->state; \
\
flush_end = state->rsip; \
...
...
@@ -99,18 +99,31 @@
else \
med = (state->xmax - state->xmin) / 2 + 1; \
\
xmin = state->xmin; \
xmax = state->xmax; \
\
for (bp = state->flush_start; bp < flush_end; bp++) { \
d = *bp; \
th2 = (data < med ? \
data - state->xmin : \
state->xmax - data) << 1; \
if (d <= th2) { \
data += ((d + 1) / 2 ^ -(d & 1)) + (d & 1); \
half_d = (d + 1) >> 1; \
\
if (data < med) { \
if (half_d <= data - xmin) { \
if (d & 1) \
data -= half_d; \
else \
data += half_d; \
} else { \
data = xmin + d; \
} \
} else { \
if (data < med) \
data = state->xmin + d; \
else \
data = state->xmax - d; \
if (half_d <= xmax - data) { \
if (d & 1) \
data -= half_d; \
else \
data += half_d; \
} else { \
data = xmax - d; \
} \
} \
put_##KIND(strm, data); \
} \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment