summaryrefslogtreecommitdiff
path: root/src/decode.c
diff options
context:
space:
mode:
authorMoritz Hanke <hanke@dkrz.de>2012-12-10 13:46:54 +0100
committerThomas Jahns <jahns@dkrz.de>2013-02-19 11:33:02 +0100
commitb20512d2a44fa789eab7fafc60f4cad6cb22ed71 (patch)
treeb118d7db3dc34042e9a056a85f4035b132ee133d /src/decode.c
parent69837c2fffa353a9441075f3bf7fc8f227afb2bb (diff)
downloadlibaec-b20512d2a44fa789eab7fafc60f4cad6cb22ed71.tar.gz
libaec-b20512d2a44fa789eab7fafc60f4cad6cb22ed71.tar.bz2
libaec-b20512d2a44fa789eab7fafc60f4cad6cb22ed71.zip
unrolling in fill_acc
Diffstat (limited to 'src/decode.c')
-rw-r--r--src/decode.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c
index 739c218..6787783 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -220,8 +220,25 @@ static inline void fill_acc(struct aec_stream *strm)
strm->avail_in -= b;
strm->state->bitp += b << 3;
- while (b--)
+
+ switch (b) {
+
+ case (7):
+ strm->state->acc = (strm->state->acc << 8) | *strm->next_in++;
+ case (6):
+ strm->state->acc = (strm->state->acc << 8) | *strm->next_in++;
+ case (5):
+ strm->state->acc = (strm->state->acc << 8) | *strm->next_in++;
+ case (4):
strm->state->acc = (strm->state->acc << 8) | *strm->next_in++;
+ case (3):
+ strm->state->acc = (strm->state->acc << 8) | *strm->next_in++;
+ case (2):
+ strm->state->acc = (strm->state->acc << 8) | *strm->next_in++;
+ case (1):
+ strm->state->acc = (strm->state->acc << 8) | *strm->next_in++;
+ };
+
}
static inline uint32_t direct_get(struct aec_stream *strm, unsigned int n)