4.40 beta

This commit is contained in:
Igor Pavlov
2006-05-01 00:00:00 +00:00
committed by Kornel Lesiński
parent 3415684502
commit bd9a40b0ed
61 changed files with 2710 additions and 187 deletions

View File

@@ -163,6 +163,10 @@ SOURCE=.\BranchCoder.h
# End Source File
# Begin Source File
SOURCE=.\BranchTypes.h
# End Source File
# Begin Source File
SOURCE=.\BranchX86.h
# End Source File
# Begin Source File

View File

@@ -3,7 +3,7 @@
#ifndef __BRANCH_ARM_H
#define __BRANCH_ARM_H
#include "Common/Types.h"
#include "BranchTypes.h"
UInt32 ARM_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding);

View File

@@ -3,7 +3,7 @@
#ifndef __BRANCH_ARM_THUMB_H
#define __BRANCH_ARM_THUMB_H
#include "Common/Types.h"
#include "BranchTypes.h"
UInt32 ARMThumb_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding);

View File

@@ -3,7 +3,7 @@
#ifndef __BRANCH_IA64_H
#define __BRANCH_IA64_H
#include "Common/Types.h"
#include "BranchTypes.h"
UInt32 IA64_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding);

View File

@@ -3,7 +3,7 @@
#ifndef __BRANCH_PPC_H
#define __BRANCH_PPC_H
#include "Common/Types.h"
#include "BranchTypes.h"
UInt32 PPC_B_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding);

View File

@@ -3,7 +3,7 @@
#ifndef __BRANCH_SPARC_H
#define __BRANCH_SPARC_H
#include "Common/Types.h"
#include "BranchTypes.h"
UInt32 SPARC_B_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding);

View File

@@ -0,0 +1,15 @@
/* BranchTypes.h */
#ifndef __BRANCHTYPES_H
#define __BRANCHTYPES_H
typedef unsigned char Byte;
typedef unsigned short UInt16;
#ifdef _LZMA_UINT32_IS_ULONG
typedef unsigned long UInt32;
#else
typedef unsigned int UInt32;
#endif
#endif

View File

@@ -3,13 +3,7 @@
#ifndef __BRANCHX86_H
#define __BRANCHX86_H
#ifndef UInt32
#define UInt32 unsigned int
#endif
#ifndef Byte
#define Byte unsigned char
#endif
#include "BranchTypes.h"
#define x86_Convert_Init(prevMask, prevPos) { prevMask = 0; prevPos = (UInt32)(-5); }

View File

@@ -58,12 +58,6 @@ void CEncoder::StartNewBlock()
m_Items[i].Freq = 0;
}
void CEncoder::SetFreqs(const UInt32 *freqs)
{
for (UInt32 i = 0; i < m_NumSymbols; i++)
m_Items[i].Freq = freqs[i];
}
static const int kSmallest = 1;
// ===========================================================================

View File

