Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mathis Rosenhauer
libaec
Commits
2fbc4ad9
Commit
2fbc4ad9
authored
Dec 13, 2012
by
Moritz Hanke
Committed by
Thomas Jahns
Feb 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unrolling
parent
790a3612
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
4 deletions
+59
-4
src/encode.c
src/encode.c
+59
-4
No files found.
src/encode.c
View file @
2fbc4ad9
...
@@ -167,7 +167,6 @@ EMITBLOCK_FS(1);
...
@@ -167,7 +167,6 @@ EMITBLOCK_FS(1);
Emit the k LSB of a whole block of input data. \
Emit the k LSB of a whole block of input data. \
*/
\
*/
\
\
\
int b; \
uint64_t a; \
uint64_t a; \
struct internal_state *state = strm->state; \
struct internal_state *state = strm->state; \
uint32_t *in = state->block + ref; \
uint32_t *in = state->block + ref; \
...
@@ -187,9 +186,65 @@ EMITBLOCK_FS(1);
...
@@ -187,9 +186,65 @@ EMITBLOCK_FS(1);
a += ((uint64_t)(*in++) & mask) << p; \
a += ((uint64_t)(*in++) & mask) << p; \
} \
} \
\
\
for (b = 56; b > (p & ~7); b -= 8) \
switch (p & ~ 7) { \
*o++ = a >> b; \
case 0: \
a >>= b; \
o[0] = a >> 56; \
o[1] = a >> 48; \
o[2] = a >> 40; \
o[3] = a >> 32; \
o[4] = a >> 24; \
o[5] = a >> 16; \
o[6] = a >> 8; \
o += 7; \
break; \
case 8: \
o[0] = a >> 56; \
o[1] = a >> 48; \
o[2] = a >> 40; \
o[3] = a >> 32; \
o[4] = a >> 24; \
o[5] = a >> 16; \
a >>= 8; \
o += 6; \
break; \
case 16: \
o[0] = a >> 56; \
o[1] = a >> 48; \
o[2] = a >> 40; \
o[3] = a >> 32; \
o[4] = a >> 24; \
a >>= 16; \
o += 5; \
break; \
case 24: \
o[0] = a >> 56; \
o[1] = a >> 48; \
o[2] = a >> 40; \
o[3] = a >> 32; \
a >>= 24; \
o += 4; \
break; \
case 32: \
o[0] = a >> 56; \
o[1] = a >> 48; \
o[2] = a >> 40; \
a >>= 32; \
o += 3; \
break; \
case 40: \
o[0] = a >> 56; \
o[1] = a >> 48; \
a >>= 40; \
o += 2; \
break; \
case 48: \
*o++ = a >> 56; \
a >>= 48; \
break; \
default: \
a >>= 56; \
break; \
} \
} \
} \
\
\
*o = a; \
*o = a; \
...
...
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