public static byte FastScaleByteByByte(byte a, byte b) { int r1 = a * b + 0x80; int r2 = ((r1 >> 8) + r1) >> 8; return (byte)r2; }