subtractor_output.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_
  11. #define MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_
  12. #include <array>
  13. #include "api/array_view.h"
  14. #include "modules/audio_processing/aec3/aec3_common.h"
  15. #include "modules/audio_processing/aec3/fft_data.h"
  16. namespace webrtc {
  17. // Stores the values being returned from the echo subtractor for a single
  18. // capture channel.
  19. struct SubtractorOutput {
  20. SubtractorOutput();
  21. ~SubtractorOutput();
  22. std::array<float, kBlockSize> s_refined;
  23. std::array<float, kBlockSize> s_coarse;
  24. std::array<float, kBlockSize> e_refined;
  25. std::array<float, kBlockSize> e_coarse;
  26. FftData E_refined;
  27. std::array<float, kFftLengthBy2Plus1> E2_refined;
  28. std::array<float, kFftLengthBy2Plus1> E2_coarse;
  29. float s2_refined = 0.f;
  30. float s2_coarse = 0.f;
  31. float e2_refined = 0.f;
  32. float e2_coarse = 0.f;
  33. float y2 = 0.f;
  34. float s_refined_max_abs = 0.f;
  35. float s_coarse_max_abs = 0.f;
  36. // Reset the struct content.
  37. void Reset();
  38. // Updates the powers of the signals.
  39. void ComputeMetrics(rtc::ArrayView<const float> y);
  40. };
  41. } // namespace webrtc
  42. #endif // MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_H_