Lines Matching refs:Base
4 import SevenZip.Compression.LZMA.Base;
53 int _state = Base.StateInit();
55 int[] _repDistances = new int[Base.kNumRepDistances];
59 _state = Base.StateInit(); in BaseInit()
61 for (int i = 0; i < Base.kNumRepDistances; i++) in BaseInit()
170 BitTreeEncoder[] _lowCoder = new BitTreeEncoder[Base.kNumPosStatesEncodingMax];
171 BitTreeEncoder[] _midCoder = new BitTreeEncoder[Base.kNumPosStatesEncodingMax];
172 BitTreeEncoder _highCoder = new BitTreeEncoder(Base.kNumHighLenBits);
177 for (int posState = 0; posState < Base.kNumPosStatesEncodingMax; posState++) in LenEncoder()
179 _lowCoder[posState] = new BitTreeEncoder(Base.kNumLowLenBits); in LenEncoder()
180 _midCoder[posState] = new BitTreeEncoder(Base.kNumMidLenBits); in LenEncoder()
198 if (symbol < Base.kNumLowLenSymbols) in Encode()
205 symbol -= Base.kNumLowLenSymbols; in Encode()
207 if (symbol < Base.kNumMidLenSymbols) in Encode()
215 _highCoder.Encode(rangeEncoder, symbol - Base.kNumMidLenSymbols); in Encode()
227 for (i = 0; i < Base.kNumLowLenSymbols; i++) in SetPrices()
233 for (; i < Base.kNumLowLenSymbols + Base.kNumMidLenSymbols; i++) in SetPrices()
237 prices[st + i] = b0 + _midCoder[posState].GetPrice(i - Base.kNumLowLenSymbols); in SetPrices()
240 prices[st + i] = b1 + _highCoder.GetPrice(i - Base.kNumLowLenSymbols - Base.kNumMidLenSymbols); in SetPrices()
244 public static final int kNumLenSpecSymbols = Base.kNumLowLenSymbols + Base.kNumMidLenSymbols;
248 int[] _prices = new int[Base.kNumLenSymbols<<Base.kNumPosStatesBitsEncodingMax];
250 int[] _counters = new int[Base.kNumPosStatesEncodingMax];
256 return _prices[posState * Base.kNumLenSymbols + symbol]; in GetPrice()
261 SetPrices(posState, _tableSize, _prices, posState * Base.kNumLenSymbols); in UpdateTable()
307 short[] _isMatch = new short[Base.kNumStates<<Base.kNumPosStatesBitsMax];
308 short[] _isRep = new short[Base.kNumStates];
309 short[] _isRepG0 = new short[Base.kNumStates];
310 short[] _isRepG1 = new short[Base.kNumStates];
311 short[] _isRepG2 = new short[Base.kNumStates];
312 short[] _isRep0Long = new short[Base.kNumStates<<Base.kNumPosStatesBitsMax];
314 BitTreeEncoder[] _posSlotEncoder = new BitTreeEncoder[Base.kNumLenToPosStates]; // kNumPosSlotBits
316 short[] _posEncoders = new short[Base.kNumFullDistances-Base.kEndPosModelIndex];
317 BitTreeEncoder _posAlignEncoder = new BitTreeEncoder(Base.kNumAlignBits);
324 int[] _matchDistances = new int[Base.kMatchMaxLen*2+2];
337 int[] _posSlotPrices = new int[1<<(Base.kNumPosSlotBits+Base.kNumLenToPosStatesBits)];
338 int[] _distancesPrices = new int[Base.kNumFullDistances<<Base.kNumLenToPosStatesBits];
339 int[] _alignPrices = new int[Base.kAlignTableSize];
377 _matchFinder.Create(_dictionarySize, kNumOpts, _numFastBytes, Base.kMatchMaxLen + 1); in Create()
386 for (int i = 0; i < Base.kNumLenToPosStates; i++) in Encoder()
387 _posSlotEncoder[i] = new BitTreeEncoder(Base.kNumPosSlotBits); in Encoder()
415 for (int i = 0; i < Base.kNumLenToPosStates; i++) in Init()
440 Base.kMatchMaxLen - lenRes); in ReadMatchDistances()
458 …SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRep0Long[(state << Base.kNumPosStatesBitsMax)… in GetRepLen1Price()
467 …price += SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep0Long[(state << Base.kNumPosState… in GetPureRepPrice()
485 int price = _repMatchLenEncoder.GetPrice(len - Base.kMatchMinLen, posState); in GetRepPrice()
492 int lenToPosState = Base.GetLenToPosState(len); in GetPosLenPrice()
493 if (pos < Base.kNumFullDistances) in GetPosLenPrice()
494 price = _distancesPrices[(lenToPosState * Base.kNumFullDistances) + pos]; in GetPosLenPrice()
496 price = _posSlotPrices[(lenToPosState << Base.kNumPosSlotBits) + GetPosSlot2(pos)] + in GetPosLenPrice()
497 _alignPrices[pos & Base.kAlignMask]; in GetPosLenPrice()
498 return price + _lenEncoder.GetPrice(len - Base.kMatchMinLen, posState); in GetPosLenPrice()
535 int[] reps = new int[Base.kNumRepDistances];
536 int[] repLens = new int[Base.kNumRepDistances];
568 if (numAvailableBytes > Base.kMatchMaxLen) in GetOptimum()
569 numAvailableBytes = Base.kMatchMaxLen; in GetOptimum()
573 for (i = 0; i < Base.kNumRepDistances; i++) in GetOptimum()
576 repLens[i] = _matchFinder.GetMatchLen(0 - 1, reps[i], Base.kMatchMaxLen); in GetOptimum()
590 backRes = _matchDistances[numDistancePairs - 1] + Base.kNumRepDistances; in GetOptimum()
608 …_optimum[1].Price = SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(_state << Base.kNu… in GetOptimum()
609 …_literalEncoder.GetSubCoder(position, _previousByte).GetPrice(!Base.StateIsCharState(_state), matc… in GetOptimum()
612 …int matchPrice = SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(_state << Base.kNumPo… in GetOptimum()
645 for (i = 0; i < Base.kNumRepDistances; i++) in GetOptimum()
683 optimum.BackPrev = distance + Base.kNumRepDistances; in GetOptimum()
720 if (_optimum[cur].BackPrev2 < Base.kNumRepDistances) in GetOptimum()
721 state = Base.StateUpdateRep(state); in GetOptimum()
723 state = Base.StateUpdateMatch(state); in GetOptimum()
727 state = Base.StateUpdateChar(state); in GetOptimum()
734 state = Base.StateUpdateShortRep(state); in GetOptimum()
736 state = Base.StateUpdateChar(state); in GetOptimum()
745 state = Base.StateUpdateRep(state); in GetOptimum()
750 if (pos < Base.kNumRepDistances) in GetOptimum()
751 state = Base.StateUpdateRep(state); in GetOptimum()
753 state = Base.StateUpdateMatch(state); in GetOptimum()
756 if (pos < Base.kNumRepDistances) in GetOptimum()
789 reps[0] = (pos - Base.kNumRepDistances); in GetOptimum()
808 …SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(state << Base.kNumPosStatesBitsMax) + … in GetOptimum()
810 GetPrice(!Base.StateIsCharState(state), matchByte, currentByte); in GetOptimum()
823 …ce + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state << Base.kNumPosStatesBitsMa… in GetOptimum()
854 int state2 = Base.StateUpdateChar(state); in GetOptimum()
858 …SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state2 << Base.kNumPosStatesBitsMax) +… in GetOptimum()
881 for (int repIndex = 0; repIndex < Base.kNumRepDistances; repIndex++) in GetOptimum()
914 int state2 = Base.StateUpdateRep(state); in GetOptimum()
919 …SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(state2 << Base.kNumPosStatesBitsMax) +… in GetOptimum()
924 state2 = Base.StateUpdateChar(state2); in GetOptimum()
926 …e + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state2 << Base.kNumPosStatesBitsMa… in GetOptimum()
977 optimum.BackPrev = curBack + Base.kNumRepDistances; in GetOptimum()
989 int state2 = Base.StateUpdateMatch(state); in GetOptimum()
993 …SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(state2 << Base.kNumPosStatesBitsMax) +… in GetOptimum()
999 state2 = Base.StateUpdateChar(state2); in GetOptimum()
1001 …e + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state2 << Base.kNumPosStatesBitsMa… in GetOptimum()
1017 optimum.BackPrev2 = curBack + Base.kNumRepDistances; in GetOptimum()
1041 _rangeEncoder.Encode(_isMatch, (_state << Base.kNumPosStatesBitsMax) + posState, 1); in WriteEndMarker()
1043 _state = Base.StateUpdateMatch(_state); in WriteEndMarker()
1044 int len = Base.kMatchMinLen; in WriteEndMarker()
1045 _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState); in WriteEndMarker()
1046 int posSlot = (1 << Base.kNumPosSlotBits) - 1; in WriteEndMarker()
1047 int lenToPosState = Base.GetLenToPosState(len); in WriteEndMarker()
1051 _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits); in WriteEndMarker()
1052 _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask); in WriteEndMarker()
1093 _rangeEncoder.Encode(_isMatch, (_state << Base.kNumPosStatesBitsMax) + posState, 0); in CodeOneBlock()
1094 _state = Base.StateUpdateChar(_state); in CodeOneBlock()
1112 int complexState = (_state << Base.kNumPosStatesBitsMax) + posState; in CodeOneBlock()
1118 if (!Base.StateIsCharState(_state)) in CodeOneBlock()
1126 _state = Base.StateUpdateChar(_state); in CodeOneBlock()
1131 if (pos < Base.kNumRepDistances) in CodeOneBlock()
1154 _state = Base.StateUpdateShortRep(_state); in CodeOneBlock()
1157 _repMatchLenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState); in CodeOneBlock()
1158 _state = Base.StateUpdateRep(_state); in CodeOneBlock()
1171 _state = Base.StateUpdateMatch(_state); in CodeOneBlock()
1172 _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState); in CodeOneBlock()
1173 pos -= Base.kNumRepDistances; in CodeOneBlock()
1175 int lenToPosState = Base.GetLenToPosState(len); in CodeOneBlock()
1178 if (posSlot >= Base.kStartPosModelIndex) in CodeOneBlock()
1184 if (posSlot < Base.kEndPosModelIndex) in CodeOneBlock()
1189 … _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits); in CodeOneBlock()
1190 _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask); in CodeOneBlock()
1195 for (int i = Base.kNumRepDistances - 1; i >= 1; i--) in CodeOneBlock()
1209 if (_alignPriceCount >= Base.kAlignTableSize) in CodeOneBlock()
1264 _lenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen); in SetStreams()
1266 _repMatchLenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen); in SetStreams()
1311 int[] tempPrices = new int[Base.kNumFullDistances];
1316 for (int i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++) in FillDistancesPrices()
1325 for (int lenToPosState = 0; lenToPosState < Base.kNumLenToPosStates; lenToPosState++) in FillDistancesPrices()
1330 int st = (lenToPosState << Base.kNumPosSlotBits); in FillDistancesPrices()
1333 for (posSlot = Base.kEndPosModelIndex; posSlot < _distTableSize; posSlot++) in FillDistancesPrices()
1334 …_posSlotPrices[st + posSlot] += ((((posSlot >> 1) - 1) - Base.kNumAlignBits) << SevenZip.Compressi… in FillDistancesPrices()
1336 int st2 = lenToPosState * Base.kNumFullDistances; in FillDistancesPrices()
1338 for (i = 0; i < Base.kStartPosModelIndex; i++) in FillDistancesPrices()
1340 for (; i < Base.kNumFullDistances; i++) in FillDistancesPrices()
1348 for (int i = 0; i < Base.kAlignTableSize; i++) in FillAlignPrices()
1366 if (dictionarySize < (1 << Base.kDicLogSizeMin) || dictionarySize > (1 << kDicLogSizeMaxCompress)) in SetDictionarySize()
1377 if (numFastBytes < 5 || numFastBytes > Base.kMatchMaxLen) in SetNumFastBytes()
1400 lp < 0 || lp > Base.kNumLitPosStatesBitsEncodingMax || in SetLcLpPb()
1401 lc < 0 || lc > Base.kNumLitContextBitsMax || in SetLcLpPb()
1402 pb < 0 || pb > Base.kNumPosStatesBitsEncodingMax) in SetLcLpPb()