From: Moritz Hanke Date: Tue, 9 Sep 2014 15:10:59 +0000 (+0200) Subject: replace "<" in FLUSH with "&" X-Git-Tag: accepted/tizen/5.0/unified/20181102.025501~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67fd21959334af7ea0594b779f676e5e88b48a19;p=platform%2Fupstream%2Flibaec.git replace "<" in FLUSH with "&" --- diff --git a/src/decode.c b/src/decode.c index 22487fd..3a25e6e 100644 --- a/src/decode.c +++ b/src/decode.c @@ -98,18 +98,19 @@ d = *bp; \ half_d = (d >> 1) + (d & 1); \ \ - if (data < med) { \ - if (half_d <= data) { \ + /*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 = d; \ + data = xmax ^ d; \ } \ } else { \ - /*in this case (xmax - data == xmax ^ data)*/ \ - if (half_d <= (xmax ^ data)) { \ + if (half_d <= data) { \ data += (d >> 1)^(~((d & 1) - 1)); \ } else { \ - data = xmax ^ d; \ + data = d; \ } \ } \ put_##KIND(strm, (uint32_t)data); \