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

Side by Side Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h

Issue 1821443003: Fix normalization of noise estimate in NoiseSuppressor (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void UpdateErbGains(); 64 void UpdateErbGains();
65 65
66 // Returns number of ERB filters. 66 // Returns number of ERB filters.
67 static size_t GetBankSize(int sample_rate, size_t erb_resolution); 67 static size_t GetBankSize(int sample_rate, size_t erb_resolution);
68 68
69 // Initializes ERB filterbank. 69 // Initializes ERB filterbank.
70 std::vector<std::vector<float>> CreateErbBank(size_t num_freqs); 70 std::vector<std::vector<float>> CreateErbBank(size_t num_freqs);
71 71
72 // Analytically solves quadratic for optimal gains given |lambda|. 72 // Analytically solves quadratic for optimal gains given |lambda|.
73 // Negative gains are set to 0. Stores the results in |sols|. 73 // Negative gains are set to 0. Stores the results in |sols|.
74 void SolveForGainsGivenLambda(float lambda, size_t start_freq, float* sols); 74 void SolveForGainsGivenLambda(double lambda, size_t start_freq, float* sols);
75 75
76 // Returns true if the audio is speech. 76 // Returns true if the audio is speech.
77 bool IsSpeech(const float* audio); 77 bool IsSpeech(const float* audio);
78 78
79 static const size_t kMaxNumNoiseEstimatesToBuffer = 5; 79 static const size_t kMaxNumNoiseEstimatesToBuffer = 5;
80 80
81 const size_t freqs_; // Num frequencies in frequency domain. 81 const size_t freqs_; // Num frequencies in frequency domain.
82 const size_t num_noise_bins_; 82 const size_t num_noise_bins_;
83 const size_t chunk_length_; // Chunk size in samples. 83 const size_t chunk_length_; // Chunk size in samples.
84 const size_t bank_size_; // Num ERB filters. 84 const size_t bank_size_; // Num ERB filters.
(...skipping 20 matching lines...) Expand all
105 bool is_speech_; 105 bool is_speech_;
106 106
107 std::vector<float> noise_estimation_buffer_; 107 std::vector<float> noise_estimation_buffer_;
108 SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>> 108 SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>
109 noise_estimation_queue_; 109 noise_estimation_queue_;
110 }; 110 };
111 111
112 } // namespace webrtc 112 } // namespace webrtc
113 113
114 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN CER_H_ 114 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN CER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698