Example #1
0
        private void Create()
        {
            if (_matchFinder == null)
            {
                LZ.BinTree bt = new LZ.BinTree();
                int numHashBytes = 4;
                if (_matchFinderType == EMatchFinderType.BT2)
                    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 + kNumOpts);
            _dictionarySizePrev = _dictionarySize;
            _numFastBytesPrev = _numFastBytes;
        }
Example #2
0
 private void Create()
 {
     if (this._matchFinder == null)
     {
         BinTree tree = new BinTree();
         int numHashBytes = 4;
         if (this._matchFinderType == EMatchFinderType.BT2)
         {
             numHashBytes = 2;
         }
         tree.SetType(numHashBytes);
         this._matchFinder = tree;
     }
     this._literalEncoder.Create(this._numLiteralPosStateBits, this._numLiteralContextBits);
     if ((this._dictionarySize != this._dictionarySizePrev) || (this._numFastBytesPrev != this._numFastBytes))
     {
         this._matchFinder.Create(this._dictionarySize, 0x1000, this._numFastBytes, 0x1112);
         this._dictionarySizePrev = this._dictionarySize;
         this._numFastBytesPrev = this._numFastBytes;
     }
 }