зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1265408 - Avoid subnormals in IIRFilter; r=karlt
MozReview-Commit-ID: F4NUE8834tM --HG-- extra : rebase_source : 1a5d118f7aed0f4803bc83feda482f940218d65d extra : source : 784521a9cc94ad399d1405ada007f06d255c6c29
This commit is contained in:
Родитель
db283dba06
Коммит
b2e65a7924
|
@ -76,6 +76,7 @@ void Biquad::process(const float* sourceP, float* destP, size_t framesToProcess)
|
|||
|
||||
// Avoid introducing a stream of subnormals when input is silent and the
|
||||
// tail approaches zero.
|
||||
// TODO: Remove this code when Bug 1157635 is fixed.
|
||||
if (x1 == 0.0 && x2 == 0.0 && (y1 != 0.0 || y2 != 0.0) &&
|
||||
fabs(y1) < FLT_MIN && fabs(y2) < FLT_MIN) {
|
||||
// Flush future values to zero (until there is new input).
|
||||
|
|
|
@ -98,7 +98,13 @@ void IIRFilter::process(const float* sourceP, float* destP, size_t framesToProce
|
|||
|
||||
m_bufferIndex = (m_bufferIndex + 1) & (kBufferLength - 1);
|
||||
|
||||
destP[n] = yn;
|
||||
// Avoid introducing a stream of subnormals
|
||||
// TODO: Remove this code when Bug 1157635 is fixed.
|
||||
if (fabs(yn) >= FLT_MIN) {
|
||||
destP[n] = yn;
|
||||
} else {
|
||||
destP[n] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче