Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decode_rs_char() should return int #13

Open
zhangboyang opened this issue Nov 18, 2017 · 1 comment
Open

decode_rs_char() should return int #13

zhangboyang opened this issue Nov 18, 2017 · 1 comment

Comments

@zhangboyang
Copy link

zhangboyang commented Nov 18, 2017

According to documention of libfec:

The decode_ functions correct the errors in a Reed-Solomon codeword of N symbols up to the capability of the code. An optional list of "erased" symbol indices may be given in the eras_pos array to assist the decoder; this parameter may be NULL if no erasures are given. The number of erased symbols must be given in the no_eras parameter.

The decoder corrects the symbols "in place", returning the number of symbols in error. If the codeword is uncorrectable, -1 is returned and the data block is unchanged. If eras_pos is non-null, it is used to return a list of corrected symbol positions, in no particular order. This means that the array passed through this parameter must have at least nroots elements to prevent a possible buffer overflow.

The decode_ functions return a count of corrected
symbols, or -1 if the block was uncorrectible.

However, in the compatibility layer, decode_rs_char() returns void, and there is no return value in erasure_locations.

@zhangboyang zhangboyang changed the title decode_rs_char should return int decode_rs_char() should return int Nov 18, 2017
@brian-armstrong
Copy link
Member

Thanks for the report. The shim is built for compatibility with https://github.com/jgaeddert/liquid-dsp so it doesn't do everything exactly right. I've avoided taking bits from libfec's source so that this project could operate cleanly from an IP perspective. Now that you've reported this, I'll look into fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants