Lines Matching refs:UInt32

17 		const UInt32 kIfinityPrice = 0xFFFFFFF;

29 UInt32 k = ((UInt32)1 << ((slotFast >> 1) - 1));
30 for (UInt32 j = 0; j < k; j++, c++)
35 static UInt32 GetPosSlot(UInt32 pos)
40 return (UInt32)(g_FastPos[pos >> 10] + 20);
41 return (UInt32)(g_FastPos[pos >> 20] + 40);
44 static UInt32 GetPosSlot2(UInt32 pos)
47 return (UInt32)(g_FastPos[pos >> 6] + 12);
49 return (UInt32)(g_FastPos[pos >> 16] + 32);
50 return (UInt32)(g_FastPos[pos >> 26] + 52);
55 UInt32[] _repDistances = new UInt32[Base.kNumRepDistances];
61 for (UInt32 i = 0; i < Base.kNumRepDistances; i++)
66 const UInt32 kNumFastBytesDefault = 0x20;
163 public Encoder2 GetSubCoder(UInt32 pos, Byte prevByte)
177 for (UInt32 posState = 0; posState < Base.kNumPosStatesEncodingMax; posState++)
184 public void Init(UInt32 numPosStates)
188 for (UInt32 posState = 0; posState < numPosStates; posState++)
196 public void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState)
220 public void SetPrices(UInt32 posState, UInt32 numSymbols, UInt32[] prices, UInt32 st)
222 UInt32 a0 = _choice.GetPrice0();
223 UInt32 a1 = _choice.GetPrice1();
224 UInt32 b0 = a1 + _choice2.GetPrice0();
225 UInt32 b1 = a1 + _choice2.GetPrice1();
226 UInt32 i = 0;
244 const UInt32 kNumLenSpecSymbols = Base.kNumLowLenSymbols + Base.kNumMidLenSymbols;
248 UInt32[] _prices = new UInt32[Base.kNumLenSymbols << Base.kNumPosStatesBitsEncodingMax];
249 UInt32 _tableSize;
250 UInt32[] _counters = new UInt32[Base.kNumPosStatesEncodingMax];
252 public void SetTableSize(UInt32 tableSize) { _tableSize = tableSize; }
254 public UInt32 GetPrice(UInt32 symbol, UInt32 posState)
259 void UpdateTable(UInt32 posState)
265 public void UpdateTables(UInt32 numPosStates)
267 for (UInt32 posState = 0; posState < numPosStates; posState++)
271 public new void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState)
279 const UInt32 kNumOpts = 1 << 12;
287 public UInt32 PosPrev2;
288 public UInt32 BackPrev2;
290 public UInt32 Price;
291 public UInt32 PosPrev;
292 public UInt32 BackPrev;
294 public UInt32 Backs0;
295 public UInt32 Backs1;
296 public UInt32 Backs2;
297 public UInt32 Backs3;
324 UInt32[] _matchDistances = new UInt32[Base.kMatchMaxLen * 2 + 2];
326 UInt32 _numFastBytes = kNumFastBytesDefault;
327 UInt32 _longestMatchLength;
328 UInt32 _numDistancePairs;
330 UInt32 _additionalOffset;
332 UInt32 _optimumEndIndex;
333 UInt32 _optimumCurrentIndex;
337 UInt32[] _posSlotPrices = new UInt32[1 << (Base.kNumPosSlotBits + Base.kNumLenToPosStatesBits)];
338 UInt32[] _distancesPrices = new UInt32[Base.kNumFullDistances << Base.kNumLenToPosStatesBits];
339 UInt32[] _alignPrices = new UInt32[Base.kAlignTableSize];
340 UInt32 _alignPriceCount;
342 UInt32 _distTableSize = (kDefaultDictionaryLogSize * 2);
345 UInt32 _posStateMask = (4 - 1);
349 UInt32 _dictionarySize = (1 << kDefaultDictionaryLogSize);
350 UInt32 _dictionarySizePrev = 0xFFFFFFFF;
351 UInt32 _numFastBytesPrev = 0xFFFFFFFF;
420 _lenEncoder.Init((UInt32)1 << _posStateBits);
421 _repMatchLenEncoder.Init((UInt32)1 << _posStateBits);
431 void ReadMatchDistances(out UInt32 lenRes, out UInt32 numDistancePairs)
446 void MovePos(UInt32 num)
455 UInt32 GetRepLen1Price(Base.State state, UInt32 posState)
461 UInt32 GetPureRepPrice(UInt32 repIndex, Base.State state, UInt32 posState)
463 UInt32 price;
483 UInt32 GetRepPrice(UInt32 repIndex, UInt32 len, Base.State state, UInt32 posState)
485 UInt32 price = _repMatchLenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
489 UInt32 GetPosLenPrice(UInt32 pos, UInt32 len, UInt32 posState)
491 UInt32 price;
492 UInt32 lenToPosState = Base.GetLenToPosState(len);
501 UInt32 Backward(out UInt32 backRes, UInt32 cur)
504 UInt32 posMem = _optimum[cur].PosPrev;
505 UInt32 backMem = _optimum[cur].BackPrev;
519 UInt32 posPrev = posMem;
520 UInt32 backCur = backMem;
535 UInt32[] reps = new UInt32[Base.kNumRepDistances];
536 UInt32[] repLens = new UInt32[Base.kNumRepDistances];
539 UInt32 GetOptimum(UInt32 position, out UInt32 backRes)
543 UInt32 lenRes = _optimum[_optimumCurrentIndex].PosPrev - _optimumCurrentIndex;
550 UInt32 lenMain, numDistancePairs;
562 UInt32 numAvailableBytes = _matchFinder.GetNumAvailableBytes() + 1;
571 UInt32 repMaxIndex = 0;
572 UInt32 i;
583 UInt32 lenRes = repLens[repMaxIndex];
600 backRes = (UInt32)0xFFFFFFFF;
606 UInt32 posState = (position & _posStateMask);
612 UInt32 matchPrice = _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1();
613 UInt32 repMatchPrice = matchPrice + _isRep[_state.Index].GetPrice1();
617 UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(_state, posState);
625 UInt32 lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]);
640 UInt32 len = lenEnd;
647 UInt32 repLen = repLens[i];
650 UInt32 price = repMatchPrice + GetPureRepPrice(i, _state, posState);
653 UInt32 curAndLenPrice = price + _repMatchLenEncoder.GetPrice(repLen - 2, posState);
666 UInt32 normalMatchPrice = matchPrice + _isRep[_state.Index].GetPrice0();
671 UInt32 offs = 0;
676 UInt32 distance = _matchDistances[offs + 1];
677 UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(distance, len, posState);
695 UInt32 cur = 0;
702 UInt32 newLen;
712 UInt32 posPrev = _optimum[cur].PosPrev;
740 UInt32 pos;
800 UInt32 curPrice = _optimum[cur].Price;
807 UInt32 curAnd1Price = curPrice +
829 UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(state, posState);
839 UInt32 numAvailableBytesFull = _matchFinder.GetNumAvailableBytes() + 1;
850 UInt32 t = Math.Min(numAvailableBytesFull - 1, _numFastBytes);
851 UInt32 lenTest2 = _matchFinder.GetMatchLen(0, reps[0], t);
856 UInt32 posStateNext = (position + 1) & _posStateMask;
857 UInt32 nextRepMatchPrice = curAnd1Price +
861 UInt32 offset = cur + 1 + lenTest2;
864 UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(
879 UInt32 startLen = 2; // speed optimization
881 for (UInt32 repIndex = 0; repIndex < Base.kNumRepDistances; repIndex++)
883 UInt32 lenTest = _matchFinder.GetMatchLen(0 - 1, reps[repIndex], numAvailableBytes);
886 UInt32 lenTestTemp = lenTest;
891 UInt32 curAndLenPrice = repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState);
910 UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
911 UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, reps[repIndex], t);
916 UInt32 posStateNext = (position + lenTest) & _posStateMask;
917 UInt32 curAndLenCharPrice =
926 UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1();
927 UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1();
931 UInt32 offset = lenTest + 1 + lenTest2;
934 UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
964 UInt32 offs = 0;
968 for (UInt32 lenTest = startLen; ; lenTest++)
970 UInt32 curBack = _matchDistances[offs + 1];
971 UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(curBack, lenTest, posState);
985 UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
986 UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, curBack, t);
991 UInt32 posStateNext = (position + lenTest) & _posStateMask;
992 UInt32 curAndLenCharPrice = curAndLenPrice +
1001 UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1();
1002 UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1();
1004 UInt32 offset = lenTest + 1 + lenTest2;
1030 bool ChangePair(UInt32 smallDist, UInt32 bigDist)
1033 return (smallDist < ((UInt32)(1) << (32 - kDif)) && bigDist >= (smallDist << kDif));
1036 void WriteEndMarker(UInt32 posState)
1044 UInt32 len = Base.kMatchMinLen;
1046 UInt32 posSlot = (1 << Base.kNumPosSlotBits) - 1;
1047 UInt32 lenToPosState = Base.GetLenToPosState(len);
1050 UInt32 posReduced = (((UInt32)1) << footerBits) - 1;
1055 void Flush(UInt32 nowPos)
1089 Flush((UInt32)nowPos64);
1092 UInt32 len, numDistancePairs; // it's not used
1094 UInt32 posState = (UInt32)(nowPos64) & _posStateMask;
1098 _literalEncoder.GetSubCoder((UInt32)(nowPos64), _previousByte).Encode(_rangeEncoder, curByte);
1105 Flush((UInt32)nowPos64);
1110 UInt32 pos;
1111 UInt32 len = GetOptimum((UInt32)nowPos64, out pos);
1113 UInt32 posState = ((UInt32)nowPos64) & _posStateMask;
1114 UInt32 complexState = (_state.Index << Base.kNumPosStatesBitsMax) + posState;
1119 LiteralEncoder.Encoder2 subCoder = _literalEncoder.GetSubCoder((UInt32)nowPos64, _previousByte);
1162 UInt32 distance = _repDistances[pos];
1165 for (UInt32 i = pos; i >= 1; i--)
1176 UInt32 posSlot = GetPosSlot(pos);
1177 UInt32 lenToPosState = Base.GetLenToPosState(len);
1183 UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits);
1184 UInt32 posReduced = pos - baseVal;
1196 UInt32 distance = pos;
1197 for (UInt32 i = Base.kNumRepDistances - 1; i >= 1; i--)
1217 Flush((UInt32)nowPos64);
1265 _lenEncoder.UpdateTables((UInt32)1 << _posStateBits);
1267 _repMatchLenEncoder.UpdateTables((UInt32)1 << _posStateBits);
1311 UInt32[] tempPrices = new UInt32[Base.kNumFullDistances];
1312 UInt32 _matchPriceCount;
1316 for (UInt32 i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++)
1318 UInt32 posSlot = GetPosSlot(i);
1320 UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits);
1325 for (UInt32 lenToPosState = 0; lenToPosState < Base.kNumLenToPosStates; lenToPosState++)
1327 UInt32 posSlot;
1330 UInt32 st = (lenToPosState << Base.kNumPosSlotBits);
1336 UInt32 st2 = lenToPosState * Base.kNumFullDistances;
1337 UInt32 i;
1348 for (UInt32 i = 0; i < Base.kAlignTableSize; i++)
1370 for (UInt32 i = 0; i < properties.Length; i++)
1382 _numFastBytes = (UInt32)numFastBytes;
1418 if (dictionarySize < (UInt32)(1 << Base.kDicLogSizeMin) ||
1419 dictionarySize > (UInt32)(1 << kDicLogSizeMaxCompress))
1421 _dictionarySize = (UInt32)dictionarySize;
1423 for (dicLogSize = 0; dicLogSize < (UInt32)kDicLogSizeMaxCompress; dicLogSize++)
1424 if (dictionarySize <= ((UInt32)(1) << dicLogSize))
1426 _distTableSize = (UInt32)dicLogSize * 2;
1434 if (v < 0 || v > (UInt32)Base.kNumPosStatesBitsEncodingMax)
1437 _posStateMask = (((UInt32)1) << (int)_posStateBits) - 1;
1445 if (v < 0 || v > (UInt32)Base.kNumLitPosStatesBitsEncodingMax)
1455 if (v < 0 || v > (UInt32)Base.kNumLitContextBitsMax)