Beispiel #1
0
            public uint Decode(Lzma.Decoder rangeDecoder)
            {
                uint num = (rangeDecoder.Range >> 11) * this.Prob;

                if (rangeDecoder.Code < num)
                {
                    rangeDecoder.Range = num;
                    this.Prob         += (uint)((0x800 - this.Prob) >> 5);
                    if (rangeDecoder.Range < 0x1000000)
                    {
                        rangeDecoder.Code  = (rangeDecoder.Code << 8) | ((byte)rangeDecoder.Stream.ReadByte());
                        rangeDecoder.Range = rangeDecoder.Range << 8;
                    }
                    return(0);
                }
                rangeDecoder.Range -= num;
                rangeDecoder.Code  -= num;
                this.Prob          -= this.Prob >> 5;
                if (rangeDecoder.Range < 0x1000000)
                {
                    rangeDecoder.Code  = (rangeDecoder.Code << 8) | ((byte)rangeDecoder.Stream.ReadByte());
                    rangeDecoder.Range = rangeDecoder.Range << 8;
                }
                return(1);
            }
Beispiel #2
0
            public uint Decode(Lzma.Decoder rangeDecoder)
            {
                uint index = 1;

                for (int i = this.NumBitLevels; i > 0; i--)
                {
                    index = (index << 1) + this.Models[index].Decode(rangeDecoder);
                }
                return(index - (((uint)1) << this.NumBitLevels));
            }
Beispiel #3
0
                    public byte DecodeNormal(Lzma.Decoder rangeDecoder)
                    {
                        uint index = 1;

                        do
                        {
                            index = (index << 1) | this.m_Decoders[index].Decode(rangeDecoder);
                        }while (index < 0x100);
                        return((byte)index);
                    }
Beispiel #4
0
            public uint ReverseDecode(Lzma.Decoder rangeDecoder)
            {
                uint index = 1;
                uint num2  = 0;

                for (int i = 0; i < this.NumBitLevels; i++)
                {
                    uint num4 = this.Models[index].Decode(rangeDecoder);
                    index  = index << 1;
                    index += num4;
                    num2  |= num4 << i;
                }
                return(num2);
            }
Beispiel #5
0
                public uint Decode(Lzma.Decoder rangeDecoder, uint posState)
                {
                    if (this.m_Choice.Decode(rangeDecoder) == 0)
                    {
                        return(this.m_LowCoder[posState].Decode(rangeDecoder));
                    }
                    uint num = 8;

                    if (this.m_Choice2.Decode(rangeDecoder) == 0)
                    {
                        num += this.m_MidCoder[posState].Decode(rangeDecoder);
                    }
                    else
                    {
                        num += 8;
                        num += this.m_HighCoder.Decode(rangeDecoder);
                    }
                    return(num);
                }
Beispiel #6
0
                    public byte DecodeWithMatchByte(Lzma.Decoder rangeDecoder, byte matchByte)
                    {
                        uint index = 1;

                        do
                        {
                            uint num2 = (uint)((matchByte >> 7) & 1);
                            matchByte = (byte)(matchByte << 1);
                            uint num3 = this.m_Decoders[(int)((IntPtr)(((1 + num2) << 8) + index))].Decode(rangeDecoder);
                            index = (index << 1) | num3;
                            if (num2 != num3)
                            {
                                while (index < 0x100)
                                {
                                    index = (index << 1) | this.m_Decoders[index].Decode(rangeDecoder);
                                }
                                break;
                            }
                        }while (index < 0x100);
                        return((byte)index);
                    }
Beispiel #7
0
 public byte DecodeWithMatchByte(Lzma.Decoder rangeDecoder, uint pos, byte prevByte, byte matchByte)
 {
     return(this.m_Coders[this.GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte));
 }
Beispiel #8
0
 public byte DecodeNormal(Lzma.Decoder rangeDecoder, uint pos, byte prevByte)
 {
     return(this.m_Coders[this.GetState(pos, prevByte)].DecodeNormal(rangeDecoder));
 }
Beispiel #9
0
            public static uint ReverseDecode(Lzma.BitDecoder[] Models, uint startIndex, Lzma.Decoder rangeDecoder, int NumBitLevels)
            {
                uint num  = 1;
                uint num2 = 0;

                for (int i = 0; i < NumBitLevels; i++)
                {
                    uint num4 = Models[startIndex + num].Decode(rangeDecoder);
                    num   = num << 1;
                    num  += num4;
                    num2 |= num4 << i;
                }
                return(num2);
            }