11#ifndef CORE_GP_BIT_SWAP_H
12#define CORE_GP_BIT_SWAP_H
27 return ((
byte * 0x0802LU & 0x22110LU) |
28 (
byte * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16;
41 for (i = 0; i < len; i++)
58 return ((
byte & 0xC0) >> 6) | ((
byte & 0x30) >> 2) |
59 ((
byte & 0x0C) << 2) | ((
byte & 0x03) << 6);
72 for (i = 0; i < len; i++)
89 return ((
byte & 0xf0) >> 4) | ((
byte & 0x0f) << 4);
102 for (i = 0; i < len; i++)
static uint8_t GP_BIT_SWAP_B1(uint8_t byte)
Reverses 1 bit blocks in the byte.
static uint8_t GP_BIT_SWAP_B4(uint8_t byte)
Reverses 4 bit blocks in the byte.
static void gp_bit_swap_row_b4(uint8_t *row, unsigned int len)
Reverses 4 bit blocks in a row.
static uint8_t GP_BIT_SWAP_B2(uint8_t byte)
Reverses 2 bit blocks in the byte.
static void gp_bit_swap_row_b2(uint8_t *row, unsigned int len)
Reverses 2 bit blocks in a row.
static void gp_bit_swap_row_b1(uint8_t *row, unsigned int len)
Reverses 1 bit blocks in a row.