Chromium Code Reviews

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

Issue 2746763005: Fixing a few tests for the upcoming Opus 1.2-alpha. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/codecs/opus/opus_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) 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 1439 matching lines...)
1450 "7190ee718ab3d80eca181e5f7140c210", "android_arm32_audio", 1450 "7190ee718ab3d80eca181e5f7140c210", "android_arm32_audio",
1451 "android_arm64_audio"), 1451 "android_arm64_audio"),
1452 AcmReceiverBitExactnessOldApi::PlatformChecksum( 1452 AcmReceiverBitExactnessOldApi::PlatformChecksum(
1453 "66516152eeaa1e650ad94ff85f668dac", 1453 "66516152eeaa1e650ad94ff85f668dac",
1454 "66516152eeaa1e650ad94ff85f668dac", "android_arm32_payload", 1454 "66516152eeaa1e650ad94ff85f668dac", "android_arm32_payload",
1455 "android_arm64_payload"), 1455 "android_arm64_payload"),
1456 50, test::AcmReceiveTestOldApi::kStereoOutput); 1456 50, test::AcmReceiveTestOldApi::kStereoOutput);
1457 } 1457 }
1458 #endif 1458 #endif
1459 1459
1460 TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms) { 1460 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1461 #define MAYBE_Opus_stereo_20ms DISABLED_Opus_stereo_20ms
1462 #else
1463 #define MAYBE_Opus_stereo_20ms Opus_stereo_20ms
1464 #endif
1465 TEST_F(AcmSenderBitExactnessOldApi, MAYBE_Opus_stereo_20ms) {
1461 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960)); 1466 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960));
1462 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum( 1467 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum(
1463 "855041f2490b887302bce9d544731849", 1468 "855041f2490b887302bce9d544731849",
1464 "855041f2490b887302bce9d544731849", 1469 "855041f2490b887302bce9d544731849",
1465 "9692eede45638eb425e0daf9c75b5c7a", 1470 "9692eede45638eb425e0daf9c75b5c7a",
1466 "86d3552bb3492247f965cdd0e88a1c82"), 1471 "86d3552bb3492247f965cdd0e88a1c82"),
1467 AcmReceiverBitExactnessOldApi::PlatformChecksum( 1472 AcmReceiverBitExactnessOldApi::PlatformChecksum(
1468 "d781cce1ab986b618d0da87226cdde30", 1473 "d781cce1ab986b618d0da87226cdde30",
1469 "d781cce1ab986b618d0da87226cdde30", 1474 "d781cce1ab986b618d0da87226cdde30",
1470 "8d6782b905c3230d4b0e3e83e1fc3439", 1475 "8d6782b905c3230d4b0e3e83e1fc3439",
1471 "798347a685fac7d0c2d8f748ffe66881"), 1476 "798347a685fac7d0c2d8f748ffe66881"),
1472 50, test::AcmReceiveTestOldApi::kStereoOutput); 1477 50, test::AcmReceiveTestOldApi::kStereoOutput);
1473 } 1478 }
1474 1479
1475 TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms_voip) { 1480 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1481 #define MAYBE_Opus_stereo_20ms_voip DISABLED_Opus_stereo_20ms_voip
1482 #else
1483 #define MAYBE_Opus_stereo_20ms_voip Opus_stereo_20ms_voip
1484 #endif
1485 TEST_F(AcmSenderBitExactnessOldApi, MAYBE_Opus_stereo_20ms_voip) {
1476 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960)); 1486 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960));
1477 // If not set, default will be kAudio in case of stereo. 1487 // If not set, default will be kAudio in case of stereo.
1478 EXPECT_EQ(0, send_test_->acm()->SetOpusApplication(kVoip)); 1488 EXPECT_EQ(0, send_test_->acm()->SetOpusApplication(kVoip));
1479 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum( 1489 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum(
1480 "9b9e12bc3cc793740966e11cbfa8b35b", 1490 "9b9e12bc3cc793740966e11cbfa8b35b",
1481 "9b9e12bc3cc793740966e11cbfa8b35b", 1491 "9b9e12bc3cc793740966e11cbfa8b35b",
1482 "0de6249018fdd316c21086db84e10610", 1492 "0de6249018fdd316c21086db84e10610",
1483 "9c4cb69db77b85841a5f8225bb8f508b"), 1493 "9c4cb69db77b85841a5f8225bb8f508b"),
1484 AcmReceiverBitExactnessOldApi::PlatformChecksum( 1494 AcmReceiverBitExactnessOldApi::PlatformChecksum(
1485 "c7340b1189652ab6b5e80dade7390cb4", 1495 "c7340b1189652ab6b5e80dade7390cb4",
(...skipping 57 matching lines...)
1543 ASSERT_TRUE(SetUpSender()); 1553 ASSERT_TRUE(SetUpSender());
1544 ASSERT_TRUE(RegisterSendCodec(codec_name, codec_sample_rate_hz, channels, 1554 ASSERT_TRUE(RegisterSendCodec(codec_name, codec_sample_rate_hz, channels,
1545 payload_type, codec_frame_size_samples, 1555 payload_type, codec_frame_size_samples,
1546 codec_frame_size_rtp_timestamps)); 1556 codec_frame_size_rtp_timestamps));
1547 } 1557 }
1548 1558
1549 std::unique_ptr<test::AcmSendTestOldApi> send_test_; 1559 std::unique_ptr<test::AcmSendTestOldApi> send_test_;
1550 std::unique_ptr<test::InputAudioFile> audio_source_; 1560 std::unique_ptr<test::InputAudioFile> audio_source_;
1551 }; 1561 };
1552 1562
1553 TEST_F(AcmSetBitRateOldApi, Opus_48khz_20ms_10kbps) { 1563 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1564 #define MAYBE_Opus_48khz_20ms_10kbps DISABLED_Opus_48khz_20ms_10kbps
1565 #else
1566 #define MAYBE_Opus_48khz_20ms_10kbps Opus_48khz_20ms_10kbps
1567 #endif
1568 TEST_F(AcmSetBitRateOldApi, MAYBE_Opus_48khz_20ms_10kbps) {
1554 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1569 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1555 #if defined(WEBRTC_ANDROID) 1570 #if defined(WEBRTC_ANDROID)
1556 Run(10000, 9288); 1571 Run(10000, 9288);
1557 #else 1572 #else
1558 Run(10000, 9024); 1573 Run(10000, 9024);
1559 #endif // WEBRTC_ANDROID 1574 #endif // WEBRTC_ANDROID
1560 } 1575 }
1561 1576
1562 TEST_F(AcmSetBitRateOldApi, Opus_48khz_20ms_50kbps) { 1577 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1578 #define MAYBE_Opus_48khz_20ms_50kbps DISABLED_Opus_48khz_20ms_50kbps
1579 #else
1580 #define MAYBE_Opus_48khz_20ms_50kbps Opus_48khz_20ms_50kbps
1581 #endif
1582 TEST_F(AcmSetBitRateOldApi, MAYBE_Opus_48khz_20ms_50kbps) {
1563 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1583 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1564 #if defined(WEBRTC_ANDROID) 1584 #if defined(WEBRTC_ANDROID)
1565 Run(50000, 47960); 1585 Run(50000, 47960);
1566 #else 1586 #else
1567 Run(50000, 49544); 1587 Run(50000, 49544);
1568 #endif // WEBRTC_ANDROID 1588 #endif // WEBRTC_ANDROID
1569 } 1589 }
1570 1590
1571 // The result on the Android platforms is inconsistent for this test case. 1591 // The result on the Android platforms is inconsistent for this test case.
1572 // On android_rel the result is different from android and android arm64 rel. 1592 // On android_rel the result is different from android and android arm64 rel.
1573 #if defined(WEBRTC_ANDROID) 1593 #if defined(WEBRTC_ANDROID) || WEBRTC_OPUS_SUPPORT_120MS_PTIME
1574 #define MAYBE_Opus_48khz_20ms_100kbps DISABLED_Opus_48khz_20ms_100kbps 1594 #define MAYBE_Opus_48khz_20ms_100kbps DISABLED_Opus_48khz_20ms_100kbps
1575 #else 1595 #else
1576 #define MAYBE_Opus_48khz_20ms_100kbps Opus_48khz_20ms_100kbps 1596 #define MAYBE_Opus_48khz_20ms_100kbps Opus_48khz_20ms_100kbps
1577 #endif 1597 #endif
1578 TEST_F(AcmSetBitRateOldApi, MAYBE_Opus_48khz_20ms_100kbps) { 1598 TEST_F(AcmSetBitRateOldApi, MAYBE_Opus_48khz_20ms_100kbps) {
1579 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1599 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1580 Run(100000, 100888); 1600 Run(100000, 100888);
1581 } 1601 }
1582 1602
1583 // These next 2 tests ensure that the SetBitRate function has no effect on PCM 1603 // These next 2 tests ensure that the SetBitRate function has no effect on PCM
(...skipping 50 matching lines...)
1634 packet_counter++; 1654 packet_counter++;
1635 } 1655 }
1636 EXPECT_EQ(expected_before_switch_bits, nr_bytes_before * 8); 1656 EXPECT_EQ(expected_before_switch_bits, nr_bytes_before * 8);
1637 EXPECT_EQ(expected_after_switch_bits, nr_bytes_after * 8); 1657 EXPECT_EQ(expected_after_switch_bits, nr_bytes_after * 8);
1638 } 1658 }
1639 1659
1640 uint32_t sampling_freq_hz_; 1660 uint32_t sampling_freq_hz_;
1641 uint32_t frame_size_samples_; 1661 uint32_t frame_size_samples_;
1642 }; 1662 };
1643 1663
1644 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_10kbps) { 1664 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1665 #define MAYBE_Opus_48khz_20ms_10kbps DISABLED_Opus_48khz_20ms_10kbps
1666 #else
1667 #define MAYBE_Opus_48khz_20ms_10kbps Opus_48khz_20ms_10kbps
1668 #endif
1669 TEST_F(AcmChangeBitRateOldApi, MAYBE_Opus_48khz_20ms_10kbps) {
minyue-webrtc 2017/03/14 14:18:14 note that MAYBE_Opus_48khz_20ms_10kbps is redefine
kjellander (google.com) 2017/03/14 14:36:47 Run a few trybots to find out. I think redefinitio
1645 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1670 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1646 #if defined(WEBRTC_ANDROID) 1671 #if defined(WEBRTC_ANDROID)
1647 Run(10000, 32200, 5176); 1672 Run(10000, 32200, 5176);
1648 #else 1673 #else
1649 Run(10000, 32200, 5456); 1674 Run(10000, 32200, 5456);
1650 #endif // WEBRTC_ANDROID 1675 #endif // WEBRTC_ANDROID
1651 } 1676 }
1652 1677
1653 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_50kbps) { 1678 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1679 #define MAYBE_Opus_48khz_20ms_50kbps DISABLED_Opus_48khz_20ms_50kbps
1680 #else
1681 #define MAYBE_Opus_48khz_20ms_50kbps Opus_48khz_20ms_50kbps
1682 #endif
1683 TEST_F(AcmChangeBitRateOldApi, MAYBE_Opus_48khz_20ms_50kbps) {
1654 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1684 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1655 #if defined(WEBRTC_ANDROID) 1685 #if defined(WEBRTC_ANDROID)
1656 Run(50000, 32200, 24768); 1686 Run(50000, 32200, 24768);
1657 #else 1687 #else
1658 Run(50000, 32200, 24848); 1688 Run(50000, 32200, 24848);
1659 #endif // WEBRTC_ANDROID 1689 #endif // WEBRTC_ANDROID
1660 } 1690 }
1661 1691
1662 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_100kbps) { 1692
1693 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1694 #define MAYBE_Opus_48khz_20ms_100kbps DISABLED_Opus_48khz_20ms_100kbps
1695 #else
1696 #define MAYBE_Opus_48khz_20ms_100kbps Opus_48khz_20ms_100kbps
1697 #endif
1698 TEST_F(AcmChangeBitRateOldApi, MAYBE_Opus_48khz_20ms_100kbps) {
1663 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1699 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1664 #if defined(WEBRTC_ANDROID) 1700 #if defined(WEBRTC_ANDROID)
1665 #if defined(WEBRTC_ARCH_ARM64) 1701 #if defined(WEBRTC_ARCH_ARM64)
1666 Run(100000, 32200, 51152); 1702 Run(100000, 32200, 51152);
1667 #else 1703 #else
1668 Run(100000, 32200, 51248); 1704 Run(100000, 32200, 51248);
1669 #endif // WEBRTC_ARCH_ARM64 1705 #endif // WEBRTC_ARCH_ARM64
1670 #else 1706 #else
1671 Run(100000, 32200, 50584); 1707 Run(100000, 32200, 50584);
1672 #endif // WEBRTC_ANDROID 1708 #endif // WEBRTC_ANDROID
(...skipping 166 matching lines...)
1839 Run(16000, 8000, 1000); 1875 Run(16000, 8000, 1000);
1840 } 1876 }
1841 1877
1842 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1878 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1843 Run(8000, 16000, 1000); 1879 Run(8000, 16000, 1000);
1844 } 1880 }
1845 1881
1846 #endif 1882 #endif
1847 1883
1848 } // namespace webrtc 1884 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/codecs/opus/opus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine