Annotation of nono/wx/bitrev.h, revision 1.1.1.3

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
                      7: #pragma once
                      8: 
1.1.1.2   root        9: #include "header.h"
                     10: 
1.1       root       11: extern const uint8 bitrev_table[256];
                     12: 
1.1.1.3 ! root       13: // 8ビットを左右反転する (定数用)
        !            14: static constexpr uint8 _rev8(uint8 x)
        !            15: {
        !            16:        x = ((x & 0x0f) << 4) | ((x >> 4) & 0x0f);
        !            17:        x = ((x & 0x33) << 2) | ((x >> 2) & 0x33);
        !            18:        x = ((x & 0x55) << 1) | ((x >> 1) & 0x55);
        !            19:        return x;
        !            20: }
        !            21: 
        !            22: // 8ビットを左右反転する (実行時用)
1.1       root       23: static inline uint8
                     24: bitrev(uint8 x)
                     25: {
                     26:        return bitrev_table[x];
                     27: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.