animetosho / ParPar

High performance PAR2 create client for NodeJS
190 stars 19 forks source link

[Request] Ability to set the number of critical packets repetitions #41

Closed uxmy closed 2 years ago

uxmy commented 2 years ago

I wish you can add an option to choose a custom number for critical packets repetition.

animetosho commented 2 years ago

Thanks for the suggestion, though I'm not sure how it'd work.

In what way would you be looking to choose such a number? Any examples?

uxmy commented 2 years ago

I don't think log(2) is sufficient. For example, if i create 1 recovery file containing 60 recovery slices, i will have 5 packet repetitions (log2 (60) =~5,9). In this case, if every critical packet of those 5 gets a tiny damage (it's unlikely but still possible), all the 60 slices will become useless. That's why i would prefer at least 10 repetitions in this scenario.

Being able to set the number with no restrictions is perfect in my opinion (maybe should be disabled if the user chooses "pow2" for --slice-dist) . However, adding log(1,5) "pow1,5"as a 3rd option for --packet-redundancy can be enough.

animetosho commented 2 years ago

I see, thanks for the explanation.

As you seem to point out, there's some complication with the fact that different files have different number of slices, and you likely don't want them to all have the same repetition. But if all you want to do is to use the same scheme but prefer more repetition, I can come up with some scheme to do so.

uxmy commented 2 years ago

But if all you want to do is to use the same scheme but prefer more repetition, I can come up with some scheme to do so.

Thank you. That would be great. For example, using the power of the decimal number 1,5 ( log1,5 (60) =~10 . We get 10 repetitions for 60 slices, compared with 5 if we use the power of number 2) . But maybe you will find a better idea.

animetosho commented 2 years ago

The latest commit enables --packet-redundancy=1.5o or --packet-redundancy=10 for your example.