This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <time.h> | |
#include <stdio.h> | |
#include <malloc.h> | |
#include <stdlib.h> | |
#define C55 0x5555555555555555ULL | |
#define C33 0x3333333333333333ULL | |
#define C0F 0x0f0f0f0f0f0f0f0fULL | |
#define C01 0x0101010101010101ULL | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static float Converter(ushort[] buffer) | |
{ | |
byte[] bytes = new byte[4]; | |
bytes[0] = (byte)(buffer[1] & 0xFF); | |
bytes[1] = (byte)(buffer[1] >> 8); | |
bytes[2] = (byte)(buffer[0] & 0xFF); | |
bytes[3] = (byte)(buffer[0] >> 8); | |
float value = BitConverter.ToSingle(bytes, 0); | |
return value; | |
} |