|
| 1 | +package rfc8698 |
| 2 | + |
| 3 | +import "time" |
| 4 | + |
| 5 | +type Bits uint32 |
| 6 | + |
| 7 | +type BitsPerSecond float64 |
| 8 | + |
| 9 | +const Kbps = BitsPerSecond(1_000) |
| 10 | +const Mbps = BitsPerSecond(1_000_000) |
| 11 | + |
| 12 | +type Config struct { |
| 13 | + // Weight of priority of the flow |
| 14 | + Priority float64 |
| 15 | + // Minimum rate of the application supported by the media encoder |
| 16 | + MinimumRate BitsPerSecond // RMIN |
| 17 | + // Maximum rate of the application supported by media encoder |
| 18 | + MaximumRate BitsPerSecond // RMAX |
| 19 | + // Reference congestion level |
| 20 | + ReferenceCongestionLevel time.Duration // XREF |
| 21 | + // Scaling parameter for gradual rate update calculation |
| 22 | + κ float64 |
| 23 | + // Scaling parameter for gradual rate update calculation |
| 24 | + η float64 |
| 25 | + // Upper bound of RTT in gradual rate update calculation |
| 26 | + τ time.Duration |
| 27 | + // Target feedback interval |
| 28 | + δ time.Duration |
| 29 | + |
| 30 | + // Observation window in time for calculating packet summary statistics at receiver |
| 31 | + LogWindow time.Duration // LOGWIN |
| 32 | + // Threshold for determining queuing delay build up at receiver |
| 33 | + QueueingDelayThreshold time.Duration |
| 34 | + // Bound on filtering delay |
| 35 | + FilteringDelay time.Duration // DFILT |
| 36 | + // Upper bound on rate increase ratio for accelerated ramp-up |
| 37 | + γ_max float64 |
| 38 | + // Upper bound on self-inflicted queueing delay during ramp up |
| 39 | + QueueBound time.Duration // QBOUND |
| 40 | + |
| 41 | + // Multiplier for self-scaling the expiration threshold of the last observed loss |
| 42 | + // (loss_exp) based on measured average loss interval (loss_int) |
| 43 | + LossMultiplier float64 // MULTILOSS |
| 44 | + // Delay threshold for invoking non-linear warping |
| 45 | + DelayThreshold time.Duration // QTH |
| 46 | + // Scaling parameter in the exponent of non-linear warping |
| 47 | + λ float64 |
| 48 | + |
| 49 | + // Reference packet loss ratio |
| 50 | + ReferencePacketLossRatio float64 // PLRREF |
| 51 | + // Reference packet marking ratio |
| 52 | + ReferencePacketMarkingRatio float64 // PMRREF |
| 53 | + // Reference delay penalty for loss when lacket loss ratio is at least PLRREF |
| 54 | + ReferenceDelayLoss time.Duration // DLOSS |
| 55 | + // Reference delay penalty for ECN marking when packet marking is at PMRREF |
| 56 | + ReferenceDelayMarking time.Duration // DMARK |
| 57 | + |
| 58 | + // Frame rate of incoming video |
| 59 | + FrameRate float64 // FRAMERATE |
| 60 | + // Scaling parameter for modulating outgoing sending rate |
| 61 | + β_s float64 |
| 62 | + // Scaling parameter for modulating video encoder target rate |
| 63 | + β_v float64 |
| 64 | + // Smoothing factor in exponential smoothing of packet loss and marking rate |
| 65 | + α float64 |
| 66 | +} |
| 67 | + |
| 68 | +var DefaultConfig = Config{ |
| 69 | + Priority: 1.0, |
| 70 | + MinimumRate: 150 * Kbps, |
| 71 | + MaximumRate: 1500 * Kbps, |
| 72 | + ReferenceCongestionLevel: 10 * time.Millisecond, |
| 73 | + κ: 0.5, |
| 74 | + η: 2.0, |
| 75 | + τ: 500 * time.Millisecond, |
| 76 | + δ: 100 * time.Millisecond, |
| 77 | + |
| 78 | + LogWindow: 500 * time.Millisecond, |
| 79 | + QueueingDelayThreshold: 10 * time.Millisecond, |
| 80 | + FilteringDelay: 120 * time.Millisecond, |
| 81 | + γ_max: 0.5, |
| 82 | + QueueBound: 50 * time.Millisecond, |
| 83 | + |
| 84 | + LossMultiplier: 7.0, |
| 85 | + DelayThreshold: 50 * time.Millisecond, |
| 86 | + λ: 0.5, |
| 87 | + |
| 88 | + ReferencePacketLossRatio: 0.01, |
| 89 | + ReferencePacketMarkingRatio: 0.01, |
| 90 | + ReferenceDelayLoss: 10 * time.Millisecond, |
| 91 | + ReferenceDelayMarking: 2 * time.Millisecond, |
| 92 | + |
| 93 | + FrameRate: 30.0, |
| 94 | + β_s: 0.1, |
| 95 | + β_v: 0.1, |
| 96 | + α: 0.1, |
| 97 | +} |
0 commit comments