| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 size_t* payload_len) { | 507 size_t* payload_len) { |
| 508 rtp_info->header.sequenceNumber = frame_index; | 508 rtp_info->header.sequenceNumber = frame_index; |
| 509 rtp_info->header.timestamp = timestamp; | 509 rtp_info->header.timestamp = timestamp; |
| 510 rtp_info->header.ssrc = 0x1234; // Just an arbitrary SSRC. | 510 rtp_info->header.ssrc = 0x1234; // Just an arbitrary SSRC. |
| 511 rtp_info->header.payloadType = 98; // WB CNG. | 511 rtp_info->header.payloadType = 98; // WB CNG. |
| 512 rtp_info->header.markerBit = 0; | 512 rtp_info->header.markerBit = 0; |
| 513 payload[0] = 64; // Noise level -64 dBov, quite arbitrarily chosen. | 513 payload[0] = 64; // Noise level -64 dBov, quite arbitrarily chosen. |
| 514 *payload_len = 1; // Only noise level, no spectral parameters. | 514 *payload_len = 1; // Only noise level, no spectral parameters. |
| 515 } | 515 } |
| 516 | 516 |
| 517 // Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5820 | |
| 518 #if !defined(WEBRTC_IOS) && defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ | 517 #if !defined(WEBRTC_IOS) && defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ |
| 519 (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \ | 518 (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \ |
| 520 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) && \ | 519 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) && \ |
| 521 !defined(WEBRTC_ARCH_ARM64) && !defined(UNDEFINED_SANITIZER) | 520 !defined(WEBRTC_ARCH_ARM64) |
| 522 #define MAYBE_TestBitExactness TestBitExactness | 521 #define MAYBE_TestBitExactness TestBitExactness |
| 523 #else | 522 #else |
| 524 #define MAYBE_TestBitExactness DISABLED_TestBitExactness | 523 #define MAYBE_TestBitExactness DISABLED_TestBitExactness |
| 525 #endif | 524 #endif |
| 526 TEST_F(NetEqDecodingTest, MAYBE_TestBitExactness) { | 525 TEST_F(NetEqDecodingTest, MAYBE_TestBitExactness) { |
| 527 const std::string input_rtp_file = | 526 const std::string input_rtp_file = |
| 528 webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp"); | 527 webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp"); |
| 529 // Note that neteq4_universal_ref.pcm and neteq4_universal_ref_win_32.pcm | 528 // Note that neteq4_universal_ref.pcm and neteq4_universal_ref_win_32.pcm |
| 530 // are identical. The latter could have been removed, but if clients still | 529 // are identical. The latter could have been removed, but if clients still |
| 531 // have a copy of the file, the test will fail. | 530 // have a copy of the file, the test will fail. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 546 if (FLAGS_gen_ref) { | 545 if (FLAGS_gen_ref) { |
| 547 DecodeAndCompare(input_rtp_file, "", "", ""); | 546 DecodeAndCompare(input_rtp_file, "", "", ""); |
| 548 } else { | 547 } else { |
| 549 DecodeAndCompare(input_rtp_file, | 548 DecodeAndCompare(input_rtp_file, |
| 550 input_ref_file, | 549 input_ref_file, |
| 551 network_stat_ref_file, | 550 network_stat_ref_file, |
| 552 rtcp_stat_ref_file); | 551 rtcp_stat_ref_file); |
| 553 } | 552 } |
| 554 } | 553 } |
| 555 | 554 |
| 556 // Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5820 | |
| 557 #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID) && \ | 555 #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID) && \ |
| 558 defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ | 556 defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ |
| 559 defined(WEBRTC_CODEC_OPUS) && !defined(UNDEFINED_SANITIZER) | 557 defined(WEBRTC_CODEC_OPUS) |
| 560 #define MAYBE_TestOpusBitExactness TestOpusBitExactness | 558 #define MAYBE_TestOpusBitExactness TestOpusBitExactness |
| 561 #else | 559 #else |
| 562 #define MAYBE_TestOpusBitExactness DISABLED_TestOpusBitExactness | 560 #define MAYBE_TestOpusBitExactness DISABLED_TestOpusBitExactness |
| 563 #endif | 561 #endif |
| 564 TEST_F(NetEqDecodingTest, MAYBE_TestOpusBitExactness) { | 562 TEST_F(NetEqDecodingTest, MAYBE_TestOpusBitExactness) { |
| 565 const std::string input_rtp_file = | 563 const std::string input_rtp_file = |
| 566 webrtc::test::ResourcePath("audio_coding/neteq_opus", "rtp"); | 564 webrtc::test::ResourcePath("audio_coding/neteq_opus", "rtp"); |
| 567 const std::string input_ref_file = | 565 const std::string input_ref_file = |
| 568 // The pcm files were generated by using Opus v1.1.2 to decode the RTC | 566 // The pcm files were generated by using Opus v1.1.2 to decode the RTC |
| 569 // file generated by Opus v1.1 | 567 // file generated by Opus v1.1 |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 timestamp += kSamples; | 1573 timestamp += kSamples; |
| 1576 | 1574 |
| 1577 // Pull audio once. | 1575 // Pull audio once. |
| 1578 ASSERT_EQ(0, neteq_->GetAudio(&out_frame_)); | 1576 ASSERT_EQ(0, neteq_->GetAudio(&out_frame_)); |
| 1579 ASSERT_EQ(kBlockSize16kHz, out_frame_.samples_per_channel_); | 1577 ASSERT_EQ(kBlockSize16kHz, out_frame_.samples_per_channel_); |
| 1580 } | 1578 } |
| 1581 // Verify speech output. | 1579 // Verify speech output. |
| 1582 EXPECT_EQ(AudioFrame::kNormalSpeech, out_frame_.speech_type_); | 1580 EXPECT_EQ(AudioFrame::kNormalSpeech, out_frame_.speech_type_); |
| 1583 } | 1581 } |
| 1584 } // namespace webrtc | 1582 } // namespace webrtc |
| OLD | NEW |