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

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest.cc

Issue 1368843003: Don't link with audio codecs that we don't use (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add comment Created 5 years, 2 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 497 }
498 } 498 }
499 return false; 499 return false;
500 } 500 }
501 501
502 int last_packet_number_; 502 int last_packet_number_;
503 std::vector<uint8_t> last_payload_vec_; 503 std::vector<uint8_t> last_payload_vec_;
504 test::AudioLoop audio_loop_; 504 test::AudioLoop audio_loop_;
505 }; 505 };
506 506
507 TEST_F(AcmIsacMtTest, DoTest) { 507 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
508 #define IF_ISAC(x) x
509 #else
510 #define IF_ISAC(x) DISABLED_##x
511 #endif
512
513 TEST_F(AcmIsacMtTest, IF_ISAC(DoTest)) {
508 EXPECT_EQ(kEventSignaled, RunTest()); 514 EXPECT_EQ(kEventSignaled, RunTest());
509 } 515 }
510 516
511 // Disabling all of these tests on iOS for now. 517 // Disabling all of these tests on iOS for now.
512 // See https://code.google.com/p/webrtc/issues/detail?id=4768 for details. 518 // See https://code.google.com/p/webrtc/issues/detail?id=4768 for details.
513 #if !defined(WEBRTC_IOS) 519 #if !defined(WEBRTC_IOS)
514 520
515 class AcmReceiverBitExactness : public ::testing::Test { 521 class AcmReceiverBitExactness : public ::testing::Test {
516 public: 522 public:
517 static std::string PlatformChecksum(std::string win64, 523 static std::string PlatformChecksum(std::string win64,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 test::AcmReceiveTest test(packet_source.get(), &output, output_freq_hz, 558 test::AcmReceiveTest test(packet_source.get(), &output, output_freq_hz,
553 test::AcmReceiveTest::kArbitraryChannels); 559 test::AcmReceiveTest::kArbitraryChannels);
554 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs()); 560 ASSERT_NO_FATAL_FAILURE(test.RegisterNetEqTestCodecs());
555 test.Run(); 561 test.Run();
556 562
557 std::string checksum_string = checksum.Finish(); 563 std::string checksum_string = checksum.Finish();
558 EXPECT_EQ(checksum_ref, checksum_string); 564 EXPECT_EQ(checksum_ref, checksum_string);
559 } 565 }
560 }; 566 };
561 567
568 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISAC)) && \
569 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722)
570 #define IF_ALL_CODECS(x) x
571 #else
572 #define IF_ALL_CODECS(x) DISABLED_##x
573 #endif
574
562 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 575 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
563 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64) 576 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
564 #define MAYBE_8kHzOutput DISABLED_8kHzOutput 577 #define MAYBE_8kHzOutput DISABLED_8kHzOutput
565 #else 578 #else
566 #define MAYBE_8kHzOutput 8kHzOutput 579 #define MAYBE_8kHzOutput 8kHzOutput
567 #endif 580 #endif
568 TEST_F(AcmReceiverBitExactness, MAYBE_8kHzOutput) { 581 TEST_F(AcmReceiverBitExactness, IF_ALL_CODECS(MAYBE_8kHzOutput)) {
569 Run(8000, 582 Run(8000,
570 PlatformChecksum("dcee98c623b147ebe1b40dd30efa896e", 583 PlatformChecksum("dcee98c623b147ebe1b40dd30efa896e",
571 "adc92e173f908f93b96ba5844209815a", 584 "adc92e173f908f93b96ba5844209815a",
572 "908002dc01fc4eb1d2be24eb1d3f354b")); 585 "908002dc01fc4eb1d2be24eb1d3f354b"));
573 } 586 }
574 587
575 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 588 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
576 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64) 589 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
577 #define MAYBE_16kHzOutput DISABLED_16kHzOutput 590 #define MAYBE_16kHzOutput DISABLED_16kHzOutput
578 #else 591 #else
579 #define MAYBE_16kHzOutput 16kHzOutput 592 #define MAYBE_16kHzOutput 16kHzOutput
580 #endif 593 #endif
581 TEST_F(AcmReceiverBitExactness, MAYBE_16kHzOutput) { 594 TEST_F(AcmReceiverBitExactness, IF_ALL_CODECS(MAYBE_16kHzOutput)) {
582 Run(16000, 595 Run(16000,
583 PlatformChecksum("f790e7a8cce4e2c8b7bb5e0e4c5dac0d", 596 PlatformChecksum("f790e7a8cce4e2c8b7bb5e0e4c5dac0d",
584 "8cffa6abcb3e18e33b9d857666dff66a", 597 "8cffa6abcb3e18e33b9d857666dff66a",
585 "a909560b5ca49fa472b17b7b277195e9")); 598 "a909560b5ca49fa472b17b7b277195e9"));
586 } 599 }
587 600
588 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 601 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
589 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64) 602 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
590 #define MAYBE_32kHzOutput DISABLED_32kHzOutput 603 #define MAYBE_32kHzOutput DISABLED_32kHzOutput
591 #else 604 #else
592 #define MAYBE_32kHzOutput 32kHzOutput 605 #define MAYBE_32kHzOutput 32kHzOutput
593 #endif 606 #endif
594 TEST_F(AcmReceiverBitExactness, MAYBE_32kHzOutput) { 607 TEST_F(AcmReceiverBitExactness, IF_ALL_CODECS(MAYBE_32kHzOutput)) {
595 Run(32000, 608 Run(32000,
596 PlatformChecksum("306e0d990ee6e92de3fbecc0123ece37", 609 PlatformChecksum("306e0d990ee6e92de3fbecc0123ece37",
597 "3e126fe894720c3f85edadcc91964ba5", 610 "3e126fe894720c3f85edadcc91964ba5",
598 "441aab4b347fb3db4e9244337aca8d8e")); 611 "441aab4b347fb3db4e9244337aca8d8e"));
599 } 612 }
600 613
601 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 614 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
602 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64) 615 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
603 #define MAYBE_48kHzOutput DISABLED_48kHzOutput 616 #define MAYBE_48kHzOutput DISABLED_48kHzOutput
604 #else 617 #else
605 #define MAYBE_48kHzOutput 48kHzOutput 618 #define MAYBE_48kHzOutput 48kHzOutput
606 #endif 619 #endif
607 TEST_F(AcmReceiverBitExactness, MAYBE_48kHzOutput) { 620 TEST_F(AcmReceiverBitExactness, IF_ALL_CODECS(MAYBE_48kHzOutput)) {
608 Run(48000, 621 Run(48000,
609 PlatformChecksum("aa7c232f63a67b2a72703593bdd172e0", 622 PlatformChecksum("aa7c232f63a67b2a72703593bdd172e0",
610 "0155665e93067c4e89256b944dd11999", 623 "0155665e93067c4e89256b944dd11999",
611 "4ee2730fa1daae755e8a8fd3abd779ec")); 624 "4ee2730fa1daae755e8a8fd3abd779ec"));
612 } 625 }
613 626
614 // This test verifies bit exactness for the send-side of ACM. The test setup is 627 // This test verifies bit exactness for the send-side of ACM. The test setup is
615 // a chain of three different test classes: 628 // a chain of three different test classes:
616 // 629 //
617 // test::AcmSendTest -> AcmSenderBitExactness -> test::AcmReceiveTest 630 // test::AcmSendTest -> AcmSenderBitExactness -> test::AcmReceiveTest
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 uint32_t last_timestamp_; 776 uint32_t last_timestamp_;
764 rtc::Md5Digest payload_checksum_; 777 rtc::Md5Digest payload_checksum_;
765 }; 778 };
766 779
767 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 780 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
768 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64) 781 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
769 #define MAYBE_IsacWb30ms DISABLED_IsacWb30ms 782 #define MAYBE_IsacWb30ms DISABLED_IsacWb30ms
770 #else 783 #else
771 #define MAYBE_IsacWb30ms IsacWb30ms 784 #define MAYBE_IsacWb30ms IsacWb30ms
772 #endif 785 #endif
773 TEST_F(AcmSenderBitExactness, MAYBE_IsacWb30ms) { 786 TEST_F(AcmSenderBitExactness, IF_ISAC(MAYBE_IsacWb30ms)) {
774 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kISAC, 1, 103, 480, 480)); 787 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kISAC, 1, 103, 480, 480));
775 Run(AcmReceiverBitExactness::PlatformChecksum( 788 Run(AcmReceiverBitExactness::PlatformChecksum(
776 "c7e5bdadfa2871df95639fcc297cf23d", 789 "c7e5bdadfa2871df95639fcc297cf23d",
777 "0499ca260390769b3172136faad925b9", 790 "0499ca260390769b3172136faad925b9",
778 "0b58f9eeee43d5891f5f6c75e77984a3"), 791 "0b58f9eeee43d5891f5f6c75e77984a3"),
779 AcmReceiverBitExactness::PlatformChecksum( 792 AcmReceiverBitExactness::PlatformChecksum(
780 "d42cb5195463da26c8129bbfe73a22e6", 793 "d42cb5195463da26c8129bbfe73a22e6",
781 "83de248aea9c3c2bd680b6952401b4ca", 794 "83de248aea9c3c2bd680b6952401b4ca",
782 "3c79f16f34218271f3dca4e2b1dfe1bb"), 795 "3c79f16f34218271f3dca4e2b1dfe1bb"),
783 33, 796 33,
784 test::AcmReceiveTest::kMonoOutput); 797 test::AcmReceiveTest::kMonoOutput);
785 } 798 }
786 799
787 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199 800 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4199
788 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64) 801 #if defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM64)
789 #define MAYBE_IsacWb60ms DISABLED_IsacWb60ms 802 #define MAYBE_IsacWb60ms DISABLED_IsacWb60ms
790 #else 803 #else
791 #define MAYBE_IsacWb60ms IsacWb60ms 804 #define MAYBE_IsacWb60ms IsacWb60ms
792 #endif 805 #endif
793 TEST_F(AcmSenderBitExactness, MAYBE_IsacWb60ms) { 806 TEST_F(AcmSenderBitExactness, IF_ISAC(MAYBE_IsacWb60ms)) {
794 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kISAC, 1, 103, 960, 960)); 807 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kISAC, 1, 103, 960, 960));
795 Run(AcmReceiverBitExactness::PlatformChecksum( 808 Run(AcmReceiverBitExactness::PlatformChecksum(
796 "14d63c5f08127d280e722e3191b73bdd", 809 "14d63c5f08127d280e722e3191b73bdd",
797 "8da003e16c5371af2dc2be79a50f9076", 810 "8da003e16c5371af2dc2be79a50f9076",
798 "1ad29139a04782a33daad8c2b9b35875"), 811 "1ad29139a04782a33daad8c2b9b35875"),
799 AcmReceiverBitExactness::PlatformChecksum( 812 AcmReceiverBitExactness::PlatformChecksum(
800 "ebe04a819d3a9d83a83a17f271e1139a", 813 "ebe04a819d3a9d83a83a17f271e1139a",
801 "97aeef98553b5a4b5a68f8b716e8eaf0", 814 "97aeef98553b5a4b5a68f8b716e8eaf0",
802 "9e0a0ab743ad987b55b8e14802769c56"), 815 "9e0a0ab743ad987b55b8e14802769c56"),
803 16, 816 16,
804 test::AcmReceiveTest::kMonoOutput); 817 test::AcmReceiveTest::kMonoOutput);
805 } 818 }
806 819
807 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(IsacSwb30ms)) { 820 #ifdef WEBRTC_CODEC_ISAC
821 #define IF_ISAC_FLOAT(x) x
822 #else
823 #define IF_ISAC_FLOAT(x) DISABLED_##x
824 #endif
825
826 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(IF_ISAC_FLOAT(IsacSwb30ms))) {
808 ASSERT_NO_FATAL_FAILURE( 827 ASSERT_NO_FATAL_FAILURE(
809 SetUpTest(acm2::ACMCodecDB::kISACSWB, 1, 104, 960, 960)); 828 SetUpTest(acm2::ACMCodecDB::kISACSWB, 1, 104, 960, 960));
810 Run(AcmReceiverBitExactness::PlatformChecksum( 829 Run(AcmReceiverBitExactness::PlatformChecksum(
811 "2b3c387d06f00b7b7aad4c9be56fb83d", 830 "2b3c387d06f00b7b7aad4c9be56fb83d",
812 "", 831 "",
813 "5683b58da0fbf2063c7adc2e6bfb3fb8"), 832 "5683b58da0fbf2063c7adc2e6bfb3fb8"),
814 AcmReceiverBitExactness::PlatformChecksum( 833 AcmReceiverBitExactness::PlatformChecksum(
815 "bcc2041e7744c7ebd9f701866856849c", 834 "bcc2041e7744c7ebd9f701866856849c",
816 "", 835 "",
817 "ce86106a93419aefb063097108ec94ab"), 836 "ce86106a93419aefb063097108ec94ab"),
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 917
899 TEST_F(AcmSenderBitExactness, Pcma_stereo_20ms) { 918 TEST_F(AcmSenderBitExactness, Pcma_stereo_20ms) {
900 ASSERT_NO_FATAL_FAILURE( 919 ASSERT_NO_FATAL_FAILURE(
901 SetUpTest(acm2::ACMCodecDB::kPCMA_2ch, 2, 118, 160, 160)); 920 SetUpTest(acm2::ACMCodecDB::kPCMA_2ch, 2, 118, 160, 160));
902 Run("a5c6d83c5b7cedbeff734238220a4b0c", 921 Run("a5c6d83c5b7cedbeff734238220a4b0c",
903 "92b282c83efd20e7eeef52ba40842cf7", 922 "92b282c83efd20e7eeef52ba40842cf7",
904 50, 923 50,
905 test::AcmReceiveTest::kStereoOutput); 924 test::AcmReceiveTest::kStereoOutput);
906 } 925 }
907 926
908 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(Ilbc_30ms)) { 927 #ifdef WEBRTC_CODEC_ILBC
928 #define IF_ILBC(x) x
929 #else
930 #define IF_ILBC(x) DISABLED_##x
931 #endif
932
933 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(IF_ILBC(Ilbc_30ms))) {
909 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kILBC, 1, 102, 240, 240)); 934 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kILBC, 1, 102, 240, 240));
910 Run(AcmReceiverBitExactness::PlatformChecksum( 935 Run(AcmReceiverBitExactness::PlatformChecksum(
911 "7b6ec10910debd9af08011d3ed5249f7", 936 "7b6ec10910debd9af08011d3ed5249f7",
912 "android_audio", 937 "android_audio",
913 "7b6ec10910debd9af08011d3ed5249f7"), 938 "7b6ec10910debd9af08011d3ed5249f7"),
914 AcmReceiverBitExactness::PlatformChecksum( 939 AcmReceiverBitExactness::PlatformChecksum(
915 "cfae2e9f6aba96e145f2bcdd5050ce78", 940 "cfae2e9f6aba96e145f2bcdd5050ce78",
916 "android_payload", 941 "android_payload",
917 "cfae2e9f6aba96e145f2bcdd5050ce78"), 942 "cfae2e9f6aba96e145f2bcdd5050ce78"),
918 33, 943 33,
919 test::AcmReceiveTest::kMonoOutput); 944 test::AcmReceiveTest::kMonoOutput);
920 } 945 }
921 946
922 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(G722_20ms)) { 947 #ifdef WEBRTC_CODEC_G722
948 #define IF_G722(x) x
949 #else
950 #define IF_G722(x) DISABLED_##x
951 #endif
952
953 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(IF_G722(G722_20ms))) {
923 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kG722, 1, 9, 320, 160)); 954 ASSERT_NO_FATAL_FAILURE(SetUpTest(acm2::ACMCodecDB::kG722, 1, 9, 320, 160));
924 Run(AcmReceiverBitExactness::PlatformChecksum( 955 Run(AcmReceiverBitExactness::PlatformChecksum(
925 "7d759436f2533582950d148b5161a36c", 956 "7d759436f2533582950d148b5161a36c",
926 "android_audio", 957 "android_audio",
927 "7d759436f2533582950d148b5161a36c"), 958 "7d759436f2533582950d148b5161a36c"),
928 AcmReceiverBitExactness::PlatformChecksum( 959 AcmReceiverBitExactness::PlatformChecksum(
929 "fc68a87e1380614e658087cb35d5ca10", 960 "fc68a87e1380614e658087cb35d5ca10",
930 "android_payload", 961 "android_payload",
931 "fc68a87e1380614e658087cb35d5ca10"), 962 "fc68a87e1380614e658087cb35d5ca10"),
932 50, 963 50,
933 test::AcmReceiveTest::kMonoOutput); 964 test::AcmReceiveTest::kMonoOutput);
934 } 965 }
935 966
936 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(G722_stereo_20ms)) { 967 TEST_F(AcmSenderBitExactness, DISABLED_ON_ANDROID(IF_G722(G722_stereo_20ms))) {
937 ASSERT_NO_FATAL_FAILURE( 968 ASSERT_NO_FATAL_FAILURE(
938 SetUpTest(acm2::ACMCodecDB::kG722_2ch, 2, 119, 320, 160)); 969 SetUpTest(acm2::ACMCodecDB::kG722_2ch, 2, 119, 320, 160));
939 Run(AcmReceiverBitExactness::PlatformChecksum( 970 Run(AcmReceiverBitExactness::PlatformChecksum(
940 "7190ee718ab3d80eca181e5f7140c210", 971 "7190ee718ab3d80eca181e5f7140c210",
941 "android_audio", 972 "android_audio",
942 "7190ee718ab3d80eca181e5f7140c210"), 973 "7190ee718ab3d80eca181e5f7140c210"),
943 AcmReceiverBitExactness::PlatformChecksum( 974 AcmReceiverBitExactness::PlatformChecksum(
944 "66516152eeaa1e650ad94ff85f668dac", 975 "66516152eeaa1e650ad94ff85f668dac",
945 "android_payload", 976 "android_payload",
946 "66516152eeaa1e650ad94ff85f668dac"), 977 "66516152eeaa1e650ad94ff85f668dac"),
(...skipping 17 matching lines...) Expand all
964 "d781cce1ab986b618d0da87226cdde30", 995 "d781cce1ab986b618d0da87226cdde30",
965 "1a1fe04dd12e755949987c8d729fb3e0", 996 "1a1fe04dd12e755949987c8d729fb3e0",
966 "d781cce1ab986b618d0da87226cdde30"), 997 "d781cce1ab986b618d0da87226cdde30"),
967 50, 998 50,
968 test::AcmReceiveTest::kStereoOutput); 999 test::AcmReceiveTest::kStereoOutput);
969 } 1000 }
970 1001
971 #endif 1002 #endif
972 1003
973 } // namespace webrtc 1004 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698