【发布时间】:2013-02-12 23:35:38
【问题描述】:
我找到了查找表here. 该表生成为8位的反向位表。
我无法弄清楚它为什么会起作用。请解释其背后的理论。谢谢
static const unsigned char BitReverseTable256[256] =
{
# define R2(n) n, n + 2*64, n + 1*64, n + 3*64
# define R4(n) R2(n), R2(n + 2*16), R2(n + 1*16), R2(n + 3*16)
# define R6(n) R4(n), R4(n + 2*4 ), R4(n + 1*4 ), R4(n + 3*4 )
R6(0), R6(2), R6(1), R6(3)
};
【问题讨论】:
标签: c algorithm bit-manipulation c-preprocessor lookup-tables