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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_unittest.cc

Issue 2110593003: Pull out the PostFilter to its own NonlinearBeamformer API (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebasing Created 4 years, 5 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) 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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 const size_t kNumInputChannels = 2; 1277 const size_t kNumInputChannels = 2;
1278 const size_t kNumOutputChannels = 1; 1278 const size_t kNumOutputChannels = 1;
1279 const size_t kNumChunks = 700; 1279 const size_t kNumChunks = 700;
1280 const float kScaleFactor = 0.25f; 1280 const float kScaleFactor = 0.25f;
1281 Config config; 1281 Config config;
1282 std::vector<webrtc::Point> geometry; 1282 std::vector<webrtc::Point> geometry;
1283 geometry.push_back(webrtc::Point(0.f, 0.f, 0.f)); 1283 geometry.push_back(webrtc::Point(0.f, 0.f, 0.f));
1284 geometry.push_back(webrtc::Point(0.05f, 0.f, 0.f)); 1284 geometry.push_back(webrtc::Point(0.05f, 0.f, 0.f));
1285 config.Set<Beamforming>(new Beamforming(true, geometry)); 1285 config.Set<Beamforming>(new Beamforming(true, geometry));
1286 testing::NiceMock<MockNonlinearBeamformer>* beamformer = 1286 testing::NiceMock<MockNonlinearBeamformer>* beamformer =
1287 new testing::NiceMock<MockNonlinearBeamformer>(geometry); 1287 new testing::NiceMock<MockNonlinearBeamformer>(geometry, 1u);
1288 std::unique_ptr<AudioProcessing> apm( 1288 std::unique_ptr<AudioProcessing> apm(
1289 AudioProcessing::Create(config, beamformer)); 1289 AudioProcessing::Create(config, beamformer));
1290 EXPECT_EQ(kNoErr, apm->gain_control()->Enable(true)); 1290 EXPECT_EQ(kNoErr, apm->gain_control()->Enable(true));
1291 ChannelBuffer<float> src_buf(kSamplesPerChannel, kNumInputChannels); 1291 ChannelBuffer<float> src_buf(kSamplesPerChannel, kNumInputChannels);
1292 ChannelBuffer<float> dest_buf(kSamplesPerChannel, kNumOutputChannels); 1292 ChannelBuffer<float> dest_buf(kSamplesPerChannel, kNumOutputChannels);
1293 const size_t max_length = kSamplesPerChannel * std::max(kNumInputChannels, 1293 const size_t max_length = kSamplesPerChannel * std::max(kNumInputChannels,
1294 kNumOutputChannels); 1294 kNumOutputChannels);
1295 std::unique_ptr<int16_t[]> int_data(new int16_t[max_length]); 1295 std::unique_ptr<int16_t[]> int_data(new int16_t[max_length]);
1296 std::unique_ptr<float[]> float_data(new float[max_length]); 1296 std::unique_ptr<float[]> float_data(new float[max_length]);
1297 std::string filename = ResourceFilePath("far", kSampleRateHz); 1297 std::string filename = ResourceFilePath("far", kSampleRateHz);
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
2767 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), 2767 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35),
2768 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), 2768 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0),
2769 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), 2769 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20),
2770 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), 2770 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20),
2771 std::tr1::make_tuple(16000, 16000, 32000, 16000, 35, 20), 2771 std::tr1::make_tuple(16000, 16000, 32000, 16000, 35, 20),
2772 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); 2772 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0)));
2773 #endif 2773 #endif
2774 2774
2775 } // namespace 2775 } // namespace
2776 } // namespace webrtc 2776 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | webrtc/modules/audio_processing/beamformer/beamformer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698