Skip to content

Commit f67884e

Browse files
authored
Update README.md
1 parent 0b9ca2d commit f67884e

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,59 @@ audio:
5050
outputEnabled: false
5151
outputVolume: 30
5252
```
53+
54+
## Quick Reference: Auto-FEC Levels 0 – 5
55+
56+
| Level | Denominator | Added Redundancy |
57+
|-------|-------------|------------------|
58+
| 0 | **1.00000** | 0 % |
59+
| 1 | **1.11111** | ≈ 11 % |
60+
| 2 | **1.25000** | 25 % |
61+
| 3 | **1.42000** | 42 % |
62+
| 4 | **1.66667** | 67 % |
63+
| 5 | **2.00000** | 100 % |
64+
65+
> **How the denominator is used:**
66+
> The selected denominator multiplies either **`FEC_k`** (source-packet count) *or* **`FEC_n`** (total packets after redundancy), increasing the actual amount of forward-error-correction data.
67+
68+
69+
### Threshold Fields (packets / second)
70+
71+
| Field | Purpose |
72+
|-------|---------|
73+
| `LostThreshold` | If `lost_pkts ≥ LostThreshold`, jump straight to **FEC-5** |
74+
| `RecThr1 … RecThr4` | Number of *recovered* packets (`rec_pkts`) that triggers **FEC-1 … FEC-4** |
75+
76+
**Ordering constraint — must hold:**
77+
`RecThr1 < RecThr2 < RecThr3 < RecThr4 < LostThreshold`
78+
79+
---
80+
81+
### Decision Logic (executed once per second)
82+
83+
```text
84+
if lost_pkts >= LostThreshold:
85+
level = 5
86+
elif rec_pkts >= RecThr4:
87+
level = 4
88+
elif rec_pkts >= RecThr3:
89+
level = 3
90+
elif rec_pkts >= RecThr2:
91+
level = 2
92+
elif rec_pkts >= RecThr1:
93+
level = 1
94+
else:
95+
level = 0
96+
97+
apply_fec(level) # multiply the level’s denominator by FEC_k or FEC_n
98+
```
99+
100+
Set thresholds thoughtfully:
101+
Lower values → more aggressive protection (higher bandwidth / latency).
102+
Higher values → leaner bandwidth, less resilience.
103+
104+
---
105+
53106
## List of potential improvements:
54107
* adaptive link [x]
55108
* 40 MHz bandwidth [?] - works but buggy

0 commit comments

Comments
 (0)