|
|
nono 0.2.0
//
// nono
// Copyright (C) 2020 nono project
// Licensed under nono-license.txt
//
#pragma once
#include "header.h"
extern const uint8 bitrev_table[256];
// 8ビットを左右反転する (定数用)
static constexpr uint8 _rev8(uint8 x)
{
x = ((x & 0x0f) << 4) | ((x >> 4) & 0x0f);
x = ((x & 0x33) << 2) | ((x >> 2) & 0x33);
x = ((x & 0x55) << 1) | ((x >> 1) & 0x55);
return x;
}
// 8ビットを左右反転する (実行時用)
static inline uint8
bitrev(uint8 x)
{
return bitrev_table[x];
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.