Bug 807492 Part 12 - Rename _P to _pp in timestamp_extrapolator, it's a #define in ctype.h on OpenBSD, and the C99/C++ standard forbids identifiers starting with an underscode followed by a capital. r=jesup

This commit is contained in:
Landry Breuil 2013-08-14 00:00:07 +02:00
Родитель 2c947d6cb1
Коммит e5911a1739
2 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -62,9 +62,9 @@ VCMTimestampExtrapolator::Reset(const int64_t nowMs /* = -1 */)
_firstTimestamp = 0; _firstTimestamp = 0;
_w[0] = 90.0; _w[0] = 90.0;
_w[1] = 0; _w[1] = 0;
_P[0][0] = 1; _pp[0][0] = 1;
_P[1][1] = _P11; _pp[1][1] = _P11;
_P[0][1] = _P[1][0] = 0; _pp[0][1] = _pp[1][0] = 0;
_firstAfterReset = true; _firstAfterReset = true;
_prevTs90khz = 0; _prevTs90khz = 0;
_wrapArounds = 0; _wrapArounds = 0;
@ -124,14 +124,14 @@ VCMTimestampExtrapolator::Update(int64_t tMs, uint32_t ts90khz, bool trace)
// A sudden change of average network delay has been detected. // A sudden change of average network delay has been detected.
// Force the filter to adjust its offset parameter by changing // Force the filter to adjust its offset parameter by changing
// the offset uncertainty. Don't do this during startup. // the offset uncertainty. Don't do this during startup.
_P[1][1] = _P11; _pp[1][1] = _P11;
} }
//T = [t(k) 1]'; //T = [t(k) 1]';
//that = T'*w; //that = T'*w;
//K = P*T/(lambda + T'*P*T); //K = P*T/(lambda + T'*P*T);
double K[2]; double K[2];
K[0] = _P[0][0] * tMs + _P[0][1]; K[0] = _pp[0][0] * tMs + _pp[0][1];
K[1] = _P[1][0] * tMs + _P[1][1]; K[1] = _pp[1][0] * tMs + _pp[1][1];
double TPT = _lambda + tMs * K[0] + K[1]; double TPT = _lambda + tMs * K[0] + K[1];
K[0] /= TPT; K[0] /= TPT;
K[1] /= TPT; K[1] /= TPT;
@ -139,12 +139,12 @@ VCMTimestampExtrapolator::Update(int64_t tMs, uint32_t ts90khz, bool trace)
_w[0] = _w[0] + K[0] * residual; _w[0] = _w[0] + K[0] * residual;
_w[1] = _w[1] + K[1] * residual; _w[1] = _w[1] + K[1] * residual;
//P = 1/lambda*(P - K*T'*P); //P = 1/lambda*(P - K*T'*P);
double p00 = 1 / _lambda * (_P[0][0] - (K[0] * tMs * _P[0][0] + K[0] * _P[1][0])); double p00 = 1 / _lambda * (_pp[0][0] - (K[0] * tMs * _pp[0][0] + K[0] * _pp[1][0]));
double p01 = 1 / _lambda * (_P[0][1] - (K[0] * tMs * _P[0][1] + K[0] * _P[1][1])); double p01 = 1 / _lambda * (_pp[0][1] - (K[0] * tMs * _pp[0][1] + K[0] * _pp[1][1]));
_P[1][0] = 1 / _lambda * (_P[1][0] - (K[1] * tMs * _P[0][0] + K[1] * _P[1][0])); _pp[1][0] = 1 / _lambda * (_pp[1][0] - (K[1] * tMs * _pp[0][0] + K[1] * _pp[1][0]));
_P[1][1] = 1 / _lambda * (_P[1][1] - (K[1] * tMs * _P[0][1] + K[1] * _P[1][1])); _pp[1][1] = 1 / _lambda * (_pp[1][1] - (K[1] * tMs * _pp[0][1] + K[1] * _pp[1][1]));
_P[0][0] = p00; _pp[0][0] = p00;
_P[0][1] = p01; _pp[0][1] = p01;
if (_packetCount < _startUpFilterDelayInPackets) if (_packetCount < _startUpFilterDelayInPackets)
{ {
_packetCount++; _packetCount++;

Просмотреть файл

@ -39,7 +39,7 @@ private:
int32_t _id; int32_t _id;
Clock* _clock; Clock* _clock;
double _w[2]; double _w[2];
double _P[2][2]; double _pp[2][2];
int64_t _startMs; int64_t _startMs;
int64_t _prevMs; int64_t _prevMs;
uint32_t _firstTimestamp; uint32_t _firstTimestamp;