コード例 #1
0
                public byte DecodeNormal(Powerasp.Enterprise.Core.Compress.SevenZip.Compress.RangeCoder.Decoder rangeDecoder)
                {
                    uint symbol = 1;

                    do
                    {
                        symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
                    }while (symbol < 0x100);
                    return((byte)symbol);
                }
コード例 #2
0
                public byte DecodeWithMatchByte(Powerasp.Enterprise.Core.Compress.SevenZip.Compress.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);
                }
コード例 #3
0
 public uint Decode(Powerasp.Enterprise.Core.Compress.SevenZip.Compress.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);
     }
 }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
 public byte DecodeWithMatchByte(Powerasp.Enterprise.Core.Compress.SevenZip.Compress.RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte, byte matchByte)
 {
     return(m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte));
 }
コード例 #6
0
 public byte DecodeNormal(Powerasp.Enterprise.Core.Compress.SevenZip.Compress.RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte)
 {
     return(m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder));
 }
コード例 #7
0
 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;
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 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);
 }