From 656f0686562ee5f090b5565fbc3670b510460028 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Tue, 8 Dec 2020 15:19:50 +0800 Subject: [PATCH] Update FEC code for the fixed libfec handling of erasure/error positions when PAD != 0 --- fec.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fec.cc b/fec.cc index a29336c..5772d41 100644 --- a/fec.cc +++ b/fec.cc @@ -51,7 +51,7 @@ std::tuple 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()); @@ -70,7 +70,7 @@ std::tuple 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; }