org.diracvideo.Jirac.Arithmetic.DecodeBit C# (CSharp) Method

DecodeBit() public method

public DecodeBit ( int context ) : int
context int
return int
        public int DecodeBit(int context)
        {
            return (DecodeBool(context) ? 1 : 0);
        }

Usage Example

Esempio n. 1
0
 private void TestArithmetic(Arithmetic a)
 {
     byte[] d = new byte[a.BytesLeft()];
     for(int i = 0; i < d.Length; i++) {
         byte c = 0;
         for(int j = 0; j < 8; j++) {
         c = (byte)((c << 1) | a.DecodeBit(j));
         }
         d[i] = c;
     }
     String s = System.Text.Encoding.Default.GetString(d);
     Console.WriteLine(s);
 }