Created
February 15, 2023 14:10
-
-
Save francisrstokes/88502dd8d63bcc2e73b0bbd5ec376201 to your computer and use it in GitHub Desktop.
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
uint16_t BitReverse16(uint16_t value) { | |
value = (value & 0xFF00) >> 8 | (value & 0x00FF) << 8; | |
value = (value & 0xF0F0) >> 4 | (value & 0x0F0F) << 4; | |
value = (value & 0xCCCC) >> 2 | (value & 0x3333) << 2; | |
value = (value & 0xAAAA) >> 1 | (value & 0x5555) << 1; | |
return value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment