Beispiel #1
0
                public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, byte matchByte)
                {
                    uint num = 1u;

                    while (true)
                    {
                        uint num2 = (uint)(matchByte >> 7 & 1);
                        matchByte = (byte)(matchByte << 1);
                        uint num3 = this.m_Decoders[(int)((UIntPtr)((1u + num2 << 8) + num))].Decode(rangeDecoder);
                        num = (num << 1 | num3);
                        if (num2 != num3)
                        {
                            break;
                        }
                        if (num >= 256u)
                        {
                            goto IL_6D;
                        }
                    }
                    while (num < 256u)
                    {
                        num = (num << 1 | this.m_Decoders[(int)((UIntPtr)num)].Decode(rangeDecoder));
                    }
IL_6D:
                    return((byte)num);
                }
Beispiel #2
0
 public byte DecodeWithMatchByte(
     SevenZip.Compression.RangeCoder.Decoder rangeDecoder,
     uint pos,
     byte prevByte,
     byte matchByte)
 {
     return(this.m_Coders[(int)this.GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte));
 }
                public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder)
                {
                    uint symbol = 1;

                    do
                    {
                        symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
                    }while (symbol < 0x100);
                    return((byte)symbol);
                }
Beispiel #4
0
                public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder)
                {
                    uint num = 1;

                    do
                    {
                        num = num << 1 | this.m_Decoders[(int)num].Decode(rangeDecoder);
                    }while (num < 256U);
                    return((byte)num);
                }
Beispiel #5
0
            public uint Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint posState)
            {
                if (this.m_Choice.Decode(rangeDecoder) == 0U)
                {
                    return(this.m_LowCoder[(int)posState].Decode(rangeDecoder));
                }
                uint num = 8;

                return(this.m_Choice2.Decode(rangeDecoder) != 0U ? num + 8U + this.m_HighCoder.Decode(rangeDecoder) : num + this.m_MidCoder[(int)posState].Decode(rangeDecoder));
            }
Beispiel #6
0
                public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder)
                {
                    uint num = 1u;

                    do
                    {
                        num = (num << 1 | this.m_Decoders[(int)((UIntPtr)num)].Decode(rangeDecoder));
                    }while (num < 256u);
                    return((byte)num);
                }
Beispiel #7
0
                public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder)
                {
                    uint num = 1u;

                    do
                    {
                        num = ((num << 1) | m_Decoders[num].Decode(rangeDecoder));
                    } while (num < 256);

                    return((byte)num);
                }
Beispiel #8
0
            public uint Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint posState)
            {
                if (m_Choice.Decode(rangeDecoder) == 0)
                {
                    return(m_LowCoder[posState].Decode(rangeDecoder));
                }

                uint num = 8u;

                if (m_Choice2.Decode(rangeDecoder) == 0)
                {
                    return(num + m_MidCoder[posState].Decode(rangeDecoder));
                }

                num += 8;
                return(num + m_HighCoder.Decode(rangeDecoder));
            }
Beispiel #9
0
            public uint Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint posState)
            {
                if (this.m_Choice.Decode(rangeDecoder) == 0u)
                {
                    return(this.m_LowCoder[(int)((UIntPtr)posState)].Decode(rangeDecoder));
                }
                uint num = 8u;

                if (this.m_Choice2.Decode(rangeDecoder) == 0u)
                {
                    num += this.m_MidCoder[(int)((UIntPtr)posState)].Decode(rangeDecoder);
                }
                else
                {
                    num += 8u;
                    num += this.m_HighCoder.Decode(rangeDecoder);
                }
                return(num);
            }
                public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, byte matchByte)
                {
                    uint symbol = 1;

                    do
                    {
                        uint matchBit = (uint)(matchByte >> 7) & 1;
                        matchByte <<= 1;
                        uint bit = m_Decoders[((1 + matchBit) << 8) + symbol].Decode(rangeDecoder);
                        symbol = (symbol << 1) | bit;
                        if (matchBit != bit)
                        {
                            while (symbol < 0x100)
                            {
                                symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
                            }
                            break;
                        }
                    }while (symbol < 0x100);
                    return((byte)symbol);
                }
