Reusable C++ coding-related code library
Find a file
2019-09-12 17:39:05 +02:00
tests added normal 5/6 code table 2019-09-12 17:39:05 +02:00
.gitignore moved crc and xorshift from DSP to CODE repository 2018-09-20 08:36:45 +02:00
avx2.hh removed AVX-512 instructions from AVX2 wrapper 2019-02-05 11:32:06 +01:00
bitman.hh added bit manipulation helpers 2018-09-22 19:13:37 +02:00
bitstream.hh added bitwise stream container 2018-09-20 09:11:33 +02:00
bose_chaudhuri_hocquenghem_decoder.hh nice catch by the regression test :) 2018-09-28 10:57:17 +02:00
bose_chaudhuri_hocquenghem_encoder.hh another nice catch by regression testing :D 2018-09-28 13:24:19 +02:00
crc.hh moved crc and xorshift from DSP to CODE repository 2018-09-20 08:36:45 +02:00
exclusive_reduce.hh added exclusive reduce algorithm 2018-10-13 10:34:42 +02:00
galois_field.hh make sure POLY doesn't create a shorter sequence 2018-09-29 23:04:19 +02:00
ldpc_decoder.hh added LDPC decoder version with fully computed LUT 2018-12-16 09:42:02 +01:00
ldpc_decoder2.hh added LDPC decoder version with fully computed LUT 2018-12-16 09:42:02 +01:00
ldpc_encoder.hh pre-calculate R entries from directly computed first q entries 2018-12-15 22:19:52 +01:00
LICENSE moved crc and xorshift from DSP to CODE repository 2018-09-20 08:36:45 +02:00
neon.hh added vclamp() 2018-12-13 11:19:31 +01:00
README.md added LDPC decoder version with fully computed LUT 2018-12-16 09:42:02 +01:00
reed_solomon_decoder.hh use constants to avoid mistakes 2018-09-28 10:09:18 +02:00
reed_solomon_encoder.hh use constants to avoid mistakes 2018-09-28 10:09:18 +02:00
reed_solomon_error_correction.hh split Artin Schreier imap generation code out 2018-09-29 21:24:00 +02:00
simd.hh silly search replace mistake 2019-09-12 16:50:02 +02:00
sse4_1.hh added vclamp() 2018-12-13 11:19:31 +01:00
xorshift.hh moved crc and xorshift from DSP to CODE repository 2018-09-20 08:36:45 +02:00

This is a work in progress and a long overdue attempt to bring all our not-DSP-related code together and make it reusable for our future projects.

Before using any of this you should enter the tests directory and execute "make". This will check if your compiler is able to create binaries that are able to produce correct results when executed.

What we have included so far:

crc.hh

A Cyclic redundancy check helps ensuring data integrity.

For example, if we need to integrate CRC32 checking for a few bytes, like in the following:

# echo -n 'Hello World!' | rhash -C -
(stdin) 1C291CA3

We can add it to our project as simple as that:

DSP::CRC<uint32_t> crc(0xEDB88320, 0xFFFFFFFF);
for (uint8_t c: std::string("Hello World!")) crc(c);
assert(~crc() == 0x1C291CA3);

xorshift.hh

Sometimes we need a sequence of "random enough" numbers but don't want to store them in an array to get a repeatable sequence. Here a Pseudorandom number generator can help by prodiving a deterministic and thus repeatable sequence of numbers. George Marsaglia discovered a class of simple and fast pseudorandom number generators, which he called Xorshift.

bitstream.hh

When dealing with unaligned and arbitrary-bit-sized elements in a data stream, the bitwise stream container might help avoiding some headaches.

bitman.hh

Simple bit manipulation on byte arrays.

galois_field.hh

We have to thank Évariste Galois for his contribution of the Finite field to mathematics, which laid the cornerstone for a variety of applications that we take for granted today. One of them is ReedSolomon error correction:

reed_solomon_error_correction.hh

Implemented are the following Encoders and Decoders:

ldpc_encoder.hh

Low-density parity-check encoder

ldpc_decoder.hh

Low-density parity-check layered decoder
This version stores only the first q bit positions and might be faster on low power systems.

ldpc_decoder2.hh

Low-density parity-check layered decoder
This version stores and uses all bit positions and might be faster on high performance workstations.

exclusive_reduce.hh

Reduce N times while excluding ith input element

It computes the following, but having only O(N) complexity and using O(1) extra storage:

	output[0] = input[1];
	output[1] = input[0];
	for (int i = 2; i < N; ++i)
		output[i] = op(input[0], input[1]);
	for (int i = 0; i < N; ++i)
		for (int j = 2; j < N; ++j)
			if (i != j)
				output[i] = op(output[i], input[j]);

simd.hh

Single instruction, multiple data (SIMD) wrappers for: