Closed lrq3000 closed 1 year ago
Likely an error, but it does not affect decoding that much, at worst it will overestimate its capabilities (ie, try to correct when it can't, but syndrome will still fail if checked). Also the equation just after seems fishy:
errs = len(err_loc) - 1
if (errs-erase_count) * 2 + erase_count > nsym:
raise ReedSolomonError("Too many errors to correct")
I need to check whether the equation is correct. I'm not sure why I subtract erase_count from errs. The Singleton Bound is errs*2 + erase_count <= nsym
.
Ok so I checked and everything is very fine, in fact it's because the errors locator polynomial is offset, it goes from 1 to 256 (in GF(2^8)), so that's why we must subtract -1 to get its real length. I clarified by adding some comments.
Thanks to Jonas Braun for reporting this possible issue!
Mirror of https://github.com/lrq3000/reedsolomon/issues/1