using System;
public class Program
{
public static void Main()
Console.WriteLine("Hello World");
var data = new byte[] { 0x81, 0x81, 0x62, 0x10 };
var w = ( BitConverter.ToUInt16( data, 0 ) + 1 ) & 0x3FFF;
var h = ( BitConverter.ToUInt16( data, 0 ) ) & 0xFFFC000;
Console.WriteLine( w ); // should be 386
Console.WriteLine( h ); // should be 395
}