OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 float minimum() const { return minimum_; } | 507 float minimum() const { return minimum_; } |
508 | 508 |
509 private: | 509 private: |
510 float instant_ = 0.0f; // Instantaneous value. | 510 float instant_ = 0.0f; // Instantaneous value. |
511 float average_ = 0.0f; // Long-term average. | 511 float average_ = 0.0f; // Long-term average. |
512 float maximum_ = 0.0f; // Long-term maximum. | 512 float maximum_ = 0.0f; // Long-term maximum. |
513 float minimum_ = 0.0f; // Long-term minimum. | 513 float minimum_ = 0.0f; // Long-term minimum. |
514 }; | 514 }; |
515 | 515 |
516 struct AudioProcessingStatistics { | 516 struct AudioProcessingStatistics { |
517 AudioProcessingStatistics() { | 517 AudioProcessingStatistics(); |
518 residual_echo_return_loss.Set(-100.0f, -100.0f, -100.0f, -100.0f); | 518 AudioProcessingStatistics(const AudioProcessingStatistics& other); |
519 echo_return_loss.Set(-100.0f, -100.0f, -100.0f, -100.0f); | 519 ~AudioProcessingStatistics(); |
520 echo_return_loss_enhancement.Set(-100.0f, -100.0f, -100.0f, -100.0f); | |
521 a_nlp.Set(-100.0f, -100.0f, -100.0f, -100.0f); | |
522 } | |
523 | 520 |
524 // AEC Statistics. | 521 // AEC Statistics. |
525 // RERL = ERL + ERLE | 522 // RERL = ERL + ERLE |
526 Stat residual_echo_return_loss; | 523 Stat residual_echo_return_loss; |
527 // ERL = 10log_10(P_far / P_echo) | 524 // ERL = 10log_10(P_far / P_echo) |
528 Stat echo_return_loss; | 525 Stat echo_return_loss; |
529 // ERLE = 10log_10(P_echo / P_out) | 526 // ERLE = 10log_10(P_echo / P_out) |
530 Stat echo_return_loss_enhancement; | 527 Stat echo_return_loss_enhancement; |
531 // (Pre non-linear processing suppression) A_NLP = 10log_10(P_echo / P_a) | 528 // (Pre non-linear processing suppression) A_NLP = 10log_10(P_echo / P_a) |
532 Stat a_nlp; | 529 Stat a_nlp; |
533 // Fraction of time that the AEC linear filter is divergent, in a 1-second | 530 // Fraction of time that the AEC linear filter is divergent, in a 1-second |
534 // non-overlapped aggregation window. | 531 // non-overlapped aggregation window. |
535 float divergent_filter_fraction = -1.0f; | 532 float divergent_filter_fraction = -1.0f; |
536 | 533 |
537 // The delay metrics consists of the delay median and standard deviation. It | 534 // The delay metrics consists of the delay median and standard deviation. It |
538 // also consists of the fraction of delay estimates that can make the echo | 535 // also consists of the fraction of delay estimates that can make the echo |
539 // cancellation perform poorly. The values are aggregated until the first | 536 // cancellation perform poorly. The values are aggregated until the first |
540 // call to |GetStatistics()| and afterwards aggregated and updated every | 537 // call to |GetStatistics()| and afterwards aggregated and updated every |
541 // second. Note that if there are several clients pulling metrics from | 538 // second. Note that if there are several clients pulling metrics from |
542 // |GetStatistics()| during a session the first call from any of them will | 539 // |GetStatistics()| during a session the first call from any of them will |
543 // change to one second aggregation window for all. | 540 // change to one second aggregation window for all. |
544 int delay_median = -1; | 541 int delay_median = -1; |
545 int delay_standard_deviation = -1; | 542 int delay_standard_deviation = -1; |
546 float fraction_poor_delays = -1.0f; | 543 float fraction_poor_delays = -1.0f; |
547 | 544 |
548 // Residual echo detector likelihood. This value is not yet calculated and | 545 // Residual echo detector likelihood. |
549 // is currently always set to zero. | |
550 // TODO(ivoc): Implement this stat. | |
551 float residual_echo_likelihood = -1.0f; | 546 float residual_echo_likelihood = -1.0f; |
| 547 // Maximum residual echo likelihood from the last time period. |
| 548 float residual_echo_likelihood_recent_max = -1.0f; |
552 }; | 549 }; |
553 | 550 |
554 // TODO(ivoc): Make this pure virtual when all subclasses have been updated. | 551 // TODO(ivoc): Make this pure virtual when all subclasses have been updated. |
555 virtual AudioProcessingStatistics GetStatistics() const; | 552 virtual AudioProcessingStatistics GetStatistics() const; |
556 | 553 |
557 // These provide access to the component interfaces and should never return | 554 // These provide access to the component interfaces and should never return |
558 // NULL. The pointers will be valid for the lifetime of the APM instance. | 555 // NULL. The pointers will be valid for the lifetime of the APM instance. |
559 // The memory for these objects is entirely managed internally. | 556 // The memory for these objects is entirely managed internally. |
560 virtual EchoCancellation* echo_cancellation() const = 0; | 557 virtual EchoCancellation* echo_cancellation() const = 0; |
561 virtual EchoControlMobile* echo_control_mobile() const = 0; | 558 virtual EchoControlMobile* echo_control_mobile() const = 0; |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 // This does not impact the size of frames passed to |ProcessStream()|. | 1075 // This does not impact the size of frames passed to |ProcessStream()|. |
1079 virtual int set_frame_size_ms(int size) = 0; | 1076 virtual int set_frame_size_ms(int size) = 0; |
1080 virtual int frame_size_ms() const = 0; | 1077 virtual int frame_size_ms() const = 0; |
1081 | 1078 |
1082 protected: | 1079 protected: |
1083 virtual ~VoiceDetection() {} | 1080 virtual ~VoiceDetection() {} |
1084 }; | 1081 }; |
1085 } // namespace webrtc | 1082 } // namespace webrtc |
1086 | 1083 |
1087 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 1084 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
OLD | NEW |