1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-25 11:17:26 +00:00

Eliminate dead bit reverser.

This commit is contained in:
Thomas Harte
2023-05-10 17:14:39 -05:00
parent 809cd7bca9
commit ea50d5bda7
4 changed files with 0 additions and 64 deletions
-25
View File
@@ -1,25 +0,0 @@
//
// BitReverse.cpp
// Clock Signal
//
// Created by Thomas Harte on 03/10/2017.
// Copyright 2017 Thomas Harte. All rights reserved.
//
#include "BitReverse.hpp"
void Storage::Data::BitReverse::reverse(std::vector<uint8_t> &vector) {
for(auto &byte : vector) {
byte =
uint8_t(
((byte & 0x01) << 7) |
((byte & 0x02) << 5) |
((byte & 0x04) << 3) |
((byte & 0x08) << 1) |
((byte & 0x10) >> 1) |
((byte & 0x20) >> 3) |
((byte & 0x40) >> 5) |
((byte & 0x80) >> 7)
);
}
}
-28
View File
@@ -1,28 +0,0 @@
//
// BitReverse.hpp
// Clock Signal
//
// Created by Thomas Harte on 03/10/2017.
// Copyright 2017 Thomas Harte. All rights reserved.
//
#ifndef BitReverse_hpp
#define BitReverse_hpp
#include <cstdint>
#include <vector>
namespace Storage::Data::BitReverse {
/*!
Reverses the order of the bits in every byte of the vector:
bit 7 exchanges with bit 0, bit 6 exchanges with bit 1, 5 with 2,
and 4 with 3.
*/
void reverse(std::vector<uint8_t> &vector);
// TODO: is this substantially different from Numeric/BitReverse.hpp?
}
#endif /* BitReverse_hpp */