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

Side by Side Diff: webrtc/modules/audio_coding/main/test/TestStereo.cc

Issue 1336923002: Remove the preprocessor symbol WEBRTC_CODEC_PCM16 (it was always defined) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 3 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 : acm_a_(AudioCodingModule::Create(0)), 111 : acm_a_(AudioCodingModule::Create(0)),
112 acm_b_(AudioCodingModule::Create(1)), 112 acm_b_(AudioCodingModule::Create(1)),
113 channel_a2b_(NULL), 113 channel_a2b_(NULL),
114 test_cntr_(0), 114 test_cntr_(0),
115 pack_size_samp_(0), 115 pack_size_samp_(0),
116 pack_size_bytes_(0), 116 pack_size_bytes_(0),
117 counter_(0) 117 counter_(0)
118 #ifdef WEBRTC_CODEC_G722 118 #ifdef WEBRTC_CODEC_G722
119 , g722_pltype_(0) 119 , g722_pltype_(0)
120 #endif 120 #endif
121 #ifdef WEBRTC_CODEC_PCM16
122 , l16_8khz_pltype_(-1) 121 , l16_8khz_pltype_(-1)
123 , l16_16khz_pltype_(-1) 122 , l16_16khz_pltype_(-1)
124 , l16_32khz_pltype_(-1) 123 , l16_32khz_pltype_(-1)
125 #endif
126 #ifdef PCMA_AND_PCMU 124 #ifdef PCMA_AND_PCMU
127 , pcma_pltype_(-1) 125 , pcma_pltype_(-1)
128 , pcmu_pltype_(-1) 126 , pcmu_pltype_(-1)
129 #endif 127 #endif
130 #ifdef WEBRTC_CODEC_OPUS 128 #ifdef WEBRTC_CODEC_OPUS
131 , opus_pltype_(-1) 129 , opus_pltype_(-1)
132 #endif 130 #endif
133 { 131 {
134 // test_mode = 0 for silent test (auto test) 132 // test_mode = 0 for silent test (auto test)
135 test_mode_ = test_mode; 133 test_mode_ = test_mode;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 g722_pltype_); 238 g722_pltype_);
241 Run(channel_a2b_, audio_channels, codec_channels); 239 Run(channel_a2b_, audio_channels, codec_channels);
242 RegisterSendCodec('A', codec_g722, 16000, 64000, 800, codec_channels, 240 RegisterSendCodec('A', codec_g722, 16000, 64000, 800, codec_channels,
243 g722_pltype_); 241 g722_pltype_);
244 Run(channel_a2b_, audio_channels, codec_channels); 242 Run(channel_a2b_, audio_channels, codec_channels);
245 RegisterSendCodec('A', codec_g722, 16000, 64000, 960, codec_channels, 243 RegisterSendCodec('A', codec_g722, 16000, 64000, 960, codec_channels,
246 g722_pltype_); 244 g722_pltype_);
247 Run(channel_a2b_, audio_channels, codec_channels); 245 Run(channel_a2b_, audio_channels, codec_channels);
248 out_file_.Close(); 246 out_file_.Close();
249 #endif 247 #endif
250 #ifdef WEBRTC_CODEC_PCM16
251 if (test_mode_ != 0) { 248 if (test_mode_ != 0) {
252 printf("===========================================================\n"); 249 printf("===========================================================\n");
253 printf("Test number: %d\n", test_cntr_ + 1); 250 printf("Test number: %d\n", test_cntr_ + 1);
254 printf("Test type: Stereo-to-stereo\n"); 251 printf("Test type: Stereo-to-stereo\n");
255 } 252 }
256 channel_a2b_->set_codec_mode(kStereo); 253 channel_a2b_->set_codec_mode(kStereo);
257 test_cntr_++; 254 test_cntr_++;
258 OpenOutFile(test_cntr_); 255 OpenOutFile(test_cntr_);
259 char codec_l16[] = "L16"; 256 char codec_l16[] = "L16";
260 RegisterSendCodec('A', codec_l16, 8000, 128000, 80, codec_channels, 257 RegisterSendCodec('A', codec_l16, 8000, 128000, 80, codec_channels,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 296 }
300 test_cntr_++; 297 test_cntr_++;
301 OpenOutFile(test_cntr_); 298 OpenOutFile(test_cntr_);
302 RegisterSendCodec('A', codec_l16, 32000, 512000, 320, codec_channels, 299 RegisterSendCodec('A', codec_l16, 32000, 512000, 320, codec_channels,
303 l16_32khz_pltype_); 300 l16_32khz_pltype_);
304 Run(channel_a2b_, audio_channels, codec_channels); 301 Run(channel_a2b_, audio_channels, codec_channels);
305 RegisterSendCodec('A', codec_l16, 32000, 512000, 640, codec_channels, 302 RegisterSendCodec('A', codec_l16, 32000, 512000, 640, codec_channels,
306 l16_32khz_pltype_); 303 l16_32khz_pltype_);
307 Run(channel_a2b_, audio_channels, codec_channels); 304 Run(channel_a2b_, audio_channels, codec_channels);
308 out_file_.Close(); 305 out_file_.Close();
309 #endif
310 #ifdef PCMA_AND_PCMU 306 #ifdef PCMA_AND_PCMU
311 if (test_mode_ != 0) { 307 if (test_mode_ != 0) {
312 printf("===========================================================\n"); 308 printf("===========================================================\n");
313 printf("Test number: %d\n", test_cntr_ + 1); 309 printf("Test number: %d\n", test_cntr_ + 1);
314 printf("Test type: Stereo-to-stereo\n"); 310 printf("Test type: Stereo-to-stereo\n");
315 } 311 }
316 channel_a2b_->set_codec_mode(kStereo); 312 channel_a2b_->set_codec_mode(kStereo);
317 audio_channels = 2; 313 audio_channels = 2;
318 codec_channels = 2; 314 codec_channels = 2;
319 test_cntr_++; 315 test_cntr_++;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 printf("Test type: Mono-to-stereo\n"); 424 printf("Test type: Mono-to-stereo\n");
429 } 425 }
430 test_cntr_++; 426 test_cntr_++;
431 channel_a2b_->set_codec_mode(kStereo); 427 channel_a2b_->set_codec_mode(kStereo);
432 OpenOutFile(test_cntr_); 428 OpenOutFile(test_cntr_);
433 RegisterSendCodec('A', codec_g722, 16000, 64000, 160, codec_channels, 429 RegisterSendCodec('A', codec_g722, 16000, 64000, 160, codec_channels,
434 g722_pltype_); 430 g722_pltype_);
435 Run(channel_a2b_, audio_channels, codec_channels); 431 Run(channel_a2b_, audio_channels, codec_channels);
436 out_file_.Close(); 432 out_file_.Close();
437 #endif 433 #endif
438 #ifdef WEBRTC_CODEC_PCM16
439 if (test_mode_ != 0) { 434 if (test_mode_ != 0) {
440 printf("===============================================================\n"); 435 printf("===============================================================\n");
441 printf("Test number: %d\n", test_cntr_ + 1); 436 printf("Test number: %d\n", test_cntr_ + 1);
442 printf("Test type: Mono-to-stereo\n"); 437 printf("Test type: Mono-to-stereo\n");
443 } 438 }
444 test_cntr_++; 439 test_cntr_++;
445 channel_a2b_->set_codec_mode(kStereo); 440 channel_a2b_->set_codec_mode(kStereo);
446 OpenOutFile(test_cntr_); 441 OpenOutFile(test_cntr_);
447 RegisterSendCodec('A', codec_l16, 8000, 128000, 80, codec_channels, 442 RegisterSendCodec('A', codec_l16, 8000, 128000, 80, codec_channels,
448 l16_8khz_pltype_); 443 l16_8khz_pltype_);
(...skipping 14 matching lines...) Expand all
463 printf("===============================================================\n"); 458 printf("===============================================================\n");
464 printf("Test number: %d\n", test_cntr_ + 1); 459 printf("Test number: %d\n", test_cntr_ + 1);
465 printf("Test type: Mono-to-stereo\n"); 460 printf("Test type: Mono-to-stereo\n");
466 } 461 }
467 test_cntr_++; 462 test_cntr_++;
468 OpenOutFile(test_cntr_); 463 OpenOutFile(test_cntr_);
469 RegisterSendCodec('A', codec_l16, 32000, 512000, 320, codec_channels, 464 RegisterSendCodec('A', codec_l16, 32000, 512000, 320, codec_channels,
470 l16_32khz_pltype_); 465 l16_32khz_pltype_);
471 Run(channel_a2b_, audio_channels, codec_channels); 466 Run(channel_a2b_, audio_channels, codec_channels);
472 out_file_.Close(); 467 out_file_.Close();
473 #endif
474 #ifdef PCMA_AND_PCMU 468 #ifdef PCMA_AND_PCMU
475 if (test_mode_ != 0) { 469 if (test_mode_ != 0) {
476 printf("===============================================================\n"); 470 printf("===============================================================\n");
477 printf("Test number: %d\n", test_cntr_ + 1); 471 printf("Test number: %d\n", test_cntr_ + 1);
478 printf("Test type: Mono-to-stereo\n"); 472 printf("Test type: Mono-to-stereo\n");
479 } 473 }
480 test_cntr_++; 474 test_cntr_++;
481 channel_a2b_->set_codec_mode(kStereo); 475 channel_a2b_->set_codec_mode(kStereo);
482 OpenOutFile(test_cntr_); 476 OpenOutFile(test_cntr_);
483 RegisterSendCodec('A', codec_pcmu, 8000, 64000, 80, codec_channels, 477 RegisterSendCodec('A', codec_pcmu, 8000, 64000, 80, codec_channels,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // Make sure it is possible to set VAD/CNG, now that we are sending mono 525 // Make sure it is possible to set VAD/CNG, now that we are sending mono
532 // again. 526 // again.
533 EXPECT_EQ(0, acm_a_->SetVAD(true, true, VADNormal)); 527 EXPECT_EQ(0, acm_a_->SetVAD(true, true, VADNormal));
534 EXPECT_EQ(0, acm_a_->VAD(&dtx, &vad, &vad_mode)); 528 EXPECT_EQ(0, acm_a_->VAD(&dtx, &vad, &vad_mode));
535 EXPECT_TRUE(dtx); 529 EXPECT_TRUE(dtx);
536 EXPECT_TRUE(vad); 530 EXPECT_TRUE(vad);
537 EXPECT_EQ(0, acm_a_->SetVAD(false, false, VADNormal)); 531 EXPECT_EQ(0, acm_a_->SetVAD(false, false, VADNormal));
538 Run(channel_a2b_, audio_channels, codec_channels); 532 Run(channel_a2b_, audio_channels, codec_channels);
539 out_file_.Close(); 533 out_file_.Close();
540 #endif 534 #endif
541 #ifdef WEBRTC_CODEC_PCM16
542 if (test_mode_ != 0) { 535 if (test_mode_ != 0) {
543 printf("===============================================================\n"); 536 printf("===============================================================\n");
544 printf("Test number: %d\n", test_cntr_ + 1); 537 printf("Test number: %d\n", test_cntr_ + 1);
545 printf("Test type: Stereo-to-mono\n"); 538 printf("Test type: Stereo-to-mono\n");
546 } 539 }
547 test_cntr_++; 540 test_cntr_++;
548 OpenOutFile(test_cntr_); 541 OpenOutFile(test_cntr_);
549 RegisterSendCodec('A', codec_l16, 8000, 128000, 80, codec_channels, 542 RegisterSendCodec('A', codec_l16, 8000, 128000, 80, codec_channels,
550 l16_8khz_pltype_); 543 l16_8khz_pltype_);
551 Run(channel_a2b_, audio_channels, codec_channels); 544 Run(channel_a2b_, audio_channels, codec_channels);
(...skipping 13 matching lines...) Expand all
565 printf("==============================================================\n"); 558 printf("==============================================================\n");
566 printf("Test number: %d\n", test_cntr_ + 1); 559 printf("Test number: %d\n", test_cntr_ + 1);
567 printf("Test type: Stereo-to-mono\n"); 560 printf("Test type: Stereo-to-mono\n");
568 } 561 }
569 test_cntr_++; 562 test_cntr_++;
570 OpenOutFile(test_cntr_); 563 OpenOutFile(test_cntr_);
571 RegisterSendCodec('A', codec_l16, 32000, 512000, 320, codec_channels, 564 RegisterSendCodec('A', codec_l16, 32000, 512000, 320, codec_channels,
572 l16_32khz_pltype_); 565 l16_32khz_pltype_);
573 Run(channel_a2b_, audio_channels, codec_channels); 566 Run(channel_a2b_, audio_channels, codec_channels);
574 out_file_.Close(); 567 out_file_.Close();
575 #endif
576 #ifdef PCMA_AND_PCMU 568 #ifdef PCMA_AND_PCMU
577 if (test_mode_ != 0) { 569 if (test_mode_ != 0) {
578 printf("===============================================================\n"); 570 printf("===============================================================\n");
579 printf("Test number: %d\n", test_cntr_ + 1); 571 printf("Test number: %d\n", test_cntr_ + 1);
580 printf("Test type: Stereo-to-mono\n"); 572 printf("Test type: Stereo-to-mono\n");
581 } 573 }
582 test_cntr_++; 574 test_cntr_++;
583 OpenOutFile(test_cntr_); 575 OpenOutFile(test_cntr_);
584 RegisterSendCodec('A', codec_pcmu, 8000, 64000, 80, codec_channels, 576 RegisterSendCodec('A', codec_pcmu, 8000, 64000, 80, codec_channels,
585 pcmu_pltype_); 577 pcmu_pltype_);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 out_file_.Close(); 647 out_file_.Close();
656 648
657 #endif 649 #endif
658 650
659 // Print out which codecs were tested, and which were not, in the run. 651 // Print out which codecs were tested, and which were not, in the run.
660 if (test_mode_ != 0) { 652 if (test_mode_ != 0) {
661 printf("\nThe following codecs was INCLUDED in the test:\n"); 653 printf("\nThe following codecs was INCLUDED in the test:\n");
662 #ifdef WEBRTC_CODEC_G722 654 #ifdef WEBRTC_CODEC_G722
663 printf(" G.722\n"); 655 printf(" G.722\n");
664 #endif 656 #endif
665 #ifdef WEBRTC_CODEC_PCM16
666 printf(" PCM16\n"); 657 printf(" PCM16\n");
667 #endif
668 printf(" G.711\n"); 658 printf(" G.711\n");
669 #ifdef WEBRTC_CODEC_OPUS 659 #ifdef WEBRTC_CODEC_OPUS
670 printf(" Opus\n"); 660 printf(" Opus\n");
671 #endif 661 #endif
672 printf("\nTo complete the test, listen to the %d number of output " 662 printf("\nTo complete the test, listen to the %d number of output "
673 "files.\n", 663 "files.\n",
674 test_cntr_); 664 test_cntr_);
675 } 665 }
676 666
677 // Delete the file pointers. 667 // Delete the file pointers.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 if (test_mode_ != 0) { 828 if (test_mode_ != 0) {
839 printf("%s -> ", my_codec_param.plname); 829 printf("%s -> ", my_codec_param.plname);
840 } 830 }
841 acm_b_->ReceiveCodec(&my_codec_param); 831 acm_b_->ReceiveCodec(&my_codec_param);
842 if (test_mode_ != 0) { 832 if (test_mode_ != 0) {
843 printf("%s\n", my_codec_param.plname); 833 printf("%s\n", my_codec_param.plname);
844 } 834 }
845 } 835 }
846 836
847 } // namespace webrtc 837 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/test/TestStereo.h ('k') | webrtc/modules/audio_coding/neteq/audio_decoder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698