Example #1
0
                public byte DecodeNormal(RangeDecoder rangeRangeDecoder)
                {
                    uint symbol = 1;

                    do
                    {
                        symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeRangeDecoder);
                    }while (symbol < 0x100);
                    return((byte)symbol);
                }
Example #2
0
            public uint Decode(RangeDecoder rangeRangeDecoder, uint posState)
            {
                if (m_Choice.Decode(rangeRangeDecoder) == 0)
                {
                    return(m_LowCoder[posState].Decode(rangeRangeDecoder));
                }
                var symbol = Base.kNumLowLenSymbols;

                if (m_Choice2.Decode(rangeRangeDecoder) == 0)
                {
                    symbol += m_MidCoder[posState].Decode(rangeRangeDecoder);
                }
                else
                {
                    symbol += Base.kNumMidLenSymbols;
                    symbol += m_HighCoder.Decode(rangeRangeDecoder);
                }
                return(symbol);
            }
Example #3
0
                public byte DecodeWithMatchByte(RangeDecoder rangeRangeDecoder, byte matchByte)
                {
                    uint symbol = 1;

                    do
                    {
                        var matchBit = (uint)(matchByte >> 7) & 1;
                        matchByte <<= 1;
                        var bit = m_Decoders[((1 + matchBit) << 8) + symbol].Decode(rangeRangeDecoder);
                        symbol = (symbol << 1) | bit;
                        if (matchBit != bit)
                        {
                            while (symbol < 0x100)
                            {
                                symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeRangeDecoder);
                            }
                            break;
                        }
                    }while (symbol < 0x100);
                    return((byte)symbol);
                }
Example #4
0
 public byte DecodeWithMatchByte(RangeDecoder rangeRangeDecoder, uint pos, byte prevByte, byte matchByte)
 {
     return(m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeRangeDecoder, matchByte));
 }
Example #5
0
 public byte DecodeNormal(RangeDecoder rangeRangeDecoder, uint pos, byte prevByte)
 {
     return(m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeRangeDecoder));
 }