public void ReverseEncode(Encoder rangeEncoder, UInt32 symbol) { UInt32 m = 1; for (UInt32 i = 0; i < NumBitLevels; i++) { UInt32 bit = symbol & 1; Models[m].Encode(rangeEncoder, bit); m = (m << 1) | bit; symbol >>= 1; } }
public void ReverseEncode(Encoder rangeEncoder, uint symbol) { uint index = 1; for (uint i = 0; i < this.NumBitLevels; i++) { uint num3 = symbol & 1; this.Models[index].Encode(rangeEncoder, num3); index = (index << 1) | num3; symbol = symbol >> 1; } }
public static void ReverseEncode(BitEncoder[] Models, uint startIndex, Encoder rangeEncoder, int NumBitLevels, uint symbol) { uint num = 1; for (int i = 0; i < NumBitLevels; i++) { uint num3 = symbol & 1; Models[startIndex + num].Encode(rangeEncoder, num3); num = (num << 1) | num3; symbol = symbol >> 1; } }
public void Encode(Encoder rangeEncoder, UInt32 symbol) { UInt32 m = 1; for (int bitIndex = NumBitLevels; bitIndex > 0; ) { bitIndex--; UInt32 bit = (symbol >> bitIndex) & 1; Models[m].Encode(rangeEncoder, bit); m = (m << 1) | bit; } }
public void Encode(Encoder rangeEncoder, uint symbol) { uint index = 1; int numBitLevels = this.NumBitLevels; while (numBitLevels > 0) { numBitLevels--; uint num3 = (symbol >> numBitLevels) & 1; this.Models[index].Encode(rangeEncoder, num3); index = (index << 1) | num3; } }
public void Encode(Encoder encoder, uint symbol) { uint num = (encoder.Range >> 11) * this.Prob; if (symbol == 0) { encoder.Range = num; this.Prob += (uint) ((0x800 - this.Prob) >> 5); } else { encoder.Low += num; encoder.Range -= num; this.Prob -= this.Prob >> 5; } if (encoder.Range < 0x1000000) { encoder.Range = encoder.Range << 8; encoder.ShiftLow(); } }
public void Encode(Encoder encoder, uint symbol) { // encoder.EncodeBit(Prob, kNumBitModelTotalBits, symbol); // UpdateModel(symbol); uint newBound = (encoder.Range >> kNumBitModelTotalBits) * Prob; if (symbol == 0) { encoder.Range = newBound; Prob += (kBitModelTotal - Prob) >> kNumMoveBits; } else { encoder.Low += newBound; encoder.Range -= newBound; Prob -= (Prob) >> kNumMoveBits; } if (encoder.Range < Encoder.kTopValue) { encoder.Range <<= 8; encoder.ShiftLow(); } }
public static void ReverseEncode(BitEncoder[] Models, UInt32 startIndex, Encoder rangeEncoder, int NumBitLevels, UInt32 symbol) { UInt32 m = 1; for (int i = 0; i < NumBitLevels; i++) { UInt32 bit = symbol & 1; Models[startIndex + m].Encode(rangeEncoder, bit); m = (m << 1) | bit; symbol >>= 1; } }
public Encoder() { int num; this._state = new Base.State(); this._repDistances = new uint[4]; this._optimum = new Optimal[0x1000]; this._matchFinder = null; this._rangeEncoder = new SharpCompress.Compressor.LZMA.RangeCoder.Encoder(); this._isMatch = new BitEncoder[0xc0]; this._isRep = new BitEncoder[12]; this._isRepG0 = new BitEncoder[12]; this._isRepG1 = new BitEncoder[12]; this._isRepG2 = new BitEncoder[12]; this._isRep0Long = new BitEncoder[0xc0]; this._posSlotEncoder = new BitTreeEncoder[4]; this._posEncoders = new BitEncoder[0x72]; this._posAlignEncoder = new BitTreeEncoder(4); this._lenEncoder = new LenPriceTableEncoder(); this._repMatchLenEncoder = new LenPriceTableEncoder(); this._literalEncoder = new LiteralEncoder(); this._matchDistances = new uint[0x224]; this._numFastBytes = 0x20; this._posSlotPrices = new uint[0x100]; this._distancesPrices = new uint[0x200]; this._alignPrices = new uint[0x10]; this._distTableSize = 0x2c; this._posStateBits = 2; this._posStateMask = 3; this._numLiteralPosStateBits = 0; this._numLiteralContextBits = 3; this._dictionarySize = 0x400000; this._dictionarySizePrev = uint.MaxValue; this._numFastBytesPrev = uint.MaxValue; this._matchFinderType = EMatchFinderType.BT4; this._writeEndMark = false; this.reps = new uint[4]; this.repLens = new uint[4]; this.properties = new byte[5]; this.tempPrices = new uint[0x80]; this._trainSize = 0; for (num = 0; num < 0x1000L; num++) { this._optimum[num] = new Optimal(); } for (num = 0; num < 4L; num++) { this._posSlotEncoder[num] = new BitTreeEncoder(6); } }