本文整理汇总了Java中SevenZip.Compression.LZMA.Base类的典型用法代码示例。如果您正苦于以下问题:Java Base类的具体用法?Java Base怎么用?Java Base使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Base类属于SevenZip.Compression.LZMA包,在下文中一共展示了Base类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Encode
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
public void Encode(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, int symbol, int posState) throws IOException
{
if (symbol < Base.kNumLowLenSymbols)
{
rangeEncoder.Encode(_choice, 0, 0);
_lowCoder[posState].Encode(rangeEncoder, symbol);
}
else
{
symbol -= Base.kNumLowLenSymbols;
rangeEncoder.Encode(_choice, 0, 1);
if (symbol < Base.kNumMidLenSymbols)
{
rangeEncoder.Encode(_choice, 1, 0);
_midCoder[posState].Encode(rangeEncoder, symbol);
}
else
{
rangeEncoder.Encode(_choice, 1, 1);
_highCoder.Encode(rangeEncoder, symbol - Base.kNumMidLenSymbols);
}
}
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:24,代码来源:Encoder.java
示例2: SetPrices
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
public void SetPrices(int posState, int numSymbols, int[] prices, int st)
{
int a0 = SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_choice[0]);
int a1 = SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_choice[0]);
int b0 = a1 + SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_choice[1]);
int b1 = a1 + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_choice[1]);
int i = 0;
for (i = 0; i < Base.kNumLowLenSymbols; i++)
{
if (i >= numSymbols)
return;
prices[st + i] = a0 + _lowCoder[posState].GetPrice(i);
}
for (; i < Base.kNumLowLenSymbols + Base.kNumMidLenSymbols; i++)
{
if (i >= numSymbols)
return;
prices[st + i] = b0 + _midCoder[posState].GetPrice(i - Base.kNumLowLenSymbols);
}
for (; i < numSymbols; i++)
prices[st + i] = b1 + _highCoder.GetPrice(i - Base.kNumLowLenSymbols - Base.kNumMidLenSymbols);
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:23,代码来源:Encoder.java
示例3: Create
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
void Create()
{
if (_matchFinder == null)
{
SevenZip.Compression.LZ.BinTree bt = new SevenZip.Compression.LZ.BinTree();
int numHashBytes = 4;
if (_matchFinderType == EMatchFinderTypeBT2)
numHashBytes = 2;
bt.SetType(numHashBytes);
_matchFinder = bt;
}
_literalEncoder.Create(_numLiteralPosStateBits, _numLiteralContextBits);
if (_dictionarySize == _dictionarySizePrev && _numFastBytesPrev == _numFastBytes)
return;
_matchFinder.Create(_dictionarySize, kNumOpts, _numFastBytes, Base.kMatchMaxLen + 1);
_dictionarySizePrev = _dictionarySize;
_numFastBytesPrev = _numFastBytes;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:20,代码来源:Encoder.java
示例4: GetPureRepPrice
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
int GetPureRepPrice(int repIndex, int state, int posState)
{
int price;
if (repIndex == 0)
{
price = SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRepG0[state]);
price += SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep0Long[(state << Base.kNumPosStatesBitsMax) + posState]);
}
else
{
price = SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRepG0[state]);
if (repIndex == 1)
price += SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRepG1[state]);
else
{
price += SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRepG1[state]);
price += SevenZip.Compression.RangeCoder.Encoder.GetPrice(_isRepG2[state], repIndex - 2);
}
}
return price;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:22,代码来源:Encoder.java
示例5: WriteEndMarker
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
void WriteEndMarker(int posState) throws IOException
{
if (!_writeEndMark)
return;
_rangeEncoder.Encode(_isMatch, (_state << Base.kNumPosStatesBitsMax) + posState, 1);
_rangeEncoder.Encode(_isRep, _state, 0);
_state = Base.StateUpdateMatch(_state);
int len = Base.kMatchMinLen;
_lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
int posSlot = (1 << Base.kNumPosSlotBits) - 1;
int lenToPosState = Base.GetLenToPosState(len);
_posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
int footerBits = 30;
int posReduced = (1 << footerBits) - 1;
_rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits);
_posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask);
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:19,代码来源:Encoder.java
示例6: SetStreams
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
void SetStreams(java.io.InputStream inStream, java.io.OutputStream outStream,
long inSize, long outSize)
{
_inStream = inStream;
_finished = false;
Create();
SetOutStream(outStream);
Init();
// if (!_fastMode)
{
FillDistancesPrices();
FillAlignPrices();
}
_lenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
_lenEncoder.UpdateTables(1 << _posStateBits);
_repMatchLenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
_repMatchLenEncoder.UpdateTables(1 << _posStateBits);
nowPos64 = 0;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:23,代码来源:Encoder.java
示例7: Init
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
void Init() throws IOException
{
m_OutWindow.Init(false);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsMatchDecoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRep0LongDecoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepDecoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG0Decoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG1Decoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG2Decoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_PosDecoders);
m_LiteralDecoder.Init();
int i;
for (i = 0; i < Base.kNumLenToPosStates; i++)
m_PosSlotDecoder[i].Init();
m_LenDecoder.Init();
m_RepLenDecoder.Init();
m_PosAlignDecoder.Init();
m_RangeDecoder.Init();
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:22,代码来源:Decoder.java
示例8: Init
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
void Init() throws IOException {
m_OutWindow.Init(false);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsMatchDecoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRep0LongDecoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepDecoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG0Decoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG1Decoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG2Decoders);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_PosDecoders);
_rep0 = _rep1 = _rep2 = _rep3 = 0;
_state = Base.StateInit();
m_LiteralDecoder.Init();
int i;
for (i = 0; i < Base.kNumLenToPosStates; i++)
m_PosSlotDecoder[i].Init();
m_LenDecoder.Init();
m_RepLenDecoder.Init();
m_PosAlignDecoder.Init();
}
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:23,代码来源:Decoder.java
示例9: BaseInit
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
void BaseInit()
{
_state = Base.StateInit();
_previousByte = 0;
for (int i = 0; i < Base.kNumRepDistances; i++)
_repDistances[i] = 0;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:8,代码来源:Encoder.java
示例10: LenEncoder
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
public LenEncoder()
{
for (int posState = 0; posState < Base.kNumPosStatesEncodingMax; posState++)
{
_lowCoder[posState] = new BitTreeEncoder(Base.kNumLowLenBits);
_midCoder[posState] = new BitTreeEncoder(Base.kNumMidLenBits);
}
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:9,代码来源:Encoder.java
示例11: Encoder
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
public Encoder()
{
for (int i = 0; i < kNumOpts; i++)
_optimum[i] = new Optimal();
for (int i = 0; i < Base.kNumLenToPosStates; i++)
_posSlotEncoder[i] = new BitTreeEncoder(Base.kNumPosSlotBits);
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:8,代码来源:Encoder.java
示例12: ReadMatchDistances
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
int ReadMatchDistances() throws java.io.IOException
{
int lenRes = 0;
_numDistancePairs = _matchFinder.GetMatches(_matchDistances);
if (_numDistancePairs > 0)
{
lenRes = _matchDistances[_numDistancePairs - 2];
if (lenRes == _numFastBytes)
lenRes += _matchFinder.GetMatchLen((int)lenRes - 1, _matchDistances[_numDistancePairs - 1],
Base.kMatchMaxLen - lenRes);
}
_additionalOffset++;
return lenRes;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:15,代码来源:Encoder.java
示例13: GetPosLenPrice
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
int GetPosLenPrice(int pos, int len, int posState)
{
int price;
int lenToPosState = Base.GetLenToPosState(len);
if (pos < Base.kNumFullDistances)
price = _distancesPrices[(lenToPosState * Base.kNumFullDistances) + pos];
else
price = _posSlotPrices[(lenToPosState << Base.kNumPosSlotBits) + GetPosSlot2(pos)] +
_alignPrices[pos & Base.kAlignMask];
return price + _lenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:12,代码来源:Encoder.java
示例14: SetDictionarySize
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
public boolean SetDictionarySize(int dictionarySize)
{
int kDicLogSizeMaxCompress = 29;
if (dictionarySize < (1 << Base.kDicLogSizeMin) || dictionarySize > (1 << kDicLogSizeMaxCompress))
return false;
_dictionarySize = dictionarySize;
int dicLogSize;
for (dicLogSize = 0; dictionarySize > (1 << dicLogSize); dicLogSize++) ;
_distTableSize = dicLogSize * 2;
return true;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:12,代码来源:Encoder.java
示例15: SeNumFastBytes
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
public boolean SeNumFastBytes(int numFastBytes)
{
if (numFastBytes < 5 || numFastBytes > Base.kMatchMaxLen)
return false;
_numFastBytes = numFastBytes;
return true;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:8,代码来源:Encoder.java
示例16: SetLcLpPb
import SevenZip.Compression.LZMA.Base; //导入依赖的package包/类
public boolean SetLcLpPb(int lc, int lp, int pb)
{
if (
lp < 0 || lp > Base.kNumLitPosStatesBitsEncodingMax ||
lc < 0 || lc > Base.kNumLitContextBitsMax ||
pb < 0 || pb > Base.kNumPosStatesBitsEncodingMax)
return false;
_numLiteralPosStateBits = lp;
_numLiteralContextBits = lc;
_posStateBits = pb;
_posStateMask = ((1) << _posStateBits) - 1;
return true;
}
开发者ID:petersalomonsen,项目名称:frinika,代码行数:14,代码来源:Encoder.java
注:本文中的SevenZip.Compression.LZMA.Base类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论