diff --git a/decode.cc b/decode.cc index aaffb12..31d4a99 100644 --- a/decode.cc +++ b/decode.cc @@ -272,6 +272,8 @@ struct Decoder int cons_rows = 0; int comb_cols = 32; int code_cols = 0; + int comb_dist = 9; + int comb_off = 4; switch (oper_mode) { case 23: mod_bits = 2; @@ -342,8 +344,6 @@ struct Decoder } int data_bytes = data_bits / 8; int cons_cols = code_cols + comb_cols; - int comb_dist = comb_cols ? cons_cols / comb_cols : 1; - int comb_off = comb_cols ? comb_dist / 2 : 1; int code_off = - cons_cols / 2; for (int i = 0; i < symbol_pos+symbol_len+extended_len; ++i) diff --git a/encode.cc b/encode.cc index 035c981..5687a24 100644 --- a/encode.cc +++ b/encode.cc @@ -266,8 +266,8 @@ struct Encoder const uint32_t *frozen_bits = nullptr; int code_cols = 0; int comb_cols = 32; - int comb_dist = 1; - int comb_off = 1; + int comb_dist = 9; + int comb_off = 4; int data_bits = 0; int reserved_tones = 32; switch (oper_mode) { @@ -352,17 +352,13 @@ struct Encoder cons_cols = code_cols + comb_cols; code_off = offset - cons_cols / 2; if (oper_mode > 0) { - comb_dist = comb_cols ? cons_cols / comb_cols : 1; - comb_off = comb_cols ? comb_dist / 2 : 1; - if (reserved_tones) { - value kern_fac = 1 / value(10 * reserved_tones); - for (int i = 0, j = code_off - reserved_tones / 2; i < reserved_tones; ++i, ++j) { - if (j == code_off) - j += cons_cols; - fdom[bin(j)] = kern_fac; - } - bwd(kern, fdom); + value kern_fac = 1 / value(10 * reserved_tones); + for (int i = 0, j = code_off - reserved_tones / 2; i < reserved_tones; ++i, ++j) { + if (j == code_off) + j += cons_cols; + fdom[bin(j)] = kern_fac; } + bwd(kern, fdom); } for (int i = 0; i < guard_len / 4; ++i) weight[i] = 0;