mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-27 04:15:16 +00:00
Fix lintian warning very-long-line-length-in-source-file (raised by Lintian v2.110.0)
Rationale: The source file includes a line length that is well beyond the normally human made code line length. This very long line length does not allow Lintian to do correctly some source file checks. This line could also be the result of some text injected by a computer program, and thus could lead to FTBFS bugs. Last but not least, long line in source code could be used to obfuscate the source code and to hide stuff like backdoors or security problems.
This commit is contained in:
@@ -8,11 +8,28 @@
|
||||
.SH SYNOPSIS
|
||||
\fBvolk_gnsssdr_profile\fR [OPTION]
|
||||
.SH DESCRIPTION
|
||||
The Vector-Optimized Library of Kernels of GNSS-SDR (VOLK_GNSSSDR) is a software library that provides developers with an interface to use Single Input - Multiple Data (SIMD) instructions, which are of special interest for operations that are in the receiver's critical path of the processing load.
|
||||
The Vector-Optimized Library of Kernels of GNSS-SDR (VOLK_GNSSSDR) is a software
|
||||
library that provides developers with an interface to use Single Input -
|
||||
Multiple Data (SIMD) instructions, which are of special interest for operations
|
||||
that are in the receiver's critical path of the processing load.
|
||||
.TP
|
||||
Processors providing SIMD instruction sets compute with multiple processing elements that perform the same operation on multiple data points simultaneously, thus exploiting data-level parallelism, an can be found in most modern desktop and laptop personal computers. In a nutshell, VOLK_GNSSSDR implements in assembly language optimized versions of computationally-intensive operations for different processor architectures that are commonly found in modern computers. In order to use the most optimized version for the specific processor(s) of the host machine running the software receiver (that is, the implementation than runs the fastest).
|
||||
Processors providing SIMD instruction sets compute with multiple processing
|
||||
elements that perform the same operation on multiple data points simultaneously,
|
||||
thus exploiting data-level parallelism, an can be found in most modern desktop
|
||||
and laptop personal computers. In a nutshell, VOLK_GNSSSDR implements in
|
||||
assembly language optimized versions of computationally-intensive operations for
|
||||
different processor architectures that are commonly found in modern computers.
|
||||
In order to use the most optimized version for the specific processor(s) of the
|
||||
host machine running the software receiver (that is, the implementation than
|
||||
runs the fastest).
|
||||
.TP
|
||||
\fBvolk_gnsssdr_profile\fR is a program that tests all known VOLK_GNSSSDR kernels (that is, basic processing components like adders, multipliers, correlators, and much more) for each architecture supported by the host machine, measuring their performance. When finished, the profiler writes to $HOME/.volk_gnsssdr/volk_gnsssdr_config the best architecture for each VOLK_GSSSDR function. This file is read when using a function to know the best version to execute.
|
||||
\fBvolk_gnsssdr_profile\fR is a program that tests all known VOLK_GNSSSDR
|
||||
kernels (that is, basic processing components like adders, multipliers,
|
||||
correlators, and much more) for each architecture supported by the host machine,
|
||||
measuring their performance. When finished, the profiler writes to
|
||||
$HOME/.volk_gnsssdr/volk_gnsssdr_config the best architecture for each
|
||||
VOLK_GSSSDR function. This file is read when using a function to know the best
|
||||
version to execute.
|
||||
.SH OPTIONS
|
||||
\fBvolk_gnsssdr_profile\fR takes the following options:
|
||||
.TP
|
||||
@@ -38,7 +55,10 @@ Processors providing SIMD instruction sets compute with multiple processing elem
|
||||
\.TP
|
||||
Check https://gnss\-sdr.org for more information.
|
||||
.SH HISTORY
|
||||
This library was originally developed by Andres Cecilia Luque in the framework of the Summer of Code in Space program (SOCIS 2014) by the European Space Agency (ESA), and then integrated into \fBgnss-sdr\fR. This software is based on the VOLK library https://www.libvolk.org/
|
||||
This library was originally developed by Andres Cecilia Luque in the framework
|
||||
of the Summer of Code in Space program (SOCIS 2014) by the European Space Agency
|
||||
(ESA), and then integrated into \fBgnss-sdr\fR. This software is based on the
|
||||
VOLK library https://www.libvolk.org/
|
||||
.SH BUGS
|
||||
No known bugs.
|
||||
.SH AUTHOR
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -291,7 +291,23 @@ ReedSolomon::ReedSolomon(const std::string& gnss_signal)
|
||||
{244, 120, 86, 42, 110, 203, 209, 158, 119, 115, 207, 5, 104, 140, 138, 113, 25, 153, 59, 171, 105, 67, 136, 70, 30, 10, 203, 80, 13, 200, 172, 216},
|
||||
{116, 64, 52, 174, 54, 126, 16, 194, 162, 33, 33, 157, 176, 197, 225, 12, 59, 55, 253, 228, 148, 47, 179, 185, 24, 138, 253, 20, 142, 55, 172, 88}};
|
||||
|
||||
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244, 165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71, 165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
|
||||
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249,
|
||||
250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120,
|
||||
81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244,
|
||||
165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54,
|
||||
42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51,
|
||||
118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151,
|
||||
21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115,
|
||||
255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137,
|
||||
1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20,
|
||||
192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180,
|
||||
179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159,
|
||||
7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71,
|
||||
165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57,
|
||||
136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241,
|
||||
230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82,
|
||||
54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5,
|
||||
252, 251, 1};
|
||||
}
|
||||
else if (gnss_signal == "E1B")
|
||||
{
|
||||
@@ -438,7 +454,23 @@ ReedSolomon::ReedSolomon(const std::string& gnss_signal)
|
||||
d_shortening = 0; // shortening parameter
|
||||
d_rows_G = 0;
|
||||
d_columns_G = 0;
|
||||
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244, 165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71, 165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
|
||||
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249,
|
||||
250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120,
|
||||
81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244,
|
||||
165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54,
|
||||
42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51,
|
||||
118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151,
|
||||
21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115,
|
||||
255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137,
|
||||
1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20,
|
||||
192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180,
|
||||
179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159,
|
||||
7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71,
|
||||
165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57,
|
||||
136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241,
|
||||
230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82,
|
||||
54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5,
|
||||
252, 251, 1};
|
||||
}
|
||||
|
||||
d_data_in_block = d_symbols_per_block - d_nroots;
|
||||
|
||||
@@ -71,7 +71,8 @@ if(NOT benchmark_FOUND)
|
||||
IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/Release/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark${CMAKE_STATIC_LIBRARY_SUFFIX};${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark${CMAKE_STATIC_LIBRARY_SUFFIX};
|
||||
${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
)
|
||||
endif()
|
||||
set_target_properties(benchmark::benchmark PROPERTIES
|
||||
|
||||
@@ -23,7 +23,14 @@
|
||||
|
||||
void bm_e1b_erasurecorrection_shortened(benchmark::State& state)
|
||||
{
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>(60, 29, 1, 195, 0, 137);
|
||||
|
||||
@@ -74,7 +81,9 @@ void bm_e1b_erasurecorrection_shortened(benchmark::State& state)
|
||||
// Delete g_0
|
||||
for (int i = 58; i < 73; i++)
|
||||
{
|
||||
erasure_positions.push_back(i + 137); // erasure position refers to the unshortened code, so we add 137
|
||||
// erasure position refers to the unshortened code, so we
|
||||
// add 137
|
||||
erasure_positions.push_back(i + 137);
|
||||
}
|
||||
|
||||
// Delete g_2
|
||||
@@ -99,7 +108,20 @@ void bm_e1b_erasurecorrection_shortened(benchmark::State& state)
|
||||
|
||||
void bm_e1b_erasurecorrection_unshortened(benchmark::State& state)
|
||||
{
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238, 77, 12,
|
||||
72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157,
|
||||
220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252,
|
||||
165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25,
|
||||
164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>(60, 29, 1, 195, 0, 137);
|
||||
|
||||
@@ -150,7 +172,9 @@ void bm_e1b_erasurecorrection_unshortened(benchmark::State& state)
|
||||
// Delete g_0
|
||||
for (int i = 58; i < 73; i++)
|
||||
{
|
||||
erasure_positions.push_back(i + 137); // erasure position refers to the unshortened code, so we add 137
|
||||
// erasure position refers to the unshortened code, so we
|
||||
// add 137
|
||||
erasure_positions.push_back(i + 137);
|
||||
}
|
||||
|
||||
// Delete g_2
|
||||
@@ -175,10 +199,27 @@ void bm_e1b_erasurecorrection_unshortened(benchmark::State& state)
|
||||
|
||||
void bm_e6b_correction(benchmark::State& state)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce t = (n-k)/2 = 111 errors:
|
||||
for (int i = 0; i < 222; i += 2)
|
||||
@@ -205,10 +246,27 @@ void bm_e6b_correction(benchmark::State& state)
|
||||
|
||||
void bm_e6b_erasure(benchmark::State& state)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce 223 erasures:
|
||||
std::vector<int> erasure_positions;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -22,8 +22,20 @@
|
||||
|
||||
TEST(ReedSolomonE1BTest, EncodeWithPoly)
|
||||
{
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
|
||||
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
|
||||
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
|
||||
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
|
||||
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
|
||||
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
|
||||
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
|
||||
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
|
||||
242};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>("E1B");
|
||||
|
||||
@@ -36,8 +48,20 @@ TEST(ReedSolomonE1BTest, EncodeWithPoly)
|
||||
TEST(ReedSolomonE1BTest, EncodeWithCustomPoly)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
|
||||
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
|
||||
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
|
||||
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
|
||||
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
|
||||
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
|
||||
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
|
||||
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
|
||||
242};
|
||||
|
||||
// Instantiate a ReedSolomon object with Galileo E1 (INAV) parameters
|
||||
const int nroots = 60;
|
||||
@@ -46,7 +70,11 @@ TEST(ReedSolomonE1BTest, EncodeWithCustomPoly)
|
||||
const int prim = 1;
|
||||
const int fcr = 195;
|
||||
const int shortening = 137;
|
||||
const std::vector<uint8_t> genpoly_coeff = {1, 208, 42, 48, 76, 19, 41, 108, 167, 235, 166, 244, 186, 18, 124, 251, 79, 193, 14, 154, 6, 118, 19, 3, 122, 9, 187, 42, 131, 46, 66, 65, 62, 94, 101, 45, 214, 141, 131, 230, 102, 20, 63, 202, 36, 23, 188, 88, 169, 62, 73, 88, 152, 197, 231, 58, 101, 154, 190, 91, 193};
|
||||
const std::vector<uint8_t> genpoly_coeff = {1, 208, 42, 48, 76, 19, 41, 108,
|
||||
167, 235, 166, 244, 186, 18, 124, 251, 79, 193, 14, 154, 6, 118, 19, 3,
|
||||
122, 9, 187, 42, 131, 46, 66, 65, 62, 94, 101, 45, 214, 141, 131, 230,
|
||||
102, 20, 63, 202, 36, 23, 188, 88, 169, 62, 73, 88, 152, 197, 231, 58,
|
||||
101, 154, 190, 91, 193};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>(nroots, minpoly, prim, fcr, pad, shortening, genpoly_coeff);
|
||||
|
||||
@@ -59,8 +87,20 @@ TEST(ReedSolomonE1BTest, EncodeWithCustomPoly)
|
||||
TEST(ReedSolomonE1BTest, EncodeWithMatrix)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
|
||||
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
|
||||
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
|
||||
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
|
||||
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
|
||||
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
|
||||
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
|
||||
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
|
||||
242};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>("E1B");
|
||||
|
||||
@@ -73,8 +113,20 @@ TEST(ReedSolomonE1BTest, EncodeWithMatrix)
|
||||
TEST(ReedSolomonE1BTest, EncodeWithCustomMatrix)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
|
||||
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
|
||||
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
|
||||
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
|
||||
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
|
||||
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
|
||||
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
|
||||
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
|
||||
242};
|
||||
|
||||
const int nroots = 60;
|
||||
const int minpoly = 29;
|
||||
@@ -214,9 +266,20 @@ TEST(ReedSolomonE1BTest, EncodeWithCustomMatrix)
|
||||
TEST(ReedSolomonE1BTest, DecodeNoErrors)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
// Instantiate a ReedSolomon object with Galileo E1 (INAV) parameters
|
||||
const int nroots = 60;
|
||||
@@ -240,9 +303,20 @@ TEST(ReedSolomonE1BTest, DecodeNoErrors)
|
||||
TEST(ReedSolomonE1BTest, Decode30Errors)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
// Introduce 30 non-consecutive errors
|
||||
for (int i = 0; i < 60; i += 2)
|
||||
@@ -265,9 +339,20 @@ TEST(ReedSolomonE1BTest, Decode30Errors)
|
||||
TEST(ReedSolomonE1BTest, Decode31Errors)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
// Introduce 31 errors (this should make the decoder to fail)
|
||||
for (int i = 0; i < 62; i += 2)
|
||||
@@ -286,9 +371,20 @@ TEST(ReedSolomonE1BTest, Decode31Errors)
|
||||
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase1)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
std::vector<int> erasure_positions;
|
||||
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions
|
||||
@@ -340,9 +436,20 @@ TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase1)
|
||||
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase2)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
std::vector<int> erasure_positions;
|
||||
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions
|
||||
@@ -394,9 +501,20 @@ TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase2)
|
||||
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase3)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
std::vector<int> erasure_positions;
|
||||
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions
|
||||
@@ -447,9 +565,20 @@ TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase3)
|
||||
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase4)
|
||||
{
|
||||
// ICD 2.0 Annex F
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
|
||||
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
|
||||
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
|
||||
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
|
||||
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
|
||||
67, 199, 215, 162};
|
||||
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
|
||||
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
|
||||
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
|
||||
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
|
||||
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
|
||||
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
|
||||
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
|
||||
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
|
||||
|
||||
std::vector<int> erasure_positions;
|
||||
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions
|
||||
|
||||
@@ -23,11 +23,28 @@
|
||||
TEST(ReedSolomonE6BTest, EncodeWithGenMatrix)
|
||||
{
|
||||
// input vector as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> expected_output = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
|
||||
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
|
||||
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
|
||||
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
|
||||
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
|
||||
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
|
||||
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
|
||||
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>();
|
||||
std::vector<uint8_t> encoded_output = rs->encode_with_generator_matrix(input);
|
||||
@@ -39,11 +56,28 @@ TEST(ReedSolomonE6BTest, EncodeWithGenMatrix)
|
||||
TEST(ReedSolomonE6BTest, EncodeWithGenPoly)
|
||||
{
|
||||
// input vector as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> expected_output = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
|
||||
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
|
||||
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
|
||||
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
|
||||
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
|
||||
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
|
||||
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
|
||||
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>();
|
||||
std::vector<uint8_t> encoded_output = rs->encode_with_generator_poly(input);
|
||||
@@ -55,11 +89,28 @@ TEST(ReedSolomonE6BTest, EncodeWithGenPoly)
|
||||
TEST(ReedSolomonE6BTest, EncodeWithCustomPoly)
|
||||
{
|
||||
// input vector as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> expected_output = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
|
||||
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
|
||||
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
|
||||
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
|
||||
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
|
||||
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
|
||||
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
|
||||
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
const int nroots = 223;
|
||||
const int minpoly = 29;
|
||||
@@ -67,7 +118,21 @@ TEST(ReedSolomonE6BTest, EncodeWithCustomPoly)
|
||||
const int fcr = 1;
|
||||
const int pad = 0;
|
||||
const int shortening = 0;
|
||||
const std::vector<uint8_t> genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244, 165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71, 165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
|
||||
const std::vector<uint8_t> genpoly_coeff = {88, 216, 195, 23, 111, 82, 79,
|
||||
81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4,
|
||||
19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244,
|
||||
165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13,
|
||||
24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243,
|
||||
223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236,
|
||||
147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59,
|
||||
9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28,
|
||||
174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43,
|
||||
165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255,
|
||||
111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71,
|
||||
165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85,
|
||||
14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170,
|
||||
148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169,
|
||||
123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>(nroots, minpoly, prim, fcr, pad, shortening, genpoly_coeff);
|
||||
|
||||
@@ -80,11 +145,28 @@ TEST(ReedSolomonE6BTest, EncodeWithCustomPoly)
|
||||
TEST(ReedSolomonE6BTest, EncodeWithCustomMatrix)
|
||||
{
|
||||
// input vector as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
|
||||
const std::vector<uint8_t> expected_output = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
|
||||
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
|
||||
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
|
||||
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
|
||||
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
|
||||
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
|
||||
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
|
||||
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
const int nroots = 223;
|
||||
const int minpoly = 29;
|
||||
@@ -360,10 +442,27 @@ TEST(ReedSolomonE6BTest, EncodeWithCustomMatrix)
|
||||
|
||||
TEST(ReedSolomonE6BTest, DecodeNoErrors)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>();
|
||||
|
||||
@@ -377,10 +476,27 @@ TEST(ReedSolomonE6BTest, DecodeNoErrors)
|
||||
|
||||
TEST(ReedSolomonE6BTest, Decode1Error)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce 1 error:
|
||||
encoded_input[23] = 0;
|
||||
@@ -396,10 +512,27 @@ TEST(ReedSolomonE6BTest, Decode1Error)
|
||||
|
||||
TEST(ReedSolomonE6BTest, Decode16Errors)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce 16 errors:
|
||||
encoded_input[3] = 0;
|
||||
@@ -430,10 +563,27 @@ TEST(ReedSolomonE6BTest, Decode16Errors)
|
||||
|
||||
TEST(ReedSolomonE6BTest, Decode111Errors)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce t = (n-k)/2 = 111 errors:
|
||||
for (int i = 0; i < 222; i += 2)
|
||||
@@ -452,17 +602,35 @@ TEST(ReedSolomonE6BTest, Decode111Errors)
|
||||
|
||||
TEST(ReedSolomonE6BTest, Decode111ErrorsCustomConstructor)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
// clang-format on
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce t = (n-k)/2 = 111 errors:
|
||||
for (int i = 0; i < 222; i += 2)
|
||||
{
|
||||
encoded_input[i] = 0;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
int nroots = 223;
|
||||
int minpoly = 29;
|
||||
int prim = 1;
|
||||
@@ -479,8 +647,24 @@ TEST(ReedSolomonE6BTest, Decode111ErrorsCustomConstructor)
|
||||
|
||||
TEST(ReedSolomonE6BTest, Decode112Errors)
|
||||
{
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
// clang-format on
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce 112 errors (this should make the decoder fail):
|
||||
for (int i = 0; i < 224; i += 2)
|
||||
@@ -497,10 +681,27 @@ TEST(ReedSolomonE6BTest, Decode112Errors)
|
||||
|
||||
TEST(ReedSolomonE6BTest, Decode113ErrorsWithErasure)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce 113 errors:
|
||||
for (int i = 0; i < 226; i += 2)
|
||||
@@ -511,7 +712,7 @@ TEST(ReedSolomonE6BTest, Decode113ErrorsWithErasure)
|
||||
std::vector<int> erasure_positions{2, 4, 16, 18, 22, 54};
|
||||
|
||||
auto rs = std::make_unique<ReedSolomon>();
|
||||
|
||||
// clang-format off
|
||||
int result = rs->decode(encoded_input, erasure_positions);
|
||||
EXPECT_TRUE(result == 113);
|
||||
std::vector<uint8_t> decoded(encoded_input.begin(), encoded_input.begin() + 32);
|
||||
@@ -521,10 +722,28 @@ TEST(ReedSolomonE6BTest, Decode113ErrorsWithErasure)
|
||||
|
||||
TEST(ReedSolomonE6BTest, DecodeErasure)
|
||||
{
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
// clang-format on
|
||||
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
|
||||
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
|
||||
128, 245, 87, 150, 58, 192, 66, 130, 179};
|
||||
|
||||
std::vector<uint8_t> encoded_input = {
|
||||
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
|
||||
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
|
||||
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
|
||||
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
|
||||
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
|
||||
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
|
||||
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
|
||||
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
|
||||
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
|
||||
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
|
||||
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
|
||||
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
|
||||
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
|
||||
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
|
||||
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
|
||||
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
|
||||
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
|
||||
|
||||
// Introduce 223 erasures:
|
||||
std::vector<int> erasure_positions;
|
||||
@@ -536,7 +755,7 @@ TEST(ReedSolomonE6BTest, DecodeErasure)
|
||||
auto rs = std::make_unique<ReedSolomon>();
|
||||
|
||||
int result = rs->decode(encoded_input, erasure_positions);
|
||||
|
||||
// clang-format off
|
||||
EXPECT_TRUE(result == 223);
|
||||
std::vector<uint8_t> decoded(encoded_input.begin(), encoded_input.begin() + 32);
|
||||
EXPECT_TRUE(expected_output == decoded);
|
||||
|
||||
Reference in New Issue
Block a user