public static s16 S16(byte[] buffer, ref Int64 index) { s16 result = BigEndianRead.S16(buffer, index); index += 2; return(result); }
public static float F2Dot14(byte[] buffer, ref Int64 index) { s16 fixedPoint = BigEndianRead.S16(buffer, index); index += 2; float result = 0; int twoBitTwosComplement = fixedPoint >> 14; if ((twoBitTwosComplement & 2) > 0) { int everythingFilledExceptTwoBits = ~3; twoBitTwosComplement = twoBitTwosComplement | everythingFilledExceptTwoBits; } result += twoBitTwosComplement; float temp = ((float)(fixedPoint & 0x3FFF)) / 0x4000;; result += temp; return(result); }