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

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

Issue 1718793002: Fix the gain calculation in IntelligibilityEnhancer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@vad
Patch Set: Created 4 years, 10 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 friend class TransformCallback; 60 friend class TransformCallback;
61 FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestErbCreation); 61 FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestErbCreation);
62 FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestSolveForGains); 62 FRIEND_TEST_ALL_PREFIXES(IntelligibilityEnhancerTest, TestSolveForGains);
63 63
64 // Updates power computation and analysis with |in_block_|, 64 // Updates power computation and analysis with |in_block_|,
65 // and writes modified speech to |out_block|. 65 // and writes modified speech to |out_block|.
66 void ProcessClearBlock(const std::complex<float>* in_block, 66 void ProcessClearBlock(const std::complex<float>* in_block,
67 std::complex<float>* out_block); 67 std::complex<float>* out_block);
68 68
69 // Bisection search for optimal |lambda|. 69 // Bisection search for optimal |lambda|.
70 void SolveForLambda(float power_target, float power_bot, float power_top); 70 void SolveForLambda(float power_target);
71 71
72 // Transforms freq gains to ERB gains. 72 // Transforms freq gains to ERB gains.
73 void UpdateErbGains(); 73 void UpdateErbGains();
74 74
75 // Returns number of ERB filters. 75 // Returns number of ERB filters.
76 static size_t GetBankSize(int sample_rate, size_t erb_resolution); 76 static size_t GetBankSize(int sample_rate, size_t erb_resolution);
77 77
78 // Initializes ERB filterbank. 78 // Initializes ERB filterbank.
79 std::vector<std::vector<float>> CreateErbBank(size_t num_freqs); 79 std::vector<std::vector<float>> CreateErbBank(size_t num_freqs);
80 80
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 VoiceActivityDetector vad_; 113 VoiceActivityDetector vad_;
114 std::vector<int16_t> audio_s16_; 114 std::vector<int16_t> audio_s16_;
115 size_t chunks_since_voice_; 115 size_t chunks_since_voice_;
116 bool is_speech_; 116 bool is_speech_;
117 }; 117 };
118 118
119 } // namespace webrtc 119 } // namespace webrtc
120 120
121 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN CER_H_ 121 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHAN CER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698