mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 04:00:34 +00:00
Add check of number of erasures, remove unused parameter in private method
This commit is contained in:
parent
a32ea2ab9c
commit
5cd1955dc0
@ -745,10 +745,15 @@ int ReedSolomon::decode(std::vector<uint8_t>& data_to_decode, const std::vector<
|
||||
std::cerr << "Reed Solomon usage error: wrong vector input size in decode method.\n";
|
||||
return result;
|
||||
}
|
||||
if (erasure_positions.size() > std::size_t(d_nroots))
|
||||
{
|
||||
std::cerr << "Reed Solomon usage error: too much erasure positions.\n";
|
||||
return result;
|
||||
}
|
||||
|
||||
if (d_shortening == 0)
|
||||
{
|
||||
result = decode_rs_8(data_to_decode.data(), erasure_positions.data(), erasure_positions.size(), d_pad);
|
||||
result = decode_rs_8(data_to_decode.data(), erasure_positions.data(), erasure_positions.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -757,7 +762,7 @@ int ReedSolomon::decode(std::vector<uint8_t>& data_to_decode, const std::vector<
|
||||
std::copy(data_to_decode.begin(), data_to_decode.begin() + d_info_symbols_shortened, unshortened_code_vector.begin());
|
||||
std::copy(data_to_decode.begin() + d_info_symbols_shortened, data_to_decode.begin() + d_data_symbols_shortened, unshortened_code_vector.begin() + d_data_in_block);
|
||||
|
||||
result = decode_rs_8(unshortened_code_vector.data(), erasure_positions.data(), erasure_positions.size(), d_pad);
|
||||
result = decode_rs_8(unshortened_code_vector.data(), erasure_positions.data(), erasure_positions.size());
|
||||
if (result >= 0)
|
||||
{
|
||||
// Store decoded result into the shortened code vector
|
||||
@ -769,7 +774,7 @@ int ReedSolomon::decode(std::vector<uint8_t>& data_to_decode, const std::vector<
|
||||
}
|
||||
|
||||
|
||||
int ReedSolomon::decode_rs_8(uint8_t* data, const int* eras_pos, int no_eras, int pad) const
|
||||
int ReedSolomon::decode_rs_8(uint8_t* data, const int* eras_pos, int no_eras) const
|
||||
{
|
||||
int deg_lambda;
|
||||
int el;
|
||||
|
@ -123,7 +123,7 @@ private:
|
||||
|
||||
int mod255(int x) const;
|
||||
int rs_min(int a, int b) const;
|
||||
int decode_rs_8(uint8_t* data, const int* eras_pos, int no_eras, int pad) const;
|
||||
int decode_rs_8(uint8_t* data, const int* eras_pos, int no_eras) const;
|
||||
|
||||
uint8_t galois_mul(uint8_t a, uint8_t b) const;
|
||||
uint8_t galois_add(uint8_t a, uint8_t b) const;
|
||||
|
Loading…
Reference in New Issue
Block a user