message: Optimize the AGC2 Biquad filter.
  Cr-Commit-Position: refs/heads/main@{#37278}
diff: @@ -31,17 +31,30 @@ void BiQuadFilter::Reset() {
  void BiQuadFilter::Process(rtc::ArrayView<const float> x,
  rtc::ArrayView<float> y) {
  RTC_DCHECK_EQ(x.size(), y.size());
  - for (size_t k = 0; k < x.size(); ++k) {
  + const float config_a0 = config_.a[0];
  + const float config_a1 = config_.a[1];
  + const float config_b0 = config_.b[0];
  + const float config_b1 = config_.b[1];
  + const float config_b2 = config_.b[2];
  + float state_a0 = state_.a[0];
  + float state_a1 = state_.a[1];
  + float state_b0 = state_.b[0];
  + float state_b1 = state_.b[1];
  + for (size_t k = 0, x_size = x.size(); k < x_size; ++k) {
  // Use a temporary variable for `x[k]` to allow in-place processing.
  const float tmp = x[k];
  - y[k] = config_.b[0] * tmp + config_.b[1] * state_.b[0] +
  - config_.b[2] * state_.b[1] - config_.a[0] * state_.a[0] -
  - config_.a[1] * state_.a[1];
  - state_.b[1] = state_.b[0];
  - state_.b[0] = tmp;
  - state_.a[1] = state_.a[0];
  - state_.a[0] = y[k];
  + float y_k = config_b0 * tmp + config_b1 * state_b0 + config_b2 * state_b1 -
  + config_a0 * state_a0 - config_a1 * state_a1;
  + state_b1 = state_b0;
  + state_b0 = tmp;
  + state_a1 = state_a0;
  + state_a0 = y_k;
  + y[k] = y_k;
  }
  + state_.a[0] = state_a0;
  + state_.a[1] = state_a1;
  + state_.b[0] = state_b0;
  + state_.b[1] = state_b1;
  }
  } // namespace webrtc
  