Commit d89bd6a8 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Use 12 payload bits (and 56 coded bits) to make error detection reliable.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 7c41284c
...@@ -186,7 +186,7 @@ parse_options (int *argc_p, ...@@ -186,7 +186,7 @@ parse_options (int *argc_p,
} }
else if (check_arg (argc, argv, &i, "--short")) else if (check_arg (argc, argv, &i, "--short"))
{ {
Params::payload_size = 16; Params::payload_size = 12;
Params::payload_short = true; Params::payload_short = true;
} }
else if (check_arg (argc, argv, &i, "--hard")) else if (check_arg (argc, argv, &i, "--hard"))
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
using std::vector; using std::vector;
#if 0
/* codetables.de */ /* codetables.de */
static vector<vector<int>> block_48_16_16 = { static vector<vector<int>> block_48_16_16 = {
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1 }, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1 },
...@@ -46,8 +47,29 @@ static vector<vector<int>> block_48_16_16 = { ...@@ -46,8 +47,29 @@ static vector<vector<int>> block_48_16_16 = {
static const auto& gen_matrix = block_48_16_16; static const auto& gen_matrix = block_48_16_16;
static constexpr int gen_in_count = 16; static constexpr int gen_in_count = 16;
static constexpr int gen_out_count = 48; static constexpr int gen_out_count = 48;
#endif
#if 0 #if 0
static vector<vector<int>> block_52_12_20 = {
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0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 1, 0, 0, 1, 1, 0},
{ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0},
};
static const auto& gen_matrix = block_52_12_20;
static constexpr int gen_in_count = 12;
static constexpr int gen_out_count = 52;
#endif
static vector<vector<int>> block_56_12_22 = { static vector<vector<int>> block_56_12_22 = {
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 }, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0 }, { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0 },
...@@ -66,7 +88,6 @@ static vector<vector<int>> block_56_12_22 = { ...@@ -66,7 +88,6 @@ static vector<vector<int>> block_56_12_22 = {
static const auto& gen_matrix = block_56_12_22; static const auto& gen_matrix = block_56_12_22;
static constexpr int gen_in_count = 12; static constexpr int gen_in_count = 12;
static constexpr int gen_out_count = 56; static constexpr int gen_out_count = 56;
#endif
vector<int> vector<int>
code_encode (ConvBlockType block_type, const vector<int>& in_bits) code_encode (ConvBlockType block_type, const vector<int>& in_bits)
......
...@@ -84,8 +84,8 @@ number_format (double d) ...@@ -84,8 +84,8 @@ number_format (double d)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
constexpr int K = 16; constexpr int K = 12;
constexpr int N = 48; constexpr int N = 56;
srand (time (NULL)); srand (time (NULL));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment