Commit 53b1b7da authored by Raymond Toy's avatar Raymond Toy Committed by Commit Bot

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: default avatarHongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532910}
parent efc10255
...@@ -52,10 +52,10 @@ void BiquadDSPKernel::UpdateCoefficientsIfNecessary(int frames_to_process) { ...@@ -52,10 +52,10 @@ void BiquadDSPKernel::UpdateCoefficientsIfNecessary(int frames_to_process) {
detune, frames_to_process); detune, frames_to_process);
UpdateCoefficients(frames_to_process, cutoff_frequency, q, gain, detune); UpdateCoefficients(frames_to_process, cutoff_frequency, q, gain, detune);
} else { } else {
cutoff_frequency[0] = GetBiquadProcessor()->Parameter1().SmoothedValue(); cutoff_frequency[0] = GetBiquadProcessor()->Parameter1().Value();
q[0] = GetBiquadProcessor()->Parameter2().SmoothedValue(); q[0] = GetBiquadProcessor()->Parameter2().Value();
gain[0] = GetBiquadProcessor()->Parameter3().SmoothedValue(); gain[0] = GetBiquadProcessor()->Parameter3().Value();
detune[0] = GetBiquadProcessor()->Parameter4().SmoothedValue(); detune[0] = GetBiquadProcessor()->Parameter4().Value();
UpdateCoefficients(1, cutoff_frequency, q, gain, detune); UpdateCoefficients(1, cutoff_frequency, q, gain, detune);
} }
} }
......
...@@ -80,6 +80,16 @@ void BiquadProcessor::CheckForDirtyCoefficients() { ...@@ -80,6 +80,16 @@ void BiquadProcessor::CheckForDirtyCoefficients() {
filter_coefficients_dirty_ = true; filter_coefficients_dirty_ = true;
has_just_reset_ = false; has_just_reset_ = false;
} else { } 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 // Smooth all of the filter parameters. If they haven't yet converged to
// their target value then mark coefficients as dirty. // their target value then mark coefficients as dirty.
bool is_stable1 = parameter1_->Smooth(); bool is_stable1 = parameter1_->Smooth();
......
...@@ -840,8 +840,17 @@ double Biquad::TailFrame(int coef_index, double max_frame) { ...@@ -840,8 +840,17 @@ double Biquad::TailFrame(int coef_index, double max_frame) {
DCHECK(std::isfinite(c2)); DCHECK(std::isfinite(c2));
tail_frame = 1 + log(kMaxTailAmplitude / (c1 + c2)) / log(r); tail_frame = 1 + log(kMaxTailAmplitude / (c1 + c2)) / log(r);
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)); DCHECK(std::isfinite(tail_frame));
} }
}
} else { } else {
// Repeated roots. This should be pretty rare because all the // Repeated roots. This should be pretty rare because all the
// coefficients need to be just the right values to get a // coefficients need to be just the right values to get a
......
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