@@ -54,8 +54,6 @@ public:
void AddSymbol(UInt32 symbol) { m_Items[symbol].Freq++; }
void SetFreqs(const UInt32 *freqs);
UInt32 GetPrice(const Byte *length) const
{
UInt32 price = 0;

View File

@@ -272,6 +272,10 @@ SOURCE=..\LZ\LZOutWindow.h
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\Branch\BranchTypes.h
# End Source File
# Begin Source File
SOURCE=..\Branch\BranchX86.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
@@ -292,6 +296,10 @@ SOURCE=..\LZMA_C\LzmaDecode.c
SOURCE=..\LZMA_C\LzmaDecode.h
# End Source File
# Begin Source File
SOURCE=..\LZMA_C\LzmaTypes.h
# End Source File
# End Group
# End Group
# Begin Group "Windows"

View File

@@ -152,7 +152,7 @@ int main2(int n, const char *args[])
g_IsNT = IsItWindowsNT();
#endif
fprintf(stderr, "\nLZMA 4.37 Copyright (c) 1999-2006 Igor Pavlov 2006-03-18\n");
fprintf(stderr, "\nLZMA 4.40 Copyright (c) 1999-2006 Igor Pavlov 2006-05-01\n");
if (n == 1)
{

View File

@@ -82,11 +82,6 @@ public:
::MidFree(Buffer);
Buffer = 0;
}
void Init()
{
RG.Init();
Rep0 = 1;
}
bool Alloc(UInt32 bufferSize)
{
if (Buffer != 0 && BufferSize == bufferSize)
@@ -120,6 +115,8 @@ public:
UInt32 GetLen2() { return RG.GetRnd(2 + (int)RG.GetRnd(2)); }
void Generate()
{
RG.Init();
Rep0 = 1;
while(Pos < BufferSize)
{
if (GetRndBit() == 0 || Pos < 1)
@@ -413,7 +410,6 @@ int LzmaBenchmark(FILE *f, UInt32 numIterations, UInt32 dictionarySize)
encoderSpec->WriteCoderProperties(propStream);
CBenchRandomGenerator rg;
rg.Init();
if (!rg.Alloc(kBufferSize))
{
fprintf(f, "\nError: Can't allocate memory\n");

View File

@@ -2,7 +2,7 @@
LzmaDecode.c
LZMA Decoder (optimized for Speed version)
LZMA SDK 4.22 Copyright (c) 1999-2005 Igor Pavlov (2005-06-10)
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
http://www.7-zip.org/
LZMA SDK is licensed under two licenses:
@@ -21,10 +21,6 @@
#include "LzmaDecode.h"
#ifndef Byte
#define Byte unsigned char
#endif
#define kNumTopBits 24
#define kTopValue ((UInt32)1 << kNumTopBits)

View File

@@ -2,7 +2,7 @@
LzmaDecode.h
LZMA Decoder interface
LZMA SDK 4.21 Copyright (c) 1999-2005 Igor Pavlov (2005-06-08)
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
http://www.7-zip.org/
LZMA SDK is licensed under two licenses:
@@ -22,6 +22,8 @@
#ifndef __LZMADECODE_H
#define __LZMADECODE_H
#include "LzmaTypes.h"
/* #define _LZMA_IN_CB */
/* Use callback for input data */
@@ -35,30 +37,10 @@
/* #define _LZMA_LOC_OPT */
/* Enable local speed optimizations inside code */
/* #define _LZMA_SYSTEM_SIZE_T */
/* Use system's size_t. You can use it to enable 64-bit sizes supporting*/
#ifndef UInt32
#ifdef _LZMA_UINT32_IS_ULONG
#define UInt32 unsigned long
#else
#define UInt32 unsigned int
#endif
#endif
#ifndef SizeT
#ifdef _LZMA_SYSTEM_SIZE_T
#include <stddef.h>
#define SizeT size_t
#else
#define SizeT UInt32
#endif
#endif
#ifdef _LZMA_PROB32
#define CProb UInt32
#else
#define CProb unsigned short
#define CProb UInt16
#endif
#define LZMA_RESULT_OK 0

View File

@@ -2,7 +2,7 @@
LzmaDecodeSize.c
LZMA Decoder (optimized for Size version)
LZMA SDK 4.27 Copyright (c) 1999-2005 Igor Pavlov (2005-08-07)
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
http://www.7-zip.org/
LZMA SDK is licensed under two licenses:
@@ -21,10 +21,6 @@
#include "LzmaDecode.h"
#ifndef Byte
#define Byte unsigned char
#endif
#define kNumTopBits 24
#define kTopValue ((UInt32)1 << kNumTopBits)

View File

@@ -2,7 +2,7 @@
LzmaStateDecode.c
LZMA Decoder (State version)
LZMA SDK 4.21 Copyright (c) 1999-2005 Igor Pavlov (2005-06-08)
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
http://www.7-zip.org/
LZMA SDK is licensed under two licenses:

View File

@@ -2,7 +2,7 @@
LzmaStateDecode.h
LZMA Decoder interface (State version)
LZMA SDK 4.21 Copyright (c) 1999-2005 Igor Pavlov (2005-06-08)
LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
http://www.7-zip.org/
LZMA SDK is licensed under two licenses:
@@ -22,35 +22,16 @@
#ifndef __LZMASTATEDECODE_H
#define __LZMASTATEDECODE_H
#include "LzmaTypes.h"
/* #define _LZMA_PROB32 */
/* It can increase speed on some 32-bit CPUs,
but memory usage will be doubled in that case */
/* #define _LZMA_SYSTEM_SIZE_T */
/* Use system's size_t. You can use it to enable 64-bit sizes supporting*/
#ifndef UInt32
#ifdef _LZMA_UINT32_IS_ULONG
#define UInt32 unsigned long
#else
#define UInt32 unsigned int
#endif
#endif
#ifndef SizeT
#ifdef _LZMA_SYSTEM_SIZE_T
#include <stddef.h>
#define SizeT size_t
#else
#define SizeT UInt32
#endif
#endif
#ifdef _LZMA_PROB32
#define CProb UInt32
#else
#define CProb unsigned short
#define CProb UInt16
#endif
#define LZMA_RESULT_OK 0

View File

@@ -0,0 +1,32 @@
/*
LzmaTypes.h
Types for LZMA Decoder
This file written and distributed to public domain by Igor Pavlov.
This file is part of LZMA SDK 4.40 (2006-05-01)
*/
#ifndef __LZMATYPES_H
#define __LZMATYPES_H
typedef unsigned char Byte;
typedef unsigned short UInt16;
#ifdef _LZMA_UINT32_IS_ULONG
typedef unsigned long UInt32;
#else
typedef unsigned int UInt32;
#endif
/* #define _LZMA_SYSTEM_SIZE_T */
/* Use system's size_t. You can use it to enable 64-bit sizes supporting */
#ifdef _LZMA_SYSTEM_SIZE_T
#include <stddef.h>
typedef size_t SizeT;
#else
typedef UInt32 SizeT;
#endif
#endif