diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2012-11-03 11:45:19 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-12-06 13:56:38 -0700 |
commit | 5fe8380db3d5cd9f6c155f800616bdcb6dd34d18 (patch) | |
tree | f524efbd3295b47de94db23a168718c5c89f8100 /lib/lzma/LzmaDec.c | |
parent | 0851020479c8e5180f4a4a26856195e141acd63c (diff) | |
download | u-boot-imx-5fe8380db3d5cd9f6c155f800616bdcb6dd34d18.zip u-boot-imx-5fe8380db3d5cd9f6c155f800616bdcb6dd34d18.tar.gz u-boot-imx-5fe8380db3d5cd9f6c155f800616bdcb6dd34d18.tar.bz2 |
lzma: update to lzma sdk 9.20
Updated code taken from latest lzma sdk release 9.20 at
http://downloads.sourceforge.net/sevenzip/lzma920.tar.bz2
This generates quite a lot of checkpatch warnings, but I guess we
need to keep the code style as is to avoid a massive job each time we
update this.
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/lzma/LzmaDec.c')
-rw-r--r-- | lib/lzma/LzmaDec.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/lzma/LzmaDec.c b/lib/lzma/LzmaDec.c index f941da2..4f45f80 100644 --- a/lib/lzma/LzmaDec.c +++ b/lib/lzma/LzmaDec.c @@ -1,5 +1,5 @@ /* LzmaDec.c -- LZMA Decoder -2008-11-06 : Igor Pavlov : Public domain */ +2009-09-20 : Igor Pavlov : Public domain */ #include <config.h> #include <common.h> @@ -116,12 +116,6 @@ StopCompilingDueBUG #endif -static const Byte kLiteralNextStates[kNumStates * 2] = -{ - 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5, - 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10 -}; - #define LZMA_DIC_MIN (1 << 12) /* First LZMA-symbol is always decoded. @@ -180,6 +174,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte if (state < kNumLitStates) { + state -= (state < 4) ? state : 3; symbol = 1; WATCHDOG_RESET(); @@ -190,6 +185,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte { unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; unsigned offs = 0x100; + state -= (state < 10) ? 3 : 6; symbol = 1; WATCHDOG_RESET(); @@ -207,9 +203,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte } dic[dicPos++] = (Byte)symbol; processedPos++; - - state = kLiteralNextStates[state]; - /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */ continue; } else @@ -395,7 +388,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte else if (distance >= checkDicSize) return SZ_ERROR_DATA; state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; - /* state = kLiteralNextStates[state]; */ } len += kMatchMinLen; |