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

Side by Side Diff: webrtc/modules/audio_processing/beamformer/nonlinear_beamformer_unittest.cc

Issue 1841213002: Renamed the test::BitExactFrame method to test::VectorDifferenceBounded. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changed name of the StackedFrameDifferenceBounded and VectorDifferenceBounded methods Created 4 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
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/echo_cancellation_unittest.cc » ('j') | 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 &capture_buffer); 104 &capture_buffer);
105 105
106 ProcessOneFrame(sample_rate_hz, &capture_buffer, &beamformer); 106 ProcessOneFrame(sample_rate_hz, &capture_buffer, &beamformer);
107 } 107 }
108 108
109 // Extract and verify the test results. 109 // Extract and verify the test results.
110 std::vector<float> capture_output; 110 std::vector<float> capture_output;
111 test::ExtractVectorFromAudioBuffer(capture_config, &capture_buffer, 111 test::ExtractVectorFromAudioBuffer(capture_config, &capture_buffer,
112 &capture_output); 112 &capture_output);
113 113
114 const float kTolerance = 1.f / static_cast<float>(1 << 15); 114 const float kElementErrorBound = 1.f / static_cast<float>(1 << 15);
115 115
116 // Compare the output with the reference. Only the first values of the output 116 // Compare the output with the reference. Only the first values of the output
117 // from last frame processed are compared in order not having to specify all 117 // from last frame processed are compared in order not having to specify all
118 // preceeding frames as testvectors. As the algorithm being tested has a 118 // preceeding frames as testvectors. As the algorithm being tested has a
119 // memory, testing only the last frame implicitly also tests the preceeding 119 // memory, testing only the last frame implicitly also tests the preceeding
120 // frames. 120 // frames.
121 EXPECT_TRUE(test::BitExactFrame( 121 EXPECT_TRUE(test::VerifyDeinterleavedArray(
122 capture_config.num_frames(), capture_config.num_channels(), 122 capture_config.num_frames(), capture_config.num_channels(),
123 output_reference, capture_output, kTolerance)); 123 output_reference, capture_output, kElementErrorBound));
124 } 124 }
125 125
126 // TODO(peah): Add bitexactness tests for scenarios with more than 2 input 126 // TODO(peah): Add bitexactness tests for scenarios with more than 2 input
127 // channels. 127 // channels.
128 std::vector<Point> CreateArrayGeometry(int variant) { 128 std::vector<Point> CreateArrayGeometry(int variant) {
129 std::vector<Point> array_geometry; 129 std::vector<Point> array_geometry;
130 switch (variant) { 130 switch (variant) {
131 case 1: 131 case 1:
132 array_geometry.push_back(Point(-0.025f, 0.f, 0.f)); 132 array_geometry.push_back(Point(-0.025f, 0.f, 0.f));
133 array_geometry.push_back(Point(0.025f, 0.f, 0.f)); 133 array_geometry.push_back(Point(0.025f, 0.f, 0.f));
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 TEST(BeamformerBitExactnessTest, 369 TEST(BeamformerBitExactnessTest,
370 DISABLED_Stereo16kHz_ArrayGeometry3_TargetDirection1) { 370 DISABLED_Stereo16kHz_ArrayGeometry3_TargetDirection1) {
371 const float kOutputReference[] = {-0.000161f, 0.000171f, -0.000096f, 371 const float kOutputReference[] = {-0.000161f, 0.000171f, -0.000096f,
372 0.001007f, 0.000427f, 0.000977f}; 372 0.001007f, 0.000427f, 0.000977f};
373 373
374 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(3), 374 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(3),
375 TargetDirection1, kOutputReference); 375 TargetDirection1, kOutputReference);
376 } 376 }
377 377
378 } // namespace webrtc 378 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/echo_cancellation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698