niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
stefan@webrtc.org | 8fe03af | 2012-01-23 14:56:14 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_VIDEO_CODING_MEDIA_OPT_UTIL_H_ |
| 12 | #define MODULES_VIDEO_CODING_MEDIA_OPT_UTIL_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
pbos@webrtc.org | 12dc1a3 | 2013-08-05 16:22:53 +0000 | [diff] [blame] | 14 | #include <math.h> |
| 15 | #include <stdlib.h> |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | |
kwiberg | 3f55dea | 2016-02-29 05:51:59 -0800 | [diff] [blame] | 17 | #include <memory> |
| 18 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 19 | #include "modules/video_coding/internal_defines.h" |
| 20 | #include "rtc_base/numerics/exp_filter.h" |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame^] | 21 | #include "typedefs.h" // NOLINT(build/include) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 22 | |
stefan@webrtc.org | a64300a | 2013-03-04 15:24:40 +0000 | [diff] [blame] | 23 | namespace webrtc { |
| 24 | namespace media_optimization { |
| 25 | |
marpan@google.com | 30ecda1 | 2011-09-09 17:15:12 +0000 | [diff] [blame] | 26 | // Number of time periods used for (max) window filter for packet loss |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 27 | // TODO(marpan): set reasonable window size for filtered packet loss, |
marpan@google.com | 30ecda1 | 2011-09-09 17:15:12 +0000 | [diff] [blame] | 28 | // adjustment should be based on logged/real data of loss stats/correlation. |
| 29 | enum { kLossPrHistorySize = 10 }; |
| 30 | |
| 31 | // 1000 ms, total filter length is (kLossPrHistorySize * 1000) ms |
mikhal@google.com | b29d940 | 2011-08-01 16:39:20 +0000 | [diff] [blame] | 32 | enum { kLossPrShortFilterWinMs = 1000 }; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 33 | |
marpan@webrtc.org | 2dad3fb | 2012-01-09 18:18:36 +0000 | [diff] [blame] | 34 | // The type of filter used on the received packet loss reports. |
| 35 | enum FilterPacketLossMode { |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 36 | kNoFilter, // No filtering on received loss. |
| 37 | kAvgFilter, // Recursive average filter. |
| 38 | kMaxFilter // Max-window filter, over the time interval of: |
| 39 | // (kLossPrHistorySize * kLossPrShortFilterWinMs) ms. |
marpan@webrtc.org | 2dad3fb | 2012-01-09 18:18:36 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | // Thresholds for hybrid NACK/FEC |
| 43 | // common to media optimization and the jitter buffer. |
pkasting@chromium.org | 16825b1 | 2015-01-12 21:51:21 +0000 | [diff] [blame] | 44 | const int64_t kLowRttNackMs = 20; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 45 | |
philipel | ae28408 | 2016-05-09 12:14:29 +0200 | [diff] [blame] | 46 | // If the RTT is higher than this an extra RTT wont be added to to the jitter |
| 47 | // buffer delay. |
| 48 | const int kMaxRttDelayThreshold = 500; |
| 49 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 50 | struct VCMProtectionParameters { |
| 51 | VCMProtectionParameters() |
| 52 | : rtt(0), |
| 53 | lossPr(0.0f), |
| 54 | bitRate(0.0f), |
| 55 | packetsPerFrame(0.0f), |
| 56 | packetsPerFrameKey(0.0f), |
| 57 | frameRate(0.0f), |
| 58 | keyFrameSize(0.0f), |
| 59 | fecRateDelta(0), |
| 60 | fecRateKey(0), |
| 61 | codecWidth(0), |
| 62 | codecHeight(0), |
| 63 | numLayers(1) {} |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 64 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 65 | int64_t rtt; |
| 66 | float lossPr; |
| 67 | float bitRate; |
| 68 | float packetsPerFrame; |
| 69 | float packetsPerFrameKey; |
| 70 | float frameRate; |
| 71 | float keyFrameSize; |
| 72 | uint8_t fecRateDelta; |
| 73 | uint8_t fecRateKey; |
| 74 | uint16_t codecWidth; |
| 75 | uint16_t codecHeight; |
| 76 | int numLayers; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 77 | }; |
| 78 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 79 | /******************************/ |
stefan@webrtc.org | a64300a | 2013-03-04 15:24:40 +0000 | [diff] [blame] | 80 | /* VCMProtectionMethod class */ |
| 81 | /******************************/ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 82 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 83 | enum VCMProtectionMethodEnum { kNack, kFec, kNackFec, kNone }; |
| 84 | |
| 85 | class VCMLossProbabilitySample { |
| 86 | public: |
| 87 | VCMLossProbabilitySample() : lossPr255(0), timeMs(-1) {} |
| 88 | |
| 89 | uint8_t lossPr255; |
| 90 | int64_t timeMs; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 91 | }; |
| 92 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 93 | class VCMProtectionMethod { |
| 94 | public: |
| 95 | VCMProtectionMethod(); |
| 96 | virtual ~VCMProtectionMethod(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 97 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 98 | // Updates the efficiency of the method using the parameters provided |
| 99 | // |
| 100 | // Input: |
| 101 | // - parameters : Parameters used to calculate efficiency |
| 102 | // |
| 103 | // Return value : True if this method is recommended in |
| 104 | // the given conditions. |
| 105 | virtual bool UpdateParameters(const VCMProtectionParameters* parameters) = 0; |
| 106 | |
| 107 | // Returns the protection type |
| 108 | // |
| 109 | // Return value : The protection type |
| 110 | enum VCMProtectionMethodEnum Type() const { return _type; } |
| 111 | |
| 112 | // Returns the effective packet loss for ER, required by this protection |
| 113 | // method |
| 114 | // |
| 115 | // Return value : Required effective packet loss |
| 116 | virtual uint8_t RequiredPacketLossER() { return _effectivePacketLoss; } |
| 117 | |
| 118 | // Extracts the FEC protection factor for Key frame, required by this |
| 119 | // protection method |
| 120 | // |
| 121 | // Return value : Required protectionFactor for Key frame |
| 122 | virtual uint8_t RequiredProtectionFactorK() { return _protectionFactorK; } |
| 123 | |
| 124 | // Extracts the FEC protection factor for Delta frame, required by this |
| 125 | // protection method |
| 126 | // |
| 127 | // Return value : Required protectionFactor for delta frame |
| 128 | virtual uint8_t RequiredProtectionFactorD() { return _protectionFactorD; } |
| 129 | |
| 130 | // Extracts whether the FEC Unequal protection (UEP) is used for Key frame. |
| 131 | // |
| 132 | // Return value : Required Unequal protection on/off state. |
| 133 | virtual bool RequiredUepProtectionK() { return _useUepProtectionK; } |
| 134 | |
| 135 | // Extracts whether the the FEC Unequal protection (UEP) is used for Delta |
| 136 | // frame. |
| 137 | // |
| 138 | // Return value : Required Unequal protection on/off state. |
| 139 | virtual bool RequiredUepProtectionD() { return _useUepProtectionD; } |
| 140 | |
| 141 | virtual int MaxFramesFec() const { return 1; } |
| 142 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 143 | protected: |
| 144 | uint8_t _effectivePacketLoss; |
| 145 | uint8_t _protectionFactorK; |
| 146 | uint8_t _protectionFactorD; |
| 147 | // Estimation of residual loss after the FEC |
| 148 | float _scaleProtKey; |
| 149 | int32_t _maxPayloadSize; |
| 150 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 151 | bool _useUepProtectionK; |
| 152 | bool _useUepProtectionD; |
| 153 | float _corrFecCost; |
| 154 | enum VCMProtectionMethodEnum _type; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 155 | }; |
| 156 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 157 | class VCMNackMethod : public VCMProtectionMethod { |
| 158 | public: |
| 159 | VCMNackMethod(); |
| 160 | virtual ~VCMNackMethod(); |
| 161 | virtual bool UpdateParameters(const VCMProtectionParameters* parameters); |
| 162 | // Get the effective packet loss |
| 163 | bool EffectivePacketLoss(const VCMProtectionParameters* parameter); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 164 | }; |
| 165 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 166 | class VCMFecMethod : public VCMProtectionMethod { |
| 167 | public: |
| 168 | VCMFecMethod(); |
| 169 | virtual ~VCMFecMethod(); |
| 170 | virtual bool UpdateParameters(const VCMProtectionParameters* parameters); |
| 171 | // Get the effective packet loss for ER |
| 172 | bool EffectivePacketLoss(const VCMProtectionParameters* parameters); |
| 173 | // Get the FEC protection factors |
| 174 | bool ProtectionFactor(const VCMProtectionParameters* parameters); |
| 175 | // Get the boost for key frame protection |
| 176 | uint8_t BoostCodeRateKey(uint8_t packetFrameDelta, |
| 177 | uint8_t packetFrameKey) const; |
| 178 | // Convert the rates: defined relative to total# packets or source# packets |
| 179 | uint8_t ConvertFECRate(uint8_t codeRate) const; |
| 180 | // Get the average effective recovery from FEC: for random loss model |
| 181 | float AvgRecoveryFEC(const VCMProtectionParameters* parameters) const; |
| 182 | // Update FEC with protectionFactorD |
| 183 | void UpdateProtectionFactorD(uint8_t protectionFactorD); |
| 184 | // Update FEC with protectionFactorK |
| 185 | void UpdateProtectionFactorK(uint8_t protectionFactorK); |
| 186 | // Compute the bits per frame. Account for temporal layers when applicable. |
| 187 | int BitsPerFrame(const VCMProtectionParameters* parameters); |
| 188 | |
| 189 | protected: |
| 190 | enum { kUpperLimitFramesFec = 6 }; |
| 191 | // Thresholds values for the bytes/frame and round trip time, below which we |
| 192 | // may turn off FEC, depending on |_numLayers| and |_maxFramesFec|. |
| 193 | // Max bytes/frame for VGA, corresponds to ~140k at 25fps. |
| 194 | enum { kMaxBytesPerFrameForFec = 700 }; |
| 195 | // Max bytes/frame for CIF and lower: corresponds to ~80k at 25fps. |
| 196 | enum { kMaxBytesPerFrameForFecLow = 400 }; |
| 197 | // Max bytes/frame for frame size larger than VGA, ~200k at 25fps. |
| 198 | enum { kMaxBytesPerFrameForFecHigh = 1000 }; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 199 | }; |
| 200 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 201 | class VCMNackFecMethod : public VCMFecMethod { |
| 202 | public: |
| 203 | VCMNackFecMethod(int64_t lowRttNackThresholdMs, |
| 204 | int64_t highRttNackThresholdMs); |
| 205 | virtual ~VCMNackFecMethod(); |
| 206 | virtual bool UpdateParameters(const VCMProtectionParameters* parameters); |
| 207 | // Get the effective packet loss for ER |
| 208 | bool EffectivePacketLoss(const VCMProtectionParameters* parameters); |
| 209 | // Get the protection factors |
| 210 | bool ProtectionFactor(const VCMProtectionParameters* parameters); |
| 211 | // Get the max number of frames the FEC is allowed to be based on. |
| 212 | int MaxFramesFec() const; |
| 213 | // Turn off the FEC based on low bitrate and other factors. |
| 214 | bool BitRateTooLowForFec(const VCMProtectionParameters* parameters); |
stefan@webrtc.org | c35f5ce | 2012-04-11 07:42:25 +0000 | [diff] [blame] | 215 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 216 | private: |
| 217 | int ComputeMaxFramesFec(const VCMProtectionParameters* parameters); |
| 218 | |
| 219 | int64_t _lowRttNackMs; |
| 220 | int64_t _highRttNackMs; |
| 221 | int _maxFramesFec; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 222 | }; |
| 223 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 224 | class VCMLossProtectionLogic { |
| 225 | public: |
| 226 | explicit VCMLossProtectionLogic(int64_t nowMs); |
| 227 | ~VCMLossProtectionLogic(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 228 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 229 | // Set the protection method to be used |
| 230 | // |
| 231 | // Input: |
| 232 | // - newMethodType : New requested protection method type. If one |
| 233 | // is already set, it will be deleted and replaced |
| 234 | void SetMethod(VCMProtectionMethodEnum newMethodType); |
stefan@webrtc.org | c35f5ce | 2012-04-11 07:42:25 +0000 | [diff] [blame] | 235 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 236 | // Update the round-trip time |
| 237 | // |
| 238 | // Input: |
| 239 | // - rtt : Round-trip time in seconds. |
| 240 | void UpdateRtt(int64_t rtt); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 241 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 242 | // Update the filtered packet loss. |
| 243 | // |
| 244 | // Input: |
| 245 | // - packetLossEnc : The reported packet loss filtered |
| 246 | // (max window or average) |
| 247 | void UpdateFilteredLossPr(uint8_t packetLossEnc); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 248 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 249 | // Update the current target bit rate. |
| 250 | // |
| 251 | // Input: |
| 252 | // - bitRate : The current target bit rate in kbits/s |
| 253 | void UpdateBitRate(float bitRate); |
mikhal@webrtc.org | a057a95 | 2011-08-26 21:17:34 +0000 | [diff] [blame] | 254 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 255 | // Update the number of packets per frame estimate, for delta frames |
| 256 | // |
| 257 | // Input: |
| 258 | // - nPackets : Number of packets in the latest sent frame. |
| 259 | void UpdatePacketsPerFrame(float nPackets, int64_t nowMs); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 260 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 261 | // Update the number of packets per frame estimate, for key frames |
| 262 | // |
| 263 | // Input: |
| 264 | // - nPackets : umber of packets in the latest sent frame. |
| 265 | void UpdatePacketsPerFrameKey(float nPackets, int64_t nowMs); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 266 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 267 | // Update the keyFrameSize estimate |
| 268 | // |
| 269 | // Input: |
| 270 | // - keyFrameSize : The size of the latest sent key frame. |
| 271 | void UpdateKeyFrameSize(float keyFrameSize); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 272 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 273 | // Update the frame rate |
| 274 | // |
| 275 | // Input: |
| 276 | // - frameRate : The current target frame rate. |
| 277 | void UpdateFrameRate(float frameRate) { _frameRate = frameRate; } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 278 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 279 | // Update the frame size |
| 280 | // |
| 281 | // Input: |
| 282 | // - width : The codec frame width. |
| 283 | // - height : The codec frame height. |
perkj | c2c24f7 | 2016-07-11 01:47:32 -0700 | [diff] [blame] | 284 | void UpdateFrameSize(size_t width, size_t height); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 285 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 286 | // Update the number of active layers |
| 287 | // |
| 288 | // Input: |
| 289 | // - numLayers : Number of layers used. |
| 290 | void UpdateNumLayers(int numLayers); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 291 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 292 | // The amount of packet loss to cover for with FEC. |
| 293 | // |
| 294 | // Input: |
| 295 | // - fecRateKey : Packet loss to cover for with FEC when |
| 296 | // sending key frames. |
| 297 | // - fecRateDelta : Packet loss to cover for with FEC when |
| 298 | // sending delta frames. |
| 299 | void UpdateFECRates(uint8_t fecRateKey, uint8_t fecRateDelta) { |
| 300 | _fecRateKey = fecRateKey; |
| 301 | _fecRateDelta = fecRateDelta; |
| 302 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 303 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 304 | // Update the protection methods with the current VCMProtectionParameters |
| 305 | // and set the requested protection settings. |
| 306 | // Return value : Returns true on update |
| 307 | bool UpdateMethod(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 308 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 309 | // Returns the method currently selected. |
| 310 | // |
| 311 | // Return value : The protection method currently selected. |
| 312 | VCMProtectionMethod* SelectedMethod() const; |
mikhal@webrtc.org | 0e7d9d8 | 2011-12-19 19:04:49 +0000 | [diff] [blame] | 313 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 314 | // Return the protection type of the currently selected method |
| 315 | VCMProtectionMethodEnum SelectedType() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 316 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 317 | // Updates the filtered loss for the average and max window packet loss, |
| 318 | // and returns the filtered loss probability in the interval [0, 255]. |
| 319 | // The returned filtered loss value depends on the parameter |filter_mode|. |
| 320 | // The input parameter |lossPr255| is the received packet loss. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 321 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 322 | // Return value : The filtered loss probability |
| 323 | uint8_t FilteredLoss(int64_t nowMs, |
| 324 | FilterPacketLossMode filter_mode, |
| 325 | uint8_t lossPr255); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 326 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 327 | void Reset(int64_t nowMs); |
mikhal@webrtc.org | a057a95 | 2011-08-26 21:17:34 +0000 | [diff] [blame] | 328 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 329 | void Release(); |
marpan@webrtc.org | 2dad3fb | 2012-01-09 18:18:36 +0000 | [diff] [blame] | 330 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 331 | private: |
| 332 | // Sets the available loss protection methods. |
| 333 | void UpdateMaxLossHistory(uint8_t lossPr255, int64_t now); |
| 334 | uint8_t MaxFilteredLossPr(int64_t nowMs) const; |
kwiberg | 3f55dea | 2016-02-29 05:51:59 -0800 | [diff] [blame] | 335 | std::unique_ptr<VCMProtectionMethod> _selectedMethod; |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 336 | VCMProtectionParameters _currentParameters; |
| 337 | int64_t _rtt; |
| 338 | float _lossPr; |
| 339 | float _bitRate; |
| 340 | float _frameRate; |
| 341 | float _keyFrameSize; |
| 342 | uint8_t _fecRateKey; |
| 343 | uint8_t _fecRateDelta; |
| 344 | int64_t _lastPrUpdateT; |
| 345 | int64_t _lastPacketPerFrameUpdateT; |
| 346 | int64_t _lastPacketPerFrameUpdateTKey; |
| 347 | rtc::ExpFilter _lossPr255; |
| 348 | VCMLossProbabilitySample _lossPrHistory[kLossPrHistorySize]; |
| 349 | uint8_t _shortMaxLossPr255; |
| 350 | rtc::ExpFilter _packetsPerFrame; |
| 351 | rtc::ExpFilter _packetsPerFrameKey; |
perkj | c2c24f7 | 2016-07-11 01:47:32 -0700 | [diff] [blame] | 352 | size_t _codecWidth; |
| 353 | size_t _codecHeight; |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 354 | int _numLayers; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 355 | }; |
| 356 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 357 | } // namespace media_optimization |
| 358 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 359 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 360 | #endif // MODULES_VIDEO_CODING_MEDIA_OPT_UTIL_H_ |