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/test/audio_processing_simulator.h

Issue 2834643002: audioproc_f with simulated mic analog gain (Closed)
Patch Set: set_stream_analog_level and stream_analog_level moved into parent class AudioProcessingSimulator Created 3 years, 8 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 rtc::Optional<bool> use_experimental_agc; 67 rtc::Optional<bool> use_experimental_agc;
68 rtc::Optional<int> aecm_routing_mode; 68 rtc::Optional<int> aecm_routing_mode;
69 rtc::Optional<bool> use_aecm_comfort_noise; 69 rtc::Optional<bool> use_aecm_comfort_noise;
70 rtc::Optional<int> agc_mode; 70 rtc::Optional<int> agc_mode;
71 rtc::Optional<int> agc_target_level; 71 rtc::Optional<int> agc_target_level;
72 rtc::Optional<bool> use_agc_limiter; 72 rtc::Optional<bool> use_agc_limiter;
73 rtc::Optional<int> agc_compression_gain; 73 rtc::Optional<int> agc_compression_gain;
74 rtc::Optional<int> vad_likelihood; 74 rtc::Optional<int> vad_likelihood;
75 rtc::Optional<int> ns_level; 75 rtc::Optional<int> ns_level;
76 rtc::Optional<bool> use_refined_adaptive_filter; 76 rtc::Optional<bool> use_refined_adaptive_filter;
77 bool simulate_mic_gain = false;
77 bool report_performance = false; 78 bool report_performance = false;
78 bool report_bitexactness = false; 79 bool report_bitexactness = false;
79 bool use_verbose_logging = false; 80 bool use_verbose_logging = false;
80 bool discard_all_settings_in_aecdump = true; 81 bool discard_all_settings_in_aecdump = true;
81 rtc::Optional<std::string> aec_dump_input_filename; 82 rtc::Optional<std::string> aec_dump_input_filename;
82 rtc::Optional<std::string> aec_dump_output_filename; 83 rtc::Optional<std::string> aec_dump_output_filename;
83 bool fixed_interface = false; 84 bool fixed_interface = false;
84 bool store_intermediate_output = false; 85 bool store_intermediate_output = false;
85 rtc::Optional<std::string> custom_call_order_filename; 86 rtc::Optional<std::string> custom_call_order_filename;
86 }; 87 };
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 : proc_time_(proc_time), start_time_(rtc::TimeNanos()) {} 129 : proc_time_(proc_time), start_time_(rtc::TimeNanos()) {}
129 130
130 ~ScopedTimer(); 131 ~ScopedTimer();
131 132
132 private: 133 private:
133 TickIntervalStats* const proc_time_; 134 TickIntervalStats* const proc_time_;
134 int64_t start_time_; 135 int64_t start_time_;
135 }; 136 };
136 137
137 TickIntervalStats* mutable_proc_time() { return &proc_time_; } 138 TickIntervalStats* mutable_proc_time() { return &proc_time_; }
138 void ProcessStream(bool fixed_interface); 139 void ProcessStream(bool fixed_interface,
140 bool skip_analog_level_update = false);
aleloi 2017/04/21 11:46:42 Suggest rename into do_analog_level_update instead
AleBzk 2017/04/24 09:40:26 Done.
139 void ProcessReverseStream(bool fixed_interface); 141 void ProcessReverseStream(bool fixed_interface);
140 void CreateAudioProcessor(); 142 void CreateAudioProcessor();
141 void DestroyAudioProcessor(); 143 void DestroyAudioProcessor();
142 void SetupBuffersConfigsOutputs(int input_sample_rate_hz, 144 void SetupBuffersConfigsOutputs(int input_sample_rate_hz,
143 int output_sample_rate_hz, 145 int output_sample_rate_hz,
144 int reverse_input_sample_rate_hz, 146 int reverse_input_sample_rate_hz,
145 int reverse_output_sample_rate_hz, 147 int reverse_output_sample_rate_hz,
146 int input_num_channels, 148 int input_num_channels,
147 int output_num_channels, 149 int output_num_channels,
148 int reverse_input_num_channels, 150 int reverse_input_num_channels,
149 int reverse_output_num_channels); 151 int reverse_output_num_channels);
150 152
151 const SimulationSettings settings_; 153 const SimulationSettings settings_;
152 std::unique_ptr<AudioProcessing> ap_; 154 std::unique_ptr<AudioProcessing> ap_;
153 155
154 std::unique_ptr<ChannelBuffer<float>> in_buf_; 156 std::unique_ptr<ChannelBuffer<float>> in_buf_;
155 std::unique_ptr<ChannelBuffer<float>> out_buf_; 157 std::unique_ptr<ChannelBuffer<float>> out_buf_;
156 std::unique_ptr<ChannelBuffer<float>> reverse_in_buf_; 158 std::unique_ptr<ChannelBuffer<float>> reverse_in_buf_;
157 std::unique_ptr<ChannelBuffer<float>> reverse_out_buf_; 159 std::unique_ptr<ChannelBuffer<float>> reverse_out_buf_;
158 StreamConfig in_config_; 160 StreamConfig in_config_;
159 StreamConfig out_config_; 161 StreamConfig out_config_;
160 StreamConfig reverse_in_config_; 162 StreamConfig reverse_in_config_;
161 StreamConfig reverse_out_config_; 163 StreamConfig reverse_out_config_;
162 std::unique_ptr<ChannelBufferWavReader> buffer_reader_; 164 std::unique_ptr<ChannelBufferWavReader> buffer_reader_;
163 std::unique_ptr<ChannelBufferWavReader> reverse_buffer_reader_; 165 std::unique_ptr<ChannelBufferWavReader> reverse_buffer_reader_;
164 AudioFrame rev_frame_; 166 AudioFrame rev_frame_;
165 AudioFrame fwd_frame_; 167 AudioFrame fwd_frame_;
166 bool bitexact_output_ = true; 168 bool bitexact_output_ = true;
169 // TODO(alessiob): Check what initial value makes sense, 100 comes from
170 // WavBasedSimulator::last_specified_microphone_level_.
171 int last_specified_microphone_level_ = 100;
167 172
168 private: 173 private:
169 void SetupOutput(); 174 void SetupOutput();
170 175
171 size_t num_process_stream_calls_ = 0; 176 size_t num_process_stream_calls_ = 0;
172 size_t num_reverse_process_stream_calls_ = 0; 177 size_t num_reverse_process_stream_calls_ = 0;
173 size_t output_reset_counter_ = 0; 178 size_t output_reset_counter_ = 0;
174 std::unique_ptr<ChannelBufferWavWriter> buffer_writer_; 179 std::unique_ptr<ChannelBufferWavWriter> buffer_writer_;
175 std::unique_ptr<ChannelBufferWavWriter> reverse_buffer_writer_; 180 std::unique_ptr<ChannelBufferWavWriter> reverse_buffer_writer_;
176 TickIntervalStats proc_time_; 181 TickIntervalStats proc_time_;
177 std::ofstream residual_echo_likelihood_graph_writer_; 182 std::ofstream residual_echo_likelihood_graph_writer_;
178 183
179 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioProcessingSimulator); 184 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioProcessingSimulator);
180 }; 185 };
181 186
182 } // namespace test 187 } // namespace test
183 } // namespace webrtc 188 } // namespace webrtc
184 189
185 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_ 190 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698