mirror of
https://github.com/aicodix/modem.git
synced 2026-04-27 14:30:34 +00:00
avoid variable length arrays
This commit is contained in:
parent
d5a0b5c2f2
commit
6282c0af33
1 changed files with 3 additions and 2 deletions
|
|
@ -52,6 +52,7 @@ struct Decoder
|
|||
static const int filter_len = (((21 * rate) / 8000) & ~3) | 1;
|
||||
static const int guard_len = symbol_len / 8;
|
||||
static const int extended_len = symbol_len + guard_len;
|
||||
static const int mod_max = 6;
|
||||
static const int code_max = 14;
|
||||
static const int bits_max = 1 << code_max;
|
||||
static const int data_max = 1024;
|
||||
|
|
@ -398,7 +399,7 @@ struct Decoder
|
|||
if (i % comb_dist == comb_off) {
|
||||
phase[i] = arg(cons[cons_cols*j+i]);
|
||||
} else {
|
||||
code_type tmp[mod_bits];
|
||||
code_type tmp[mod_max];
|
||||
mod_hard(tmp, cons[cons_cols*j+i]);
|
||||
phase[i] = arg(cons[cons_cols*j+i] * conj(mod_map(tmp)));
|
||||
}
|
||||
|
|
@ -431,7 +432,7 @@ struct Decoder
|
|||
}
|
||||
} else {
|
||||
for (int i = 0; i < cons_cols; ++i) {
|
||||
code_type tmp[mod_bits];
|
||||
code_type tmp[mod_max];
|
||||
mod_hard(tmp, cons[cons_cols*j+i]);
|
||||
cmplx hard = mod_map(tmp);
|
||||
cmplx error = cons[cons_cols*j+i] - hard;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue