Skip to content

Commit

Permalink
Update FEC code for the fixed libfec handling of erasure/error positi…
Browse files Browse the repository at this point in the history
…ons when PAD != 0
  • Loading branch information
mutability committed Dec 8, 2020
1 parent c823338 commit 656f068
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::tuple<bool, Bytes, unsigned> FEC::CorrectDownlink(const Bytes &raw, const s

int erasures_array[DOWNLINK_LONG_ROOTS];
for (std::size_t i = 0; i < erasures.size(); ++i) {
erasures_array[i] = erasures[i] + DOWNLINK_LONG_PAD;
erasures_array[i] = erasures[i];
corrected[erasures[i]] = 0;
}
int n_corrected = ::decode_rs_char(rs_downlink_long_, corrected.data(), erasures_array, erasures.size());
Expand All @@ -70,7 +70,7 @@ std::tuple<bool, Bytes, unsigned> FEC::CorrectDownlink(const Bytes &raw, const s
for (auto e : erasures) {
if (e < DOWNLINK_SHORT_BYTES) {
if (short_erasures < DOWNLINK_SHORT_ROOTS) {
erasures_array[short_erasures] = e + DOWNLINK_SHORT_PAD;
erasures_array[short_erasures] = e;
}
++short_erasures;
}
Expand Down

0 comments on commit 656f068

Please sign in to comment.