Esempio n. 1
0
        public Vlc GetVlc <T>(VlcTable <T> vlcTable)
        {
            Vlc vlc = vlcTable.GetVlc(ShowBits(vlcTable.MaxBits));

            if (vlc != null)                    // Flush the bits
            {
                DataReader.GetBits(vlc.Length);
            }
            return(vlc);
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieves the value from <paramref name="vlcTable"/> corresponding
        /// to a VLC code from the underlying data stream.
        /// </summary>
        /// <param name="vlcTable">the VLC table</param>
        /// <returns>the value</returns>
        /// <remarks>returns default(T) for invalid bit patterns</remarks>
        public T GetVlc <T>(VlcTable <T> vlcTable)
        {
            Vlc vlc = vlcTable.GetVlc(ShowBits(vlcTable.MaxBits));

            if (vlc == null)
            {
                return(vlcTable.DefaultValue);
            }
            else
            {
                GetBits(vlc.Length);                    // Flush the bits
                return(vlcTable[vlc]);
            }
        }