Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: webrtc/modules/audio_processing/include/audio_processing.h

Issue 2469783002: Update default values for APM stats to match old behavior. (Closed)
Patch Set: Only set stats when getting metrics is succesful. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 float minimum() const { return minimum_; } 501 float minimum() const { return minimum_; }
502 502
503 private: 503 private:
504 float instant_ = 0.0f; // Instantaneous value. 504 float instant_ = 0.0f; // Instantaneous value.
505 float average_ = 0.0f; // Long-term average. 505 float average_ = 0.0f; // Long-term average.
506 float maximum_ = 0.0f; // Long-term maximum. 506 float maximum_ = 0.0f; // Long-term maximum.
507 float minimum_ = 0.0f; // Long-term minimum. 507 float minimum_ = 0.0f; // Long-term minimum.
508 }; 508 };
509 509
510 struct AudioProcessingStatistics { 510 struct AudioProcessingStatistics {
511 AudioProcessingStatistics() {
512 residual_echo_return_loss.Set(-100.0f, -100.0f, -100.0f, -100.0f);
513 echo_return_loss.Set(-100.0f, -100.0f, -100.0f, -100.0f);
514 echo_return_loss_enhancement.Set(-100.0f, -100.0f, -100.0f, -100.0f);
515 a_nlp.Set(-100.0f, -100.0f, -100.0f, -100.0f);
516 }
517
511 // AEC Statistics. 518 // AEC Statistics.
512 // RERL = ERL + ERLE 519 // RERL = ERL + ERLE
513 Stat residual_echo_return_loss; 520 Stat residual_echo_return_loss;
514 // ERL = 10log_10(P_far / P_echo) 521 // ERL = 10log_10(P_far / P_echo)
515 Stat echo_return_loss; 522 Stat echo_return_loss;
516 // ERLE = 10log_10(P_echo / P_out) 523 // ERLE = 10log_10(P_echo / P_out)
517 Stat echo_return_loss_enhancement; 524 Stat echo_return_loss_enhancement;
518 // (Pre non-linear processing suppression) A_NLP = 10log_10(P_echo / P_a) 525 // (Pre non-linear processing suppression) A_NLP = 10log_10(P_echo / P_a)
519 Stat a_nlp; 526 Stat a_nlp;
520 // Fraction of time that the AEC linear filter is divergent, in a 1-second 527 // Fraction of time that the AEC linear filter is divergent, in a 1-second
521 // non-overlapped aggregation window. 528 // non-overlapped aggregation window.
522 float divergent_filter_fraction = 0.0f; 529 float divergent_filter_fraction = -1.0f;
523 530
524 // The delay metrics consists of the delay median and standard deviation. It 531 // The delay metrics consists of the delay median and standard deviation. It
525 // also consists of the fraction of delay estimates that can make the echo 532 // also consists of the fraction of delay estimates that can make the echo
526 // cancellation perform poorly. The values are aggregated until the first 533 // cancellation perform poorly. The values are aggregated until the first
527 // call to |GetStatistics()| and afterwards aggregated and updated every 534 // call to |GetStatistics()| and afterwards aggregated and updated every
528 // second. Note that if there are several clients pulling metrics from 535 // second. Note that if there are several clients pulling metrics from
529 // |GetStatistics()| during a session the first call from any of them will 536 // |GetStatistics()| during a session the first call from any of them will
530 // change to one second aggregation window for all. 537 // change to one second aggregation window for all.
531 int delay_median = 0; 538 int delay_median = -1;
532 int delay_standard_deviation = 0; 539 int delay_standard_deviation = -1;
533 float fraction_poor_delays = 0.0f; 540 float fraction_poor_delays = -1.0f;
534 541
535 // Residual echo detector likelihood. This value is not yet calculated and 542 // Residual echo detector likelihood. This value is not yet calculated and
536 // is currently always set to zero. 543 // is currently always set to zero.
537 // TODO(ivoc): Implement this stat. 544 // TODO(ivoc): Implement this stat.
538 float residual_echo_likelihood = 0.0f; 545 float residual_echo_likelihood = -1.0f;
539 }; 546 };
540 547
541 // TODO(ivoc): Make this pure virtual when all subclasses have been updated. 548 // TODO(ivoc): Make this pure virtual when all subclasses have been updated.
542 virtual AudioProcessingStatistics GetStatistics() const; 549 virtual AudioProcessingStatistics GetStatistics() const;
543 550
544 // These provide access to the component interfaces and should never return 551 // These provide access to the component interfaces and should never return
545 // NULL. The pointers will be valid for the lifetime of the APM instance. 552 // NULL. The pointers will be valid for the lifetime of the APM instance.
546 // The memory for these objects is entirely managed internally. 553 // The memory for these objects is entirely managed internally.
547 virtual EchoCancellation* echo_cancellation() const = 0; 554 virtual EchoCancellation* echo_cancellation() const = 0;
548 virtual EchoControlMobile* echo_control_mobile() const = 0; 555 virtual EchoControlMobile* echo_control_mobile() const = 0;
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 // This does not impact the size of frames passed to |ProcessStream()|. 1072 // This does not impact the size of frames passed to |ProcessStream()|.
1066 virtual int set_frame_size_ms(int size) = 0; 1073 virtual int set_frame_size_ms(int size) = 0;
1067 virtual int frame_size_ms() const = 0; 1074 virtual int frame_size_ms() const = 0;
1068 1075
1069 protected: 1076 protected:
1070 virtual ~VoiceDetection() {} 1077 virtual ~VoiceDetection() {}
1071 }; 1078 };
1072 } // namespace webrtc 1079 } // namespace webrtc
1073 1080
1074 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ 1081 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698