Commit 8ac9a286 authored by Raymond Toy's avatar Raymond Toy Committed by Commit Bot

Reland "Remove Dezippering from BiquadFilter"

This is a reland of 53b1b7da.

Original change's description:
> Remove Dezippering from BiquadFilter
> 
> Remove dezippering from all of the attributes.  The value will now 
> change immediately instead of gradually changing from the old value
> to the new value.
> 
> Chromium Feature: https://www.chromestatus.com/features/5287995770929152
> Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/YKYRrh0nWMo/aGzd3049AgAJ
> 
> Bug: 752986
> Test: BiquadFilter/dezipper.html
> Change-Id: I86840159709158fd52a69a7c3c5f279267277d44
> Reviewed-on: https://chromium-review.googlesource.com/612104
> Commit-Queue: Raymond Toy <rtoy@chromium.org>
> Reviewed-by: Hongchan Choi <hongchan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#532910}

Bug: 752986
Change-Id: Ia911c6e93d7dd7da1dea6290ac4201f81f42da3a
Reviewed-on: https://chromium-review.googlesource.com/894243Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533314}
parent f237d4c8
......@@ -52,10 +52,10 @@ void BiquadDSPKernel::UpdateCoefficientsIfNecessary(int frames_to_process) {
detune, frames_to_process);
UpdateCoefficients(frames_to_process, cutoff_frequency, q, gain, detune);
} else {
cutoff_frequency[0] = GetBiquadProcessor()->Parameter1().SmoothedValue();
q[0] = GetBiquadProcessor()->Parameter2().SmoothedValue();
gain[0] = GetBiquadProcessor()->Parameter3().SmoothedValue();
detune[0] = GetBiquadProcessor()->Parameter4().SmoothedValue();
cutoff_frequency[0] = GetBiquadProcessor()->Parameter1().Value();
q[0] = GetBiquadProcessor()->Parameter2().Value();
gain[0] = GetBiquadProcessor()->Parameter3().Value();
detune[0] = GetBiquadProcessor()->Parameter4().Value();
UpdateCoefficients(1, cutoff_frequency, q, gain, detune);
}
}
......
......@@ -80,6 +80,16 @@ void BiquadProcessor::CheckForDirtyCoefficients() {
filter_coefficients_dirty_ = true;
has_just_reset_ = false;
} else {
// TODO(crbug.com/763994): With dezippering removed, we don't want to use
// these methods. We need to implement another way of noticing if one of
// the parameters has changed. We do this as an optimization because
// computing the filter coefficients from these parameters is fairly
// expensive. NB: The calls to Smooth() don't actually cause the
// coefficients to be dezippered. This is just a way to notice that the
// coefficient values have changed. |UpdateCoefficientsIfNecessary()|
// checks to see if the filter coefficients are dirty and sets the filter
// to the new value, without smoothing.
//
// Smooth all of the filter parameters. If they haven't yet converged to
// their target value then mark coefficients as dirty.
bool is_stable1 = parameter1_->Smooth();
......
......@@ -840,7 +840,16 @@ double Biquad::TailFrame(int coef_index, double max_frame) {
DCHECK(std::isfinite(c2));
tail_frame = 1 + log(kMaxTailAmplitude / (c1 + c2)) / log(r);
DCHECK(std::isfinite(tail_frame));
if (c1 == 0 && c2 == 0) {
// If c1 = c2 = 0, then H(z) = b0. Hence, there's no tail
// because this is just a wire from input to output.
tail_frame = 0;
} else {
// Otherwise, check that the tail has finite length. Not
// strictly necessary, but we want to know if this ever
// happens.
DCHECK(std::isfinite(tail_frame));
}
}
} else {
// Repeated roots. This should be pretty rare because all the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment