quiet / libcorrect

C library for Convolutional codes and Reed-Solomon
BSD 3-Clause "New" or "Revised" License
373 stars 95 forks source link

support RS in GF(2^k) for k <= 8 #18

Open brian-armstrong opened 6 years ago

brian-armstrong commented 6 years ago

This should make it possible to use RS modes for non GF(2^8). Because many internal types are uint8_t, we can't go past 2^8.

fly-feixiang commented 5 years ago

If we modify uint8_t to uint16_t, and can resolve the GF(2^k) for k=16 ?

brian-armstrong commented 5 years ago

@fly-feixiang It won't be as easy as just widening the type. That type is so critical to how everything works that there will be a lot of explicit and implicit dependencies on it being that wide. For example, there are a lot of loops and arrays that run on 256 (or 512) items and would instead need to run 2^16 (or 2^17) items. There may also be optimizations that need to be reworked to give appropriate performance for k > 8.

I don't think the changes will be too big, but every single line of code needs to be reviewed to see how it will be affected and then new tests written to ensure everything still works.

This isn't particularly high priority for me, but if you want to get started, I can point you to what changes would be needed.

fly-feixiang commented 5 years ago

Thanks for your reply.

In most devices, the page size is set to 4096 bytes, such as the phone, so we want to apply this algorithm to the phone.We also used the BCH algorithm implemented in the linux kernel, which has good performance, but it is under the GPL, which we can't use.

I want to extend it to k=12 now. If I have any difficulty, I will ask you