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
be6f02ca
Commit
be6f02ca
authored
Nov 29, 2012
by
Mathis Rosenhauer
Committed by
Thomas Jahns
Feb 19, 2013
Browse files
unfilter speedup by Moritz
parent
16cc61df
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/decode.c
View file @
be6f02ca
...
...
@@ -73,9 +73,9 @@
#define FLUSH(KIND) \
static void flush_##KIND(struct aec_stream *strm) \
{ \
int
64
_t
x, d, th, lower, m;
\
int64_t d
ata;
\
u
int
32
_t
*bp, *bend, *flush_end;
\
u
int
32
_t
*bp, *flush_end;
\
int64_t d
, m, th2;
\
int
64
_t
data, med;
\
struct internal_state *state = strm->state; \
\
flush_end = state->bufp; \
...
...
@@ -93,26 +93,28 @@
state->flush_start++; \
} \
\
data = state->last_out; \
if (strm->flags & AEC_DATA_SIGNED) \
med = 0; \
else \
med = (state->xmax - state->xmin) / 2 + 1; \
\
for (bp = state->flush_start; bp < flush_end; bp++) { \
d = *bp; \
x = state->last_out; \
lower = x - state->xmin; \
th = MIN(lower, state->xmax - x); \
\
if (d <= 2 * th) { \
if (d & 1) \
data = x - (d + 1) / 2; \
else \
data = x + d / 2; \
th2 = (data < med ? \
data - state->xmin : \
state->xmax - data) << 1; \
if (d <= th2) { \
data += ((d + 1) / 2 ^ -(d & 1)) + (d & 1); \
} else { \
if (
th == lower)
\
data =
x
+
d - th;
\
if (
data < med)
\
data =
d
+
state->xmin;
\
else \
data =
x + th - d;
\
data =
state->xmax - d;
\
} \
put_##KIND(strm, data); \
state->last_out = data; \
} \
state->last_out = data; \
} else { \
for (bp = state->flush_start; bp < flush_end; bp++) \
put_##KIND(strm, *bp); \
...
...
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