diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-07-11 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:52 +0300 |
commit | 7038848692e7049234f223703522681a19db49a5 (patch) | |
tree | 38c5acef39a775a1f58f81b13be81fc6ef8c72e3 /CPP/7zip/Compress | |
parent | fd8b1d78b496fe38193bf8c5e86af3b43f0b022d (diff) |
4.49 beta
Diffstat (limited to 'CPP/7zip/Compress')
-rwxr-xr-x | CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Lzx/LzxDecoder.cpp | 31 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Lzx/LzxDecoder.h | 4 |
3 files changed, 25 insertions, 12 deletions
diff --git a/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp b/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp index 90c122fc..d8d785e2 100755 --- a/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp +++ b/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp @@ -159,7 +159,7 @@ int main2(int n, const char *args[]) g_IsNT = IsItWindowsNT(); #endif - fprintf(stderr, "\nLZMA 4.48 Copyright (c) 1999-2007 Igor Pavlov 2007-06-24\n"); + fprintf(stderr, "\nLZMA 4.49 Copyright (c) 1999-2007 Igor Pavlov 2007-07-05\n"); if (n == 1) { diff --git a/CPP/7zip/Compress/Lzx/LzxDecoder.cpp b/CPP/7zip/Compress/Lzx/LzxDecoder.cpp index 0ba4b822..8beb879b 100755 --- a/CPP/7zip/Compress/Lzx/LzxDecoder.cpp +++ b/CPP/7zip/Compress/Lzx/LzxDecoder.cpp @@ -16,9 +16,10 @@ namespace NLzx { const int kLenIdNeedInit = -2; -CDecoder::CDecoder(): +CDecoder::CDecoder(bool wimMode): _keepHistory(false), - m_AlignPos(0) + m_AlignPos(0), + _wimMode(wimMode) { m_x86ConvertOutStreamSpec = new Cx86ConvertOutStream; m_x86ConvertOutStream = m_x86ConvertOutStreamSpec; @@ -96,12 +97,18 @@ bool CDecoder::ReadTables(void) int blockType = (int)ReadBits(kNumBlockTypeBits); if (blockType > kBlockTypeUncompressed) return false; - m_UnCompressedBlockSize = m_InBitStream.ReadBitsBig(kUncompressedBlockSizeNumBits); - + if (_wimMode) + if (ReadBits(1) == 1) + m_UnCompressedBlockSize = (1 << 15); + else + m_UnCompressedBlockSize = ReadBits(16); + else + m_UnCompressedBlockSize = m_InBitStream.ReadBitsBig(kUncompressedBlockSizeNumBits); + m_IsUncompressedBlock = (blockType == kBlockTypeUncompressed); if (m_IsUncompressedBlock) { - m_InBitStream.ReadBits(16 - m_InBitStream.GetBitPosition()); + ReadBits(16 - m_InBitStream.GetBitPosition()); if (!m_InBitStream.ReadUInt32(m_RepDistances[0])) return false; m_RepDistances[0]--; @@ -171,12 +178,16 @@ HRESULT CDecoder::CodeSpec(UInt32 curSize) { m_UnCompressedBlockSize = 0; ClearPrevLevels(); - UInt32 i86TranslationSize = 0; - bool translationMode = (ReadBits(1) != 0); - if (translationMode) + UInt32 i86TranslationSize = 12000000; + bool translationMode = true; + if (!_wimMode) { - i86TranslationSize = ReadBits(16) << 16; - i86TranslationSize |= ReadBits(16); + translationMode = (ReadBits(1) != 0); + if (translationMode) + { + i86TranslationSize = ReadBits(16) << 16; + i86TranslationSize |= ReadBits(16); + } } m_x86ConvertOutStreamSpec->Init(translationMode, i86TranslationSize); diff --git a/CPP/7zip/Compress/Lzx/LzxDecoder.h b/CPP/7zip/Compress/Lzx/LzxDecoder.h index a62662ec..7c549f45 100755 --- a/CPP/7zip/Compress/Lzx/LzxDecoder.h +++ b/CPP/7zip/Compress/Lzx/LzxDecoder.h @@ -139,6 +139,8 @@ class CDecoder : int _remainLen; int m_AlignPos; + bool _wimMode; + UInt32 ReadBits(UInt32 numBits); bool ReadTable(Byte *lastLevels, Byte *newLevels, UInt32 numSymbols); bool ReadTables(); @@ -151,7 +153,7 @@ class CDecoder : const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); public: - CDecoder(); + CDecoder(bool wimMode = false); MY_UNKNOWN_IMP |