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

Side by Side Diff: webrtc/modules/audio_coding/test/opus_test.cc

Issue 1513223002: Reduce the runtime of some ACM tests in modules_tests (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing win64 build Created 5 years 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 | « webrtc/modules/audio_coding/test/iSACTest.cc ('k') | no next file » | 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_ARCH_ARM) 229 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_ARCH_ARM)
230 // If we are on Android, iOS and/or ARM, use a lower complexity setting as 230 // If we are on Android, iOS and/or ARM, use a lower complexity setting as
231 // default. 231 // default.
232 const int kOpusComplexity5 = 5; 232 const int kOpusComplexity5 = 5;
233 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_mono_encoder_, kOpusComplexity5)); 233 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_mono_encoder_, kOpusComplexity5));
234 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_stereo_encoder_, 234 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_stereo_encoder_,
235 kOpusComplexity5)); 235 kOpusComplexity5));
236 #endif 236 #endif
237 237
238 // Make sure the runtime is less than 60 seconds to pass Android test. 238 // Fast-forward 1 second (100 blocks) since the files start with silence.
239 for (size_t audio_length = 0; audio_length < 10000; audio_length += 10) { 239 in_file_stereo_.FastForward(100);
240 in_file_mono_.FastForward(100);
241
242 // Limit the runtime to 1000 blocks of 10 ms each.
243 for (size_t audio_length = 0; audio_length < 1000; audio_length += 10) {
240 bool lost_packet = false; 244 bool lost_packet = false;
241 245
242 // Get 10 msec of audio. 246 // Get 10 msec of audio.
243 if (channels == 1) { 247 if (channels == 1) {
244 if (in_file_mono_.EndOfFile()) { 248 if (in_file_mono_.EndOfFile()) {
245 break; 249 break;
246 } 250 }
247 in_file_mono_.Read10MsData(audio_frame); 251 in_file_mono_.Read10MsData(audio_frame);
248 } else { 252 } else {
249 if (in_file_stereo_.EndOfFile()) { 253 if (in_file_stereo_.EndOfFile()) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 out_file_.Open(file_name, 48000, "wb"); 375 out_file_.Open(file_name, 48000, "wb");
372 file_stream.str(""); 376 file_stream.str("");
373 file_name = file_stream.str(); 377 file_name = file_stream.str();
374 file_stream << webrtc::test::OutputPath() << "opusstandalone_out_" 378 file_stream << webrtc::test::OutputPath() << "opusstandalone_out_"
375 << test_number << ".pcm"; 379 << test_number << ".pcm";
376 file_name = file_stream.str(); 380 file_name = file_stream.str();
377 out_file_standalone_.Open(file_name, 48000, "wb"); 381 out_file_standalone_.Open(file_name, 48000, "wb");
378 } 382 }
379 383
380 } // namespace webrtc 384 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/test/iSACTest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698