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

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

Issue 1612443002: Create local copy of Opus v1.1.2 Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: testing if neteq4_opus_network_stats.dat.sha1 needs to be updated Created 4 years, 11 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 | « webrtc/build/common.gypi ('k') | webrtc/modules/audio_coding/codecs/opus/opus/BUILD.gn » ('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 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 "android_arm64_payload"), 1402 "android_arm64_payload"),
1403 50, test::AcmReceiveTestOldApi::kStereoOutput); 1403 50, test::AcmReceiveTestOldApi::kStereoOutput);
1404 } 1404 }
1405 #endif 1405 #endif
1406 1406
1407 TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms) { 1407 TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms) {
1408 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960)); 1408 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960));
1409 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum( 1409 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum(
1410 "855041f2490b887302bce9d544731849", 1410 "855041f2490b887302bce9d544731849",
1411 "855041f2490b887302bce9d544731849", 1411 "855041f2490b887302bce9d544731849",
1412 "1e1a0fce893fef2d66886a7f09e2ebce", 1412 "9692eede45638eb425e0daf9c75b5c7a",
1413 "7417a66c28be42d5d9b2d64e0c191585"), 1413 "c4faa472fbb0730370aaf34920381a09"),
1414 AcmReceiverBitExactnessOldApi::PlatformChecksum( 1414 AcmReceiverBitExactnessOldApi::PlatformChecksum(
1415 "d781cce1ab986b618d0da87226cdde30", 1415 "d781cce1ab986b618d0da87226cdde30",
1416 "d781cce1ab986b618d0da87226cdde30", 1416 "d781cce1ab986b618d0da87226cdde30",
1417 "1a1fe04dd12e755949987c8d729fb3e0", 1417 "8d6782b905c3230d4b0e3e83e1fc3439",
1418 "47b0b04f1d03076b857c86c72c2c298b"), 1418 "8b0126eab82d9e4e367ab33ded2f1a8e"),
1419 50, test::AcmReceiveTestOldApi::kStereoOutput); 1419 50, test::AcmReceiveTestOldApi::kStereoOutput);
1420 } 1420 }
1421 1421
1422 TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms_voip) { 1422 TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms_voip) {
1423 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960)); 1423 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960));
1424 // If not set, default will be kAudio in case of stereo. 1424 // If not set, default will be kAudio in case of stereo.
1425 EXPECT_EQ(0, send_test_->acm()->SetOpusApplication(kVoip)); 1425 EXPECT_EQ(0, send_test_->acm()->SetOpusApplication(kVoip));
1426 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum( 1426 Run(AcmReceiverBitExactnessOldApi::PlatformChecksum(
1427 "9b9e12bc3cc793740966e11cbfa8b35b", 1427 "9b9e12bc3cc793740966e11cbfa8b35b",
1428 "9b9e12bc3cc793740966e11cbfa8b35b", 1428 "9b9e12bc3cc793740966e11cbfa8b35b",
1429 "57412a4b5771d19ff03ec35deffe7067", 1429 "0de6249018fdd316c21086db84e10610",
1430 "7ad0bbefcaa87e23187bf4a56d2f3513"), 1430 "fd21a19b6b1e891f5daea6c4a299c254"),
1431 AcmReceiverBitExactnessOldApi::PlatformChecksum( 1431 AcmReceiverBitExactnessOldApi::PlatformChecksum(
1432 "c7340b1189652ab6b5e80dade7390cb4", 1432 "c7340b1189652ab6b5e80dade7390cb4",
1433 "c7340b1189652ab6b5e80dade7390cb4", 1433 "c7340b1189652ab6b5e80dade7390cb4",
1434 "cdfe85939c411d12b61701c566e22d26", 1434 "95612864c954ee63e28cc6eebad56626",
1435 "7a678fbe46df5bf0c67e88264a2d9275"), 1435 "49954b0d5a5f705a8798e7071b0c6f36"),
1436 50, test::AcmReceiveTestOldApi::kStereoOutput); 1436 50, test::AcmReceiveTestOldApi::kStereoOutput);
1437 } 1437 }
1438 1438
1439 // This test is for verifying the SetBitRate function. The bitrate is changed at 1439 // This test is for verifying the SetBitRate function. The bitrate is changed at
1440 // the beginning, and the number of generated bytes are checked. 1440 // the beginning, and the number of generated bytes are checked.
1441 class AcmSetBitRateOldApi : public ::testing::Test { 1441 class AcmSetBitRateOldApi : public ::testing::Test {
1442 protected: 1442 protected:
1443 static const int kTestDurationMs = 1000; 1443 static const int kTestDurationMs = 1000;
1444 1444
1445 // Sets up the test::AcmSendTest object. Returns true on success, otherwise 1445 // Sets up the test::AcmSendTest object. Returns true on success, otherwise
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 codec_frame_size_rtp_timestamps)); 1493 codec_frame_size_rtp_timestamps));
1494 } 1494 }
1495 1495
1496 rtc::scoped_ptr<test::AcmSendTestOldApi> send_test_; 1496 rtc::scoped_ptr<test::AcmSendTestOldApi> send_test_;
1497 rtc::scoped_ptr<test::InputAudioFile> audio_source_; 1497 rtc::scoped_ptr<test::InputAudioFile> audio_source_;
1498 }; 1498 };
1499 1499
1500 TEST_F(AcmSetBitRateOldApi, Opus_48khz_20ms_10kbps) { 1500 TEST_F(AcmSetBitRateOldApi, Opus_48khz_20ms_10kbps) {
1501 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1501 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1502 #if defined(WEBRTC_ANDROID) 1502 #if defined(WEBRTC_ANDROID)
1503 Run(10000, 9328); 1503 Run(10000, 9288);
1504 #else 1504 #else
1505 Run(10000, 9072); 1505 Run(10000, 9024);
1506 #endif // WEBRTC_ANDROID 1506 #endif // WEBRTC_ANDROID
1507 1507
1508 } 1508 }
1509 1509
1510 TEST_F(AcmSetBitRateOldApi, Opus_48khz_20ms_50kbps) { 1510 TEST_F(AcmSetBitRateOldApi, Opus_48khz_20ms_50kbps) {
1511 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1511 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1512 #if defined(WEBRTC_ANDROID) 1512 #if defined(WEBRTC_ANDROID)
1513 Run(50000, 47952); 1513 Run(50000, 47960);
1514 #else 1514 #else
1515 Run(50000, 49600); 1515 Run(50000, 49544);
1516 #endif // WEBRTC_ANDROID 1516 #endif // WEBRTC_ANDROID
1517 } 1517 }
1518 1518
1519 // The result on the Android platforms is inconsistent for this test case. 1519 // The result on the Android platforms is inconsistent for this test case.
1520 // On android_rel the result is different from android and android arm64 rel. 1520 // On android_rel the result is different from android and android arm64 rel.
1521 #if defined(WEBRTC_ANDROID) 1521 #if defined(WEBRTC_ANDROID)
1522 #define MAYBE_Opus_48khz_20ms_100kbps DISABLED_Opus_48khz_20ms_100kbps 1522 #define MAYBE_Opus_48khz_20ms_100kbps DISABLED_Opus_48khz_20ms_100kbps
1523 #else 1523 #else
1524 #define MAYBE_Opus_48khz_20ms_100kbps Opus_48khz_20ms_100kbps 1524 #define MAYBE_Opus_48khz_20ms_100kbps Opus_48khz_20ms_100kbps
1525 #endif 1525 #endif
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 EXPECT_EQ(expected_after_switch_bits, nr_bytes_after * 8); 1585 EXPECT_EQ(expected_after_switch_bits, nr_bytes_after * 8);
1586 } 1586 }
1587 1587
1588 uint32_t sampling_freq_hz_; 1588 uint32_t sampling_freq_hz_;
1589 uint32_t frame_size_samples_; 1589 uint32_t frame_size_samples_;
1590 }; 1590 };
1591 1591
1592 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_10kbps) { 1592 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_10kbps) {
1593 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1593 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1594 #if defined(WEBRTC_ANDROID) 1594 #if defined(WEBRTC_ANDROID)
1595 Run(10000, 32200, 5496); 1595 Run(10000, 32200, 5176);
1596 #else 1596 #else
1597 Run(10000, 32200, 5432); 1597 Run(10000, 32200, 5456);
1598 #endif // WEBRTC_ANDROID 1598 #endif // WEBRTC_ANDROID
1599 } 1599 }
1600 1600
1601 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_50kbps) { 1601 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_50kbps) {
1602 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1602 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1603 #if defined(WEBRTC_ANDROID) 1603 #if defined(WEBRTC_ANDROID)
1604 Run(50000, 32200, 24912); 1604 Run(50000, 32200, 24768);
1605 #else 1605 #else
1606 Run(50000, 32200, 24792); 1606 Run(50000, 32200, 24848);
1607 #endif // WEBRTC_ANDROID 1607 #endif // WEBRTC_ANDROID
1608 } 1608 }
1609 1609
1610 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_100kbps) { 1610 TEST_F(AcmChangeBitRateOldApi, Opus_48khz_20ms_100kbps) {
1611 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960)); 1611 ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 1, 107, 960, 960));
1612 #if defined(WEBRTC_ANDROID) 1612 #if defined(WEBRTC_ANDROID)
1613 Run(100000, 32200, 51480); 1613 Run(100000, 32200, 51480);
1614 #else 1614 #else
1615 Run(100000, 32200, 50584); 1615 Run(100000, 32200, 50584);
1616 #endif // WEBRTC_ANDROID 1616 #endif // WEBRTC_ANDROID
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 Run(16000, 8000, 1000); 1780 Run(16000, 8000, 1000);
1781 } 1781 }
1782 1782
1783 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1783 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1784 Run(8000, 16000, 1000); 1784 Run(8000, 16000, 1000);
1785 } 1785 }
1786 1786
1787 #endif 1787 #endif
1788 1788
1789 } // namespace webrtc 1789 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/build/common.gypi ('k') | webrtc/modules/audio_coding/codecs/opus/opus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698