Exemplo n.º 1
0
 internal override void Encode(BitWriter writer)
 {
     if (N == 0 && L == 0)
     {
         writer.WriteBits(0, 1);
         writer.WriteBits(0, 2);
         R.Encode(writer);
     }
     else if (N == 0 && R == 0)
     {
         writer.WriteBits(0, 1);
         writer.WriteBits(1, 2);
         L.Encode(writer);
     }
     else if (N == 0)
     {
         writer.WriteBits(0, 1);
         writer.WriteBits(2, 2);
         L.Encode(writer);
         R.Encode(writer);
     }
     else if (L == 0)
     {
         writer.WriteBits(0, 1);
         writer.WriteBits(3, 2);
         writer.WriteBits(0, 1);
         writer.WriteBits(0, 1);
         writer.EncodeN(N);
         R.Encode(writer);
     }
     else if (R == 0)
     {
         writer.WriteBits(0, 1);
         writer.WriteBits(3, 2);
         writer.WriteBits(0, 1);
         writer.WriteBits(1, 1);
         writer.EncodeN(N);
         L.Encode(writer);
     }
     else
     {
         writer.WriteBits(0, 1);
         writer.WriteBits(3, 2);
         writer.WriteBits(1, 1);
         writer.EncodeN(N);
         L.Encode(writer);
         R.Encode(writer);
     }
 }
Exemplo n.º 2
0
 internal override void Encode(BitWriter writer)
 {
     writer.EncodeN(N);
 }