Beispiel #11
0
                public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, byte matchByte)
                {
                    uint num1 = 1;

                    do
                    {
                        uint num2 = (uint)((int)matchByte >> 7 & 1);
                        matchByte <<= 1;
                        uint num3 = this.m_Decoders[(1 + (int)num2 << 8) + (int)num1].Decode(rangeDecoder);
                        num1 = num1 << 1 | num3;
                        if ((int)num2 != (int)num3)
                        {
                            while (num1 < 256U)
                            {
                                num1 = num1 << 1 | this.m_Decoders[(int)num1].Decode(rangeDecoder);
                            }
                            break;
                        }
                    }while (num1 < 256U);
                    return((byte)num1);
                }
 public uint Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint posState)
 {
     if (m_Choice.Decode(rangeDecoder) == 0)
     {
         return(m_LowCoder[posState].Decode(rangeDecoder));
     }
     else
     {
         uint symbol = Base.kNumLowLenSymbols;
         if (m_Choice2.Decode(rangeDecoder) == 0)
         {
             symbol += m_MidCoder[posState].Decode(rangeDecoder);
         }
         else
         {
             symbol += Base.kNumMidLenSymbols;
             symbol += m_HighCoder.Decode(rangeDecoder);
         }
         return(symbol);
     }
 }
Beispiel #13
0
                public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, byte matchByte)
                {
                    uint num = 1u;

                    do
                    {
                        uint num2 = (uint)((matchByte >> 7) & 1);
                        matchByte = (byte)(matchByte << 1);
                        uint num3 = m_Decoders[(1 + num2 << 8) + num].Decode(rangeDecoder);
                        num = ((num << 1) | num3);
                        if (num2 != num3)
                        {
                            while (num < 256)
                            {
                                num = ((num << 1) | m_Decoders[num].Decode(rangeDecoder));
                            }

                            break;
                        }
                    } while (num < 256);

                    return((byte)num);
                }
Beispiel #14
0
 public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte)
 {
     return(m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder));
 }
		public uint ReverseDecode(Decoder rangeDecoder) {
			uint m = 1;
			uint symbol = 0;
			for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++) {
				uint bit = Models[m].Decode(rangeDecoder);
				m <<= 1;
				m += bit;
				symbol |= (bit << bitIndex);
			}
			return symbol;
		}
		public uint Decode(Decoder rangeDecoder) {
			uint m = 1;
			for (int bitIndex = NumBitLevels; bitIndex > 0; bitIndex--)
				m = (m << 1) + Models[m].Decode(rangeDecoder);
			return m - ((uint)1 << NumBitLevels);
		}
 public uint Decode(Decoder rangeDecoder)
 {
     uint newBound = (uint)(rangeDecoder.Range >> kNumBitModelTotalBits) * (uint)Prob;
     if (rangeDecoder.Code < newBound)
     {
         rangeDecoder.Range = newBound;
         Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
         if (rangeDecoder.Range < Decoder.kTopValue)
         {
             rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
             rangeDecoder.Range <<= 8;
         }
         return 0;
     }
     else
     {
         rangeDecoder.Range -= newBound;
         rangeDecoder.Code -= newBound;
         Prob -= (Prob) >> kNumMoveBits;
         if (rangeDecoder.Range < Decoder.kTopValue)
         {
             rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
             rangeDecoder.Range <<= 8;
         }
         return 1;
     }
 }
		public static uint ReverseDecode(BitDecoder[] Models, UInt32 startIndex,
		                                 Decoder rangeDecoder, int NumBitLevels) {
			uint m = 1;
			uint symbol = 0;
			for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++) {
				uint bit = Models[startIndex + m].Decode(rangeDecoder);
				m <<= 1;
				m += bit;
				symbol |= (bit << bitIndex);
			}
			return symbol;
		}
Beispiel #19
0
 public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte)
 {
     return(this.m_Coders[(int)((UIntPtr)this.GetState(pos, prevByte))].DecodeNormal(rangeDecoder));
 }