Beispiel #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);
        }
Beispiel #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]);
            }
        }
Beispiel #3
0
 public T GetVlcResult <T>(VlcTable <T> vlcTable)
 {
     return(DataReader.GetVlc(vlcTable));
 }