Example #1
0
            public byte DecodeNormal(RangeCoder.RangeDecoder rangeDecoder)
            {
                uint symbol = 1;

                do
                {
                    symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
                }while (symbol < 0x100);
                return((byte)symbol);
            }
Example #2
0
            public byte DecodeWithMatchByte(RangeCoder.RangeDecoder 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);
            }
Example #3
0
 public byte DecodeWithMatchByte(RangeCoder.RangeDecoder rangeDecoder, uint pos, byte prevByte, byte matchByte)
 {
     return(m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte));
 }
Example #4
0
 public byte DecodeNormal(RangeCoder.RangeDecoder rangeDecoder, uint pos, byte prevByte)
 {
     return(m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder));
 }