( TCH | 2020. 11. 07., szo – 23:08 )

Ugyan nem értem, hogy jött ide a bitreverzió, de ha már az, akkor minek a ciklus?
unsigned short int reverse16(unsigned short int x)
{
	x = (((x & 0xaaaa) >> 1) | ((x & 0x5555) << 1));
	x = (((x & 0xcccc) >> 2) | ((x & 0x3333) << 2));
	x = (((x & 0xf0f0) >> 4) | ((x & 0x0f0f) << 4));
	x = (((x & 0xff00) >> 8) | ((x & 0x00ff) << 8));
	return x; // Hogy szep legyen. :P
}
Innen, csak 16-bitre.