From b519321aa915b8023a6cc3479ace64613faf0810 Mon Sep 17 00:00:00 2001 From: Moritz Hanke Date: Tue, 9 Sep 2014 17:36:14 +0200 Subject: removes on loop in FLUSH --- src/decode.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/decode.c b/src/decode.c index 3a25e6e..f3b94e8 100644 --- a/src/decode.c +++ b/src/decode.c @@ -97,21 +97,14 @@ for (bp = state->flush_start; bp < flush_end; bp++) { \ d = *bp; \ half_d = (d >> 1) + (d & 1); \ - \ /*in this case: data >= med == data & med */ \ - if (data & med) { \ - /*in this case: xmax - data == xmax ^ data */ \ - if (half_d <= (xmax ^ data)) { \ - data += (d >> 1)^(~((d & 1) - 1)); \ - } else { \ - data = xmax ^ d; \ - } \ + uint32_t mask = (data & med)?xmax:0; \ + \ + /*in this case: xmax - data == xmax ^ data */ \ + if (half_d <= (mask ^ data)) { \ + data += (d >> 1)^(~((d & 1) - 1)); \ } else { \ - if (half_d <= data) { \ - data += (d >> 1)^(~((d & 1) - 1)); \ - } else { \ - data = d; \ - } \ + data = mask ^ d; \ } \ put_##KIND(strm, (uint32_t)data); \ } \ -- cgit v1.2.3