Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
libaec
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mathis Rosenhauer
libaec
Commits
ef5715db
Commit
ef5715db
authored
Sep 09, 2014
by
Moritz Hanke
Committed by
Mathis Rosenhauer
Oct 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uses 32bit Operations in FLUSH
parent
d010b55c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
28 deletions
+55
-28
src/decode.c
src/decode.c
+55
-28
No files found.
src/decode.c
View file @
ef5715db
...
...
@@ -67,9 +67,9 @@
#define FLUSH(KIND) \
static void flush_##KIND(struct aec_stream *strm) \
{ \
uint32_t *
bp, *flush_end;
\
int
64_t d, m
; \
int64_t
data, med, half_d, xmin, xmax;
\
uint32_t *
flush_end, *bp, half_d;
\
int
32_t data
; \
int64_t
m;
\
struct internal_state *state = strm->state; \
\
flush_end = state->rsip; \
...
...
@@ -87,35 +87,62 @@
state->flush_start++; \
} \
\
data = state->last_out; \
if (strm->flags & AEC_DATA_SIGNED) \
med = 0; \
else \
med = (state->xmax - state->xmin) / 2 + 1; \
if (state->xmin == 0) { \
\
xmin = state->xmin; \
xmax = state->xmax; \
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++) {
\
d = *bp;
\
half_d = (d + 1) >> 1;
\
for (bp = state->flush_start; bp < flush_end; bp++) {
\
d = *bp;
\
half_d = (d >> 1) + (d & 1);
\
\
if (data < med) { \
if (half_d <= data - xmin) { \
data += (d >> 1)^(~((d & 1) - 1)); \
} else { \
data = xmin + d; \
} \
} else { \
if (half_d <= xmax - data) { \
data += (d >> 1)^(~((d & 1) - 1)); \
} else { \
data = xmax - d; \
} \
} \
put_##KIND(strm, (uint32_t)data); \
if (data < med) { \
if (half_d <= data) { \
data += (d >> 1)^(~((d & 1) - 1)); \
} else { \
data = d; \
} \
} else { \
if (half_d <= xmax - data) { \
data += (d >> 1)^(~((d & 1) - 1)); \
} else { \
data = xmax - d; \
} \
} \
put_##KIND(strm, (uint32_t)data); \
} \
state->last_out = data; \
\
} else { \
\
int32_t xmax, xmin, d; \
data = state->last_out; \
xmin = state->xmin; \
xmax = state->xmax; \
\
for (bp = state->flush_start; bp < flush_end; bp++) { \
d = *bp; \
half_d = ((uint32_t)d >> 1) + (d & 1); \
\
if (data < 0) { \
if (half_d <= data - xmin) { \
data += ((uint32_t)d >> 1)^(~((d & 1) - 1)); \
} else { \
data = xmin + d; \
} \
} else { \
if (half_d <= xmax - data) { \
data += ((uint32_t)d >> 1)^(~((d & 1) - 1)); \
} else { \
data = xmax - d; \
} \
} \
put_##KIND(strm, (uint32_t)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