| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 packet_->payload_length_bytes(), | 346 packet_->payload_length_bytes(), |
| 347 static_cast<uint32_t>( | 347 static_cast<uint32_t>( |
| 348 packet_->time_ms() * (output_sample_rate_ / 1000)))); | 348 packet_->time_ms() * (output_sample_rate_ / 1000)))); |
| 349 } | 349 } |
| 350 // Get next packet. | 350 // Get next packet. |
| 351 packet_.reset(rtp_source_->NextPacket()); | 351 packet_.reset(rtp_source_->NextPacket()); |
| 352 } | 352 } |
| 353 | 353 |
| 354 // Get audio from NetEq. | 354 // Get audio from NetEq. |
| 355 NetEqOutputType type; | 355 NetEqOutputType type; |
| 356 int num_channels; | 356 size_t num_channels; |
| 357 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, out_len, | 357 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, out_len, |
| 358 &num_channels, &type)); | 358 &num_channels, &type)); |
| 359 ASSERT_TRUE((*out_len == kBlockSize8kHz) || | 359 ASSERT_TRUE((*out_len == kBlockSize8kHz) || |
| 360 (*out_len == kBlockSize16kHz) || | 360 (*out_len == kBlockSize16kHz) || |
| 361 (*out_len == kBlockSize32kHz)); | 361 (*out_len == kBlockSize32kHz)); |
| 362 output_sample_rate_ = static_cast<int>(*out_len / 10 * 1000); | 362 output_sample_rate_ = static_cast<int>(*out_len / 10 * 1000); |
| 363 | 363 |
| 364 // Increase time. | 364 // Increase time. |
| 365 sim_clock_ += kTimeStepMs; | 365 sim_clock_ += kTimeStepMs; |
| 366 } | 366 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 rtp_info.header.payloadType = 94; // PCM16b WB codec. | 493 rtp_info.header.payloadType = 94; // PCM16b WB codec. |
| 494 rtp_info.header.markerBit = 0; | 494 rtp_info.header.markerBit = 0; |
| 495 ASSERT_EQ(0, neteq_->InsertPacket( | 495 ASSERT_EQ(0, neteq_->InsertPacket( |
| 496 rtp_info, | 496 rtp_info, |
| 497 reinterpret_cast<uint8_t*>(payload), | 497 reinterpret_cast<uint8_t*>(payload), |
| 498 kPayloadBytes, 0)); | 498 kPayloadBytes, 0)); |
| 499 } | 499 } |
| 500 // Pull out all data. | 500 // Pull out all data. |
| 501 for (size_t i = 0; i < num_frames; ++i) { | 501 for (size_t i = 0; i < num_frames; ++i) { |
| 502 size_t out_len; | 502 size_t out_len; |
| 503 int num_channels; | 503 size_t num_channels; |
| 504 NetEqOutputType type; | 504 NetEqOutputType type; |
| 505 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, | 505 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, |
| 506 &num_channels, &type)); | 506 &num_channels, &type)); |
| 507 ASSERT_EQ(kBlockSize16kHz, out_len); | 507 ASSERT_EQ(kBlockSize16kHz, out_len); |
| 508 } | 508 } |
| 509 | 509 |
| 510 std::vector<int> waiting_times; | 510 std::vector<int> waiting_times; |
| 511 neteq_->WaitingTimes(&waiting_times); | 511 neteq_->WaitingTimes(&waiting_times); |
| 512 EXPECT_EQ(num_frames, waiting_times.size()); | 512 EXPECT_EQ(num_frames, waiting_times.size()); |
| 513 // Since all frames are dumped into NetEQ at once, but pulled out with 10 ms | 513 // Since all frames are dumped into NetEQ at once, but pulled out with 10 ms |
| (...skipping 17 matching lines...) Expand all Loading... |
| 531 rtp_info.header.sequenceNumber = i; | 531 rtp_info.header.sequenceNumber = i; |
| 532 rtp_info.header.timestamp = i * kSamples; | 532 rtp_info.header.timestamp = i * kSamples; |
| 533 rtp_info.header.ssrc = 0x1235; // Just an arbitrary SSRC. | 533 rtp_info.header.ssrc = 0x1235; // Just an arbitrary SSRC. |
| 534 rtp_info.header.payloadType = 94; // PCM16b WB codec. | 534 rtp_info.header.payloadType = 94; // PCM16b WB codec. |
| 535 rtp_info.header.markerBit = 0; | 535 rtp_info.header.markerBit = 0; |
| 536 ASSERT_EQ(0, neteq_->InsertPacket( | 536 ASSERT_EQ(0, neteq_->InsertPacket( |
| 537 rtp_info, | 537 rtp_info, |
| 538 reinterpret_cast<uint8_t*>(payload), | 538 reinterpret_cast<uint8_t*>(payload), |
| 539 kPayloadBytes, 0)); | 539 kPayloadBytes, 0)); |
| 540 size_t out_len; | 540 size_t out_len; |
| 541 int num_channels; | 541 size_t num_channels; |
| 542 NetEqOutputType type; | 542 NetEqOutputType type; |
| 543 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, | 543 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, |
| 544 &num_channels, &type)); | 544 &num_channels, &type)); |
| 545 ASSERT_EQ(kBlockSize16kHz, out_len); | 545 ASSERT_EQ(kBlockSize16kHz, out_len); |
| 546 } | 546 } |
| 547 | 547 |
| 548 neteq_->WaitingTimes(&waiting_times); | 548 neteq_->WaitingTimes(&waiting_times); |
| 549 EXPECT_EQ(100u, waiting_times.size()); | 549 EXPECT_EQ(100u, waiting_times.size()); |
| 550 } | 550 } |
| 551 | 551 |
| 552 TEST_F(NetEqDecodingTest, TestAverageInterArrivalTimeNegative) { | 552 TEST_F(NetEqDecodingTest, TestAverageInterArrivalTimeNegative) { |
| 553 const int kNumFrames = 3000; // Needed for convergence. | 553 const int kNumFrames = 3000; // Needed for convergence. |
| 554 int frame_index = 0; | 554 int frame_index = 0; |
| 555 const size_t kSamples = 10 * 16; | 555 const size_t kSamples = 10 * 16; |
| 556 const size_t kPayloadBytes = kSamples * 2; | 556 const size_t kPayloadBytes = kSamples * 2; |
| 557 while (frame_index < kNumFrames) { | 557 while (frame_index < kNumFrames) { |
| 558 // Insert one packet each time, except every 10th time where we insert two | 558 // Insert one packet each time, except every 10th time where we insert two |
| 559 // packets at once. This will create a negative clock-drift of approx. 10%. | 559 // packets at once. This will create a negative clock-drift of approx. 10%. |
| 560 int num_packets = (frame_index % 10 == 0 ? 2 : 1); | 560 int num_packets = (frame_index % 10 == 0 ? 2 : 1); |
| 561 for (int n = 0; n < num_packets; ++n) { | 561 for (int n = 0; n < num_packets; ++n) { |
| 562 uint8_t payload[kPayloadBytes] = {0}; | 562 uint8_t payload[kPayloadBytes] = {0}; |
| 563 WebRtcRTPHeader rtp_info; | 563 WebRtcRTPHeader rtp_info; |
| 564 PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info); | 564 PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info); |
| 565 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); | 565 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); |
| 566 ++frame_index; | 566 ++frame_index; |
| 567 } | 567 } |
| 568 | 568 |
| 569 // Pull out data once. | 569 // Pull out data once. |
| 570 size_t out_len; | 570 size_t out_len; |
| 571 int num_channels; | 571 size_t num_channels; |
| 572 NetEqOutputType type; | 572 NetEqOutputType type; |
| 573 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, | 573 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, |
| 574 &num_channels, &type)); | 574 &num_channels, &type)); |
| 575 ASSERT_EQ(kBlockSize16kHz, out_len); | 575 ASSERT_EQ(kBlockSize16kHz, out_len); |
| 576 } | 576 } |
| 577 | 577 |
| 578 NetEqNetworkStatistics network_stats; | 578 NetEqNetworkStatistics network_stats; |
| 579 ASSERT_EQ(0, neteq_->NetworkStatistics(&network_stats)); | 579 ASSERT_EQ(0, neteq_->NetworkStatistics(&network_stats)); |
| 580 EXPECT_EQ(-103196, network_stats.clockdrift_ppm); | 580 EXPECT_EQ(-103196, network_stats.clockdrift_ppm); |
| 581 } | 581 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 592 for (int n = 0; n < num_packets; ++n) { | 592 for (int n = 0; n < num_packets; ++n) { |
| 593 uint8_t payload[kPayloadBytes] = {0}; | 593 uint8_t payload[kPayloadBytes] = {0}; |
| 594 WebRtcRTPHeader rtp_info; | 594 WebRtcRTPHeader rtp_info; |
| 595 PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info); | 595 PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info); |
| 596 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); | 596 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); |
| 597 ++frame_index; | 597 ++frame_index; |
| 598 } | 598 } |
| 599 | 599 |
| 600 // Pull out data once. | 600 // Pull out data once. |
| 601 size_t out_len; | 601 size_t out_len; |
| 602 int num_channels; | 602 size_t num_channels; |
| 603 NetEqOutputType type; | 603 NetEqOutputType type; |
| 604 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, | 604 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, |
| 605 &num_channels, &type)); | 605 &num_channels, &type)); |
| 606 ASSERT_EQ(kBlockSize16kHz, out_len); | 606 ASSERT_EQ(kBlockSize16kHz, out_len); |
| 607 } | 607 } |
| 608 | 608 |
| 609 NetEqNetworkStatistics network_stats; | 609 NetEqNetworkStatistics network_stats; |
| 610 ASSERT_EQ(0, neteq_->NetworkStatistics(&network_stats)); | 610 ASSERT_EQ(0, neteq_->NetworkStatistics(&network_stats)); |
| 611 EXPECT_EQ(110946, network_stats.clockdrift_ppm); | 611 EXPECT_EQ(110946, network_stats.clockdrift_ppm); |
| 612 } | 612 } |
| 613 | 613 |
| 614 void NetEqDecodingTest::LongCngWithClockDrift(double drift_factor, | 614 void NetEqDecodingTest::LongCngWithClockDrift(double drift_factor, |
| 615 double network_freeze_ms, | 615 double network_freeze_ms, |
| 616 bool pull_audio_during_freeze, | 616 bool pull_audio_during_freeze, |
| 617 int delay_tolerance_ms, | 617 int delay_tolerance_ms, |
| 618 int max_time_to_speech_ms) { | 618 int max_time_to_speech_ms) { |
| 619 uint16_t seq_no = 0; | 619 uint16_t seq_no = 0; |
| 620 uint32_t timestamp = 0; | 620 uint32_t timestamp = 0; |
| 621 const int kFrameSizeMs = 30; | 621 const int kFrameSizeMs = 30; |
| 622 const size_t kSamples = kFrameSizeMs * 16; | 622 const size_t kSamples = kFrameSizeMs * 16; |
| 623 const size_t kPayloadBytes = kSamples * 2; | 623 const size_t kPayloadBytes = kSamples * 2; |
| 624 double next_input_time_ms = 0.0; | 624 double next_input_time_ms = 0.0; |
| 625 double t_ms; | 625 double t_ms; |
| 626 size_t out_len; | 626 size_t out_len; |
| 627 int num_channels; | 627 size_t num_channels; |
| 628 NetEqOutputType type; | 628 NetEqOutputType type; |
| 629 | 629 |
| 630 // Insert speech for 5 seconds. | 630 // Insert speech for 5 seconds. |
| 631 const int kSpeechDurationMs = 5000; | 631 const int kSpeechDurationMs = 5000; |
| 632 for (t_ms = 0; t_ms < kSpeechDurationMs; t_ms += 10) { | 632 for (t_ms = 0; t_ms < kSpeechDurationMs; t_ms += 10) { |
| 633 // Each turn in this for loop is 10 ms. | 633 // Each turn in this for loop is 10 ms. |
| 634 while (next_input_time_ms <= t_ms) { | 634 while (next_input_time_ms <= t_ms) { |
| 635 // Insert one 30 ms speech frame. | 635 // Insert one 30 ms speech frame. |
| 636 uint8_t payload[kPayloadBytes] = {0}; | 636 uint8_t payload[kPayloadBytes] = {0}; |
| 637 WebRtcRTPHeader rtp_info; | 637 WebRtcRTPHeader rtp_info; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 WebRtcRTPHeader rtp_info; | 847 WebRtcRTPHeader rtp_info; |
| 848 PopulateRtpInfo(0, 0, &rtp_info); | 848 PopulateRtpInfo(0, 0, &rtp_info); |
| 849 rtp_info.header.payloadType = 103; // iSAC, but the payload is invalid. | 849 rtp_info.header.payloadType = 103; // iSAC, but the payload is invalid. |
| 850 EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); | 850 EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); |
| 851 NetEqOutputType type; | 851 NetEqOutputType type; |
| 852 // Set all of |out_data_| to 1, and verify that it was set to 0 by the call | 852 // Set all of |out_data_| to 1, and verify that it was set to 0 by the call |
| 853 // to GetAudio. | 853 // to GetAudio. |
| 854 for (size_t i = 0; i < kMaxBlockSize; ++i) { | 854 for (size_t i = 0; i < kMaxBlockSize; ++i) { |
| 855 out_data_[i] = 1; | 855 out_data_[i] = 1; |
| 856 } | 856 } |
| 857 int num_channels; | 857 size_t num_channels; |
| 858 size_t samples_per_channel; | 858 size_t samples_per_channel; |
| 859 EXPECT_EQ(NetEq::kFail, | 859 EXPECT_EQ(NetEq::kFail, |
| 860 neteq_->GetAudio(kMaxBlockSize, out_data_, | 860 neteq_->GetAudio(kMaxBlockSize, out_data_, |
| 861 &samples_per_channel, &num_channels, &type)); | 861 &samples_per_channel, &num_channels, &type)); |
| 862 // Verify that there is a decoder error to check. | 862 // Verify that there is a decoder error to check. |
| 863 EXPECT_EQ(NetEq::kDecoderErrorCode, neteq_->LastError()); | 863 EXPECT_EQ(NetEq::kDecoderErrorCode, neteq_->LastError()); |
| 864 // Code 6730 is an iSAC error code. | 864 // Code 6730 is an iSAC error code. |
| 865 EXPECT_EQ(6730, neteq_->LastDecoderError()); | 865 EXPECT_EQ(6730, neteq_->LastDecoderError()); |
| 866 // Verify that the first 160 samples are set to 0, and that the remaining | 866 // Verify that the first 160 samples are set to 0, and that the remaining |
| 867 // samples are left unmodified. | 867 // samples are left unmodified. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 880 } | 880 } |
| 881 } | 881 } |
| 882 | 882 |
| 883 TEST_F(NetEqDecodingTest, GetAudioBeforeInsertPacket) { | 883 TEST_F(NetEqDecodingTest, GetAudioBeforeInsertPacket) { |
| 884 NetEqOutputType type; | 884 NetEqOutputType type; |
| 885 // Set all of |out_data_| to 1, and verify that it was set to 0 by the call | 885 // Set all of |out_data_| to 1, and verify that it was set to 0 by the call |
| 886 // to GetAudio. | 886 // to GetAudio. |
| 887 for (size_t i = 0; i < kMaxBlockSize; ++i) { | 887 for (size_t i = 0; i < kMaxBlockSize; ++i) { |
| 888 out_data_[i] = 1; | 888 out_data_[i] = 1; |
| 889 } | 889 } |
| 890 int num_channels; | 890 size_t num_channels; |
| 891 size_t samples_per_channel; | 891 size_t samples_per_channel; |
| 892 EXPECT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, | 892 EXPECT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, |
| 893 &samples_per_channel, | 893 &samples_per_channel, |
| 894 &num_channels, &type)); | 894 &num_channels, &type)); |
| 895 // Verify that the first block of samples is set to 0. | 895 // Verify that the first block of samples is set to 0. |
| 896 static const int kExpectedOutputLength = | 896 static const int kExpectedOutputLength = |
| 897 kInitSampleRateHz / 100; // 10 ms at initial sample rate. | 897 kInitSampleRateHz / 100; // 10 ms at initial sample rate. |
| 898 for (int i = 0; i < kExpectedOutputLength; ++i) { | 898 for (int i = 0; i < kExpectedOutputLength; ++i) { |
| 899 std::ostringstream ss; | 899 std::ostringstream ss; |
| 900 ss << "i = " << i; | 900 ss << "i = " << i; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), | 934 webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), |
| 935 10 * sampling_rate_hz, // Max 10 seconds loop length. | 935 10 * sampling_rate_hz, // Max 10 seconds loop length. |
| 936 expected_samples_per_channel)); | 936 expected_samples_per_channel)); |
| 937 | 937 |
| 938 // Payload of 10 ms of PCM16 32 kHz. | 938 // Payload of 10 ms of PCM16 32 kHz. |
| 939 uint8_t payload[kBlockSize32kHz * sizeof(int16_t)]; | 939 uint8_t payload[kBlockSize32kHz * sizeof(int16_t)]; |
| 940 WebRtcRTPHeader rtp_info; | 940 WebRtcRTPHeader rtp_info; |
| 941 PopulateRtpInfo(0, 0, &rtp_info); | 941 PopulateRtpInfo(0, 0, &rtp_info); |
| 942 rtp_info.header.payloadType = payload_type; | 942 rtp_info.header.payloadType = payload_type; |
| 943 | 943 |
| 944 int number_channels = 0; | 944 size_t number_channels = 0; |
| 945 size_t samples_per_channel = 0; | 945 size_t samples_per_channel = 0; |
| 946 | 946 |
| 947 uint32_t receive_timestamp = 0; | 947 uint32_t receive_timestamp = 0; |
| 948 for (int n = 0; n < 10; ++n) { // Insert few packets and get audio. | 948 for (int n = 0; n < 10; ++n) { // Insert few packets and get audio. |
| 949 size_t enc_len_bytes = WebRtcPcm16b_Encode( | 949 size_t enc_len_bytes = WebRtcPcm16b_Encode( |
| 950 input.GetNextBlock(), expected_samples_per_channel, payload); | 950 input.GetNextBlock(), expected_samples_per_channel, payload); |
| 951 ASSERT_EQ(enc_len_bytes, expected_samples_per_channel * 2); | 951 ASSERT_EQ(enc_len_bytes, expected_samples_per_channel * 2); |
| 952 | 952 |
| 953 number_channels = 0; | 953 number_channels = 0; |
| 954 samples_per_channel = 0; | 954 samples_per_channel = 0; |
| 955 ASSERT_EQ(0, | 955 ASSERT_EQ(0, |
| 956 neteq_->InsertPacket(rtp_info, payload, enc_len_bytes, | 956 neteq_->InsertPacket(rtp_info, payload, enc_len_bytes, |
| 957 receive_timestamp)); | 957 receive_timestamp)); |
| 958 ASSERT_EQ(0, | 958 ASSERT_EQ(0, |
| 959 neteq_->GetAudio(kBlockSize32kHz, | 959 neteq_->GetAudio(kBlockSize32kHz, |
| 960 output, | 960 output, |
| 961 &samples_per_channel, | 961 &samples_per_channel, |
| 962 &number_channels, | 962 &number_channels, |
| 963 &type)); | 963 &type)); |
| 964 ASSERT_EQ(1, number_channels); | 964 ASSERT_EQ(1u, number_channels); |
| 965 ASSERT_EQ(expected_samples_per_channel, samples_per_channel); | 965 ASSERT_EQ(expected_samples_per_channel, samples_per_channel); |
| 966 ASSERT_EQ(kOutputNormal, type); | 966 ASSERT_EQ(kOutputNormal, type); |
| 967 | 967 |
| 968 // Next packet. | 968 // Next packet. |
| 969 rtp_info.header.timestamp += expected_samples_per_channel; | 969 rtp_info.header.timestamp += expected_samples_per_channel; |
| 970 rtp_info.header.sequenceNumber++; | 970 rtp_info.header.sequenceNumber++; |
| 971 receive_timestamp += expected_samples_per_channel; | 971 receive_timestamp += expected_samples_per_channel; |
| 972 } | 972 } |
| 973 | 973 |
| 974 number_channels = 0; | 974 number_channels = 0; |
| 975 samples_per_channel = 0; | 975 samples_per_channel = 0; |
| 976 | 976 |
| 977 // Get audio without inserting packets, expecting PLC and PLC-to-CNG. Pull | 977 // Get audio without inserting packets, expecting PLC and PLC-to-CNG. Pull |
| 978 // one frame without checking speech-type. This is the first frame pulled | 978 // one frame without checking speech-type. This is the first frame pulled |
| 979 // without inserting any packet, and might not be labeled as PLC. | 979 // without inserting any packet, and might not be labeled as PLC. |
| 980 ASSERT_EQ(0, | 980 ASSERT_EQ(0, |
| 981 neteq_->GetAudio(kBlockSize32kHz, | 981 neteq_->GetAudio(kBlockSize32kHz, |
| 982 output, | 982 output, |
| 983 &samples_per_channel, | 983 &samples_per_channel, |
| 984 &number_channels, | 984 &number_channels, |
| 985 &type)); | 985 &type)); |
| 986 ASSERT_EQ(1, number_channels); | 986 ASSERT_EQ(1u, number_channels); |
| 987 ASSERT_EQ(expected_samples_per_channel, samples_per_channel); | 987 ASSERT_EQ(expected_samples_per_channel, samples_per_channel); |
| 988 | 988 |
| 989 // To be able to test the fading of background noise we need at lease to | 989 // To be able to test the fading of background noise we need at lease to |
| 990 // pull 611 frames. | 990 // pull 611 frames. |
| 991 const int kFadingThreshold = 611; | 991 const int kFadingThreshold = 611; |
| 992 | 992 |
| 993 // Test several CNG-to-PLC packet for the expected behavior. The number 20 | 993 // Test several CNG-to-PLC packet for the expected behavior. The number 20 |
| 994 // is arbitrary, but sufficiently large to test enough number of frames. | 994 // is arbitrary, but sufficiently large to test enough number of frames. |
| 995 const int kNumPlcToCngTestFrames = 20; | 995 const int kNumPlcToCngTestFrames = 20; |
| 996 bool plc_to_cng = false; | 996 bool plc_to_cng = false; |
| 997 for (int n = 0; n < kFadingThreshold + kNumPlcToCngTestFrames; ++n) { | 997 for (int n = 0; n < kFadingThreshold + kNumPlcToCngTestFrames; ++n) { |
| 998 number_channels = 0; | 998 number_channels = 0; |
| 999 samples_per_channel = 0; | 999 samples_per_channel = 0; |
| 1000 memset(output, 1, sizeof(output)); // Set to non-zero. | 1000 memset(output, 1, sizeof(output)); // Set to non-zero. |
| 1001 ASSERT_EQ(0, | 1001 ASSERT_EQ(0, |
| 1002 neteq_->GetAudio(kBlockSize32kHz, | 1002 neteq_->GetAudio(kBlockSize32kHz, |
| 1003 output, | 1003 output, |
| 1004 &samples_per_channel, | 1004 &samples_per_channel, |
| 1005 &number_channels, | 1005 &number_channels, |
| 1006 &type)); | 1006 &type)); |
| 1007 ASSERT_EQ(1, number_channels); | 1007 ASSERT_EQ(1u, number_channels); |
| 1008 ASSERT_EQ(expected_samples_per_channel, samples_per_channel); | 1008 ASSERT_EQ(expected_samples_per_channel, samples_per_channel); |
| 1009 if (type == kOutputPLCtoCNG) { | 1009 if (type == kOutputPLCtoCNG) { |
| 1010 plc_to_cng = true; | 1010 plc_to_cng = true; |
| 1011 double sum_squared = 0; | 1011 double sum_squared = 0; |
| 1012 for (size_t k = 0; k < number_channels * samples_per_channel; ++k) | 1012 for (size_t k = 0; k < number_channels * samples_per_channel; ++k) |
| 1013 sum_squared += output[k] * output[k]; | 1013 sum_squared += output[k] * output[k]; |
| 1014 TestCondition(sum_squared, n > kFadingThreshold); | 1014 TestCondition(sum_squared, n > kFadingThreshold); |
| 1015 } else { | 1015 } else { |
| 1016 EXPECT_EQ(kOutputPLC, type); | 1016 EXPECT_EQ(kOutputPLC, type); |
| 1017 } | 1017 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 const size_t kPayloadBytes = kBlockSize16kHz * sizeof(int16_t); | 1160 const size_t kPayloadBytes = kBlockSize16kHz * sizeof(int16_t); |
| 1161 uint8_t payload[kPayloadBytes]; | 1161 uint8_t payload[kPayloadBytes]; |
| 1162 int16_t decoded[kBlockSize16kHz]; | 1162 int16_t decoded[kBlockSize16kHz]; |
| 1163 int algorithmic_frame_delay = algorithmic_delay_ms_ / 10 + 1; | 1163 int algorithmic_frame_delay = algorithmic_delay_ms_ / 10 + 1; |
| 1164 for (size_t n = 0; n < kPayloadBytes; ++n) { | 1164 for (size_t n = 0; n < kPayloadBytes; ++n) { |
| 1165 payload[n] = (rand() & 0xF0) + 1; // Non-zero random sequence. | 1165 payload[n] = (rand() & 0xF0) + 1; // Non-zero random sequence. |
| 1166 } | 1166 } |
| 1167 // Insert some packets which decode to noise. We are not interested in | 1167 // Insert some packets which decode to noise. We are not interested in |
| 1168 // actual decoded values. | 1168 // actual decoded values. |
| 1169 NetEqOutputType output_type; | 1169 NetEqOutputType output_type; |
| 1170 int num_channels; | 1170 size_t num_channels; |
| 1171 size_t samples_per_channel; | 1171 size_t samples_per_channel; |
| 1172 uint32_t receive_timestamp = 0; | 1172 uint32_t receive_timestamp = 0; |
| 1173 for (int n = 0; n < 100; ++n) { | 1173 for (int n = 0; n < 100; ++n) { |
| 1174 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, | 1174 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, |
| 1175 receive_timestamp)); | 1175 receive_timestamp)); |
| 1176 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, | 1176 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, |
| 1177 &samples_per_channel, &num_channels, | 1177 &samples_per_channel, &num_channels, |
| 1178 &output_type)); | 1178 &output_type)); |
| 1179 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); | 1179 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); |
| 1180 ASSERT_EQ(1, num_channels); | 1180 ASSERT_EQ(1u, num_channels); |
| 1181 | 1181 |
| 1182 rtp_info.header.sequenceNumber++; | 1182 rtp_info.header.sequenceNumber++; |
| 1183 rtp_info.header.timestamp += kBlockSize16kHz; | 1183 rtp_info.header.timestamp += kBlockSize16kHz; |
| 1184 receive_timestamp += kBlockSize16kHz; | 1184 receive_timestamp += kBlockSize16kHz; |
| 1185 } | 1185 } |
| 1186 const int kNumSyncPackets = 10; | 1186 const int kNumSyncPackets = 10; |
| 1187 | 1187 |
| 1188 // Make sure sufficient number of sync packets are inserted that we can | 1188 // Make sure sufficient number of sync packets are inserted that we can |
| 1189 // conduct a test. | 1189 // conduct a test. |
| 1190 ASSERT_GT(kNumSyncPackets, algorithmic_frame_delay); | 1190 ASSERT_GT(kNumSyncPackets, algorithmic_frame_delay); |
| 1191 // Insert sync-packets, the decoded sequence should be all-zero. | 1191 // Insert sync-packets, the decoded sequence should be all-zero. |
| 1192 for (int n = 0; n < kNumSyncPackets; ++n) { | 1192 for (int n = 0; n < kNumSyncPackets; ++n) { |
| 1193 ASSERT_EQ(0, neteq_->InsertSyncPacket(rtp_info, receive_timestamp)); | 1193 ASSERT_EQ(0, neteq_->InsertSyncPacket(rtp_info, receive_timestamp)); |
| 1194 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, | 1194 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, |
| 1195 &samples_per_channel, &num_channels, | 1195 &samples_per_channel, &num_channels, |
| 1196 &output_type)); | 1196 &output_type)); |
| 1197 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); | 1197 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); |
| 1198 ASSERT_EQ(1, num_channels); | 1198 ASSERT_EQ(1u, num_channels); |
| 1199 if (n > algorithmic_frame_delay) { | 1199 if (n > algorithmic_frame_delay) { |
| 1200 EXPECT_TRUE(IsAllZero(decoded, samples_per_channel * num_channels)); | 1200 EXPECT_TRUE(IsAllZero(decoded, samples_per_channel * num_channels)); |
| 1201 } | 1201 } |
| 1202 rtp_info.header.sequenceNumber++; | 1202 rtp_info.header.sequenceNumber++; |
| 1203 rtp_info.header.timestamp += kBlockSize16kHz; | 1203 rtp_info.header.timestamp += kBlockSize16kHz; |
| 1204 receive_timestamp += kBlockSize16kHz; | 1204 receive_timestamp += kBlockSize16kHz; |
| 1205 } | 1205 } |
| 1206 | 1206 |
| 1207 // We insert regular packets, if sync packet are not correctly buffered then | 1207 // We insert regular packets, if sync packet are not correctly buffered then |
| 1208 // network statistics would show some packet loss. | 1208 // network statistics would show some packet loss. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1238 PopulateRtpInfo(0, 0, &rtp_info); | 1238 PopulateRtpInfo(0, 0, &rtp_info); |
| 1239 const size_t kPayloadBytes = kBlockSize16kHz * sizeof(int16_t); | 1239 const size_t kPayloadBytes = kBlockSize16kHz * sizeof(int16_t); |
| 1240 uint8_t payload[kPayloadBytes]; | 1240 uint8_t payload[kPayloadBytes]; |
| 1241 int16_t decoded[kBlockSize16kHz]; | 1241 int16_t decoded[kBlockSize16kHz]; |
| 1242 for (size_t n = 0; n < kPayloadBytes; ++n) { | 1242 for (size_t n = 0; n < kPayloadBytes; ++n) { |
| 1243 payload[n] = (rand() & 0xF0) + 1; // Non-zero random sequence. | 1243 payload[n] = (rand() & 0xF0) + 1; // Non-zero random sequence. |
| 1244 } | 1244 } |
| 1245 // Insert some packets which decode to noise. We are not interested in | 1245 // Insert some packets which decode to noise. We are not interested in |
| 1246 // actual decoded values. | 1246 // actual decoded values. |
| 1247 NetEqOutputType output_type; | 1247 NetEqOutputType output_type; |
| 1248 int num_channels; | 1248 size_t num_channels; |
| 1249 size_t samples_per_channel; | 1249 size_t samples_per_channel; |
| 1250 uint32_t receive_timestamp = 0; | 1250 uint32_t receive_timestamp = 0; |
| 1251 int algorithmic_frame_delay = algorithmic_delay_ms_ / 10 + 1; | 1251 int algorithmic_frame_delay = algorithmic_delay_ms_ / 10 + 1; |
| 1252 for (int n = 0; n < algorithmic_frame_delay; ++n) { | 1252 for (int n = 0; n < algorithmic_frame_delay; ++n) { |
| 1253 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, | 1253 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, |
| 1254 receive_timestamp)); | 1254 receive_timestamp)); |
| 1255 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, | 1255 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, |
| 1256 &samples_per_channel, &num_channels, | 1256 &samples_per_channel, &num_channels, |
| 1257 &output_type)); | 1257 &output_type)); |
| 1258 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); | 1258 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); |
| 1259 ASSERT_EQ(1, num_channels); | 1259 ASSERT_EQ(1u, num_channels); |
| 1260 rtp_info.header.sequenceNumber++; | 1260 rtp_info.header.sequenceNumber++; |
| 1261 rtp_info.header.timestamp += kBlockSize16kHz; | 1261 rtp_info.header.timestamp += kBlockSize16kHz; |
| 1262 receive_timestamp += kBlockSize16kHz; | 1262 receive_timestamp += kBlockSize16kHz; |
| 1263 } | 1263 } |
| 1264 const int kNumSyncPackets = 10; | 1264 const int kNumSyncPackets = 10; |
| 1265 | 1265 |
| 1266 WebRtcRTPHeader first_sync_packet_rtp_info; | 1266 WebRtcRTPHeader first_sync_packet_rtp_info; |
| 1267 memcpy(&first_sync_packet_rtp_info, &rtp_info, sizeof(rtp_info)); | 1267 memcpy(&first_sync_packet_rtp_info, &rtp_info, sizeof(rtp_info)); |
| 1268 | 1268 |
| 1269 // Insert sync-packets, but no decoding. | 1269 // Insert sync-packets, but no decoding. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1289 rtp_info.header.timestamp += kBlockSize16kHz; | 1289 rtp_info.header.timestamp += kBlockSize16kHz; |
| 1290 receive_timestamp += kBlockSize16kHz; | 1290 receive_timestamp += kBlockSize16kHz; |
| 1291 } | 1291 } |
| 1292 | 1292 |
| 1293 // Decode. | 1293 // Decode. |
| 1294 for (int n = 0; n < kNumSyncPackets; ++n) { | 1294 for (int n = 0; n < kNumSyncPackets; ++n) { |
| 1295 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, | 1295 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, |
| 1296 &samples_per_channel, &num_channels, | 1296 &samples_per_channel, &num_channels, |
| 1297 &output_type)); | 1297 &output_type)); |
| 1298 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); | 1298 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); |
| 1299 ASSERT_EQ(1, num_channels); | 1299 ASSERT_EQ(1u, num_channels); |
| 1300 EXPECT_TRUE(IsAllNonZero(decoded, samples_per_channel * num_channels)); | 1300 EXPECT_TRUE(IsAllNonZero(decoded, samples_per_channel * num_channels)); |
| 1301 } | 1301 } |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 void NetEqDecodingTest::WrapTest(uint16_t start_seq_no, | 1304 void NetEqDecodingTest::WrapTest(uint16_t start_seq_no, |
| 1305 uint32_t start_timestamp, | 1305 uint32_t start_timestamp, |
| 1306 const std::set<uint16_t>& drop_seq_numbers, | 1306 const std::set<uint16_t>& drop_seq_numbers, |
| 1307 bool expect_seq_no_wrap, | 1307 bool expect_seq_no_wrap, |
| 1308 bool expect_timestamp_wrap) { | 1308 bool expect_timestamp_wrap) { |
| 1309 uint16_t seq_no = start_seq_no; | 1309 uint16_t seq_no = start_seq_no; |
| 1310 uint32_t timestamp = start_timestamp; | 1310 uint32_t timestamp = start_timestamp; |
| 1311 const int kBlocksPerFrame = 3; // Number of 10 ms blocks per frame. | 1311 const int kBlocksPerFrame = 3; // Number of 10 ms blocks per frame. |
| 1312 const int kFrameSizeMs = kBlocksPerFrame * kTimeStepMs; | 1312 const int kFrameSizeMs = kBlocksPerFrame * kTimeStepMs; |
| 1313 const int kSamples = kBlockSize16kHz * kBlocksPerFrame; | 1313 const int kSamples = kBlockSize16kHz * kBlocksPerFrame; |
| 1314 const size_t kPayloadBytes = kSamples * sizeof(int16_t); | 1314 const size_t kPayloadBytes = kSamples * sizeof(int16_t); |
| 1315 double next_input_time_ms = 0.0; | 1315 double next_input_time_ms = 0.0; |
| 1316 int16_t decoded[kBlockSize16kHz]; | 1316 int16_t decoded[kBlockSize16kHz]; |
| 1317 int num_channels; | 1317 size_t num_channels; |
| 1318 size_t samples_per_channel; | 1318 size_t samples_per_channel; |
| 1319 NetEqOutputType output_type; | 1319 NetEqOutputType output_type; |
| 1320 uint32_t receive_timestamp = 0; | 1320 uint32_t receive_timestamp = 0; |
| 1321 | 1321 |
| 1322 // Insert speech for 2 seconds. | 1322 // Insert speech for 2 seconds. |
| 1323 const int kSpeechDurationMs = 2000; | 1323 const int kSpeechDurationMs = 2000; |
| 1324 int packets_inserted = 0; | 1324 int packets_inserted = 0; |
| 1325 uint16_t last_seq_no; | 1325 uint16_t last_seq_no; |
| 1326 uint32_t last_timestamp; | 1326 uint32_t last_timestamp; |
| 1327 bool timestamp_wrapped = false; | 1327 bool timestamp_wrapped = false; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 next_input_time_ms += static_cast<double>(kFrameSizeMs); | 1361 next_input_time_ms += static_cast<double>(kFrameSizeMs); |
| 1362 | 1362 |
| 1363 seq_no_wrapped |= seq_no < last_seq_no; | 1363 seq_no_wrapped |= seq_no < last_seq_no; |
| 1364 timestamp_wrapped |= timestamp < last_timestamp; | 1364 timestamp_wrapped |= timestamp < last_timestamp; |
| 1365 } | 1365 } |
| 1366 // Pull out data once. | 1366 // Pull out data once. |
| 1367 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, | 1367 ASSERT_EQ(0, neteq_->GetAudio(kBlockSize16kHz, decoded, |
| 1368 &samples_per_channel, &num_channels, | 1368 &samples_per_channel, &num_channels, |
| 1369 &output_type)); | 1369 &output_type)); |
| 1370 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); | 1370 ASSERT_EQ(kBlockSize16kHz, samples_per_channel); |
| 1371 ASSERT_EQ(1, num_channels); | 1371 ASSERT_EQ(1u, num_channels); |
| 1372 | 1372 |
| 1373 // Expect delay (in samples) to be less than 2 packets. | 1373 // Expect delay (in samples) to be less than 2 packets. |
| 1374 EXPECT_LE(timestamp - PlayoutTimestamp(), | 1374 EXPECT_LE(timestamp - PlayoutTimestamp(), |
| 1375 static_cast<uint32_t>(kSamples * 2)); | 1375 static_cast<uint32_t>(kSamples * 2)); |
| 1376 } | 1376 } |
| 1377 // Make sure we have actually tested wrap-around. | 1377 // Make sure we have actually tested wrap-around. |
| 1378 ASSERT_EQ(expect_seq_no_wrap, seq_no_wrapped); | 1378 ASSERT_EQ(expect_seq_no_wrap, seq_no_wrapped); |
| 1379 ASSERT_EQ(expect_timestamp_wrap, timestamp_wrapped); | 1379 ASSERT_EQ(expect_timestamp_wrap, timestamp_wrapped); |
| 1380 } | 1380 } |
| 1381 | 1381 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1412 const int kFrameSizeMs = 10; | 1412 const int kFrameSizeMs = 10; |
| 1413 const int kSampleRateKhz = 16; | 1413 const int kSampleRateKhz = 16; |
| 1414 const int kSamples = kFrameSizeMs * kSampleRateKhz; | 1414 const int kSamples = kFrameSizeMs * kSampleRateKhz; |
| 1415 const size_t kPayloadBytes = kSamples * 2; | 1415 const size_t kPayloadBytes = kSamples * 2; |
| 1416 | 1416 |
| 1417 const int algorithmic_delay_samples = std::max( | 1417 const int algorithmic_delay_samples = std::max( |
| 1418 algorithmic_delay_ms_ * kSampleRateKhz, 5 * kSampleRateKhz / 8); | 1418 algorithmic_delay_ms_ * kSampleRateKhz, 5 * kSampleRateKhz / 8); |
| 1419 // Insert three speech packets. Three are needed to get the frame length | 1419 // Insert three speech packets. Three are needed to get the frame length |
| 1420 // correct. | 1420 // correct. |
| 1421 size_t out_len; | 1421 size_t out_len; |
| 1422 int num_channels; | 1422 size_t num_channels; |
| 1423 NetEqOutputType type; | 1423 NetEqOutputType type; |
| 1424 uint8_t payload[kPayloadBytes] = {0}; | 1424 uint8_t payload[kPayloadBytes] = {0}; |
| 1425 WebRtcRTPHeader rtp_info; | 1425 WebRtcRTPHeader rtp_info; |
| 1426 for (int i = 0; i < 3; ++i) { | 1426 for (int i = 0; i < 3; ++i) { |
| 1427 PopulateRtpInfo(seq_no, timestamp, &rtp_info); | 1427 PopulateRtpInfo(seq_no, timestamp, &rtp_info); |
| 1428 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); | 1428 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); |
| 1429 ++seq_no; | 1429 ++seq_no; |
| 1430 timestamp += kSamples; | 1430 timestamp += kSamples; |
| 1431 | 1431 |
| 1432 // Pull audio once. | 1432 // Pull audio once. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 WebRtcRTPHeader rtp_info; | 1509 WebRtcRTPHeader rtp_info; |
| 1510 | 1510 |
| 1511 PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len); | 1511 PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len); |
| 1512 ASSERT_EQ(NetEq::kOK, | 1512 ASSERT_EQ(NetEq::kOK, |
| 1513 neteq_->InsertPacket(rtp_info, payload, payload_len, 0)); | 1513 neteq_->InsertPacket(rtp_info, payload, payload_len, 0)); |
| 1514 ++seq_no; | 1514 ++seq_no; |
| 1515 timestamp += kCngPeriodSamples; | 1515 timestamp += kCngPeriodSamples; |
| 1516 | 1516 |
| 1517 // Pull audio once and make sure CNG is played. | 1517 // Pull audio once and make sure CNG is played. |
| 1518 size_t out_len; | 1518 size_t out_len; |
| 1519 int num_channels; | 1519 size_t num_channels; |
| 1520 NetEqOutputType type; | 1520 NetEqOutputType type; |
| 1521 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, | 1521 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, |
| 1522 &num_channels, &type)); | 1522 &num_channels, &type)); |
| 1523 ASSERT_EQ(kBlockSize16kHz, out_len); | 1523 ASSERT_EQ(kBlockSize16kHz, out_len); |
| 1524 EXPECT_EQ(kOutputCNG, type); | 1524 EXPECT_EQ(kOutputCNG, type); |
| 1525 | 1525 |
| 1526 // Insert some speech packets. | 1526 // Insert some speech packets. |
| 1527 for (int i = 0; i < 3; ++i) { | 1527 for (int i = 0; i < 3; ++i) { |
| 1528 PopulateRtpInfo(seq_no, timestamp, &rtp_info); | 1528 PopulateRtpInfo(seq_no, timestamp, &rtp_info); |
| 1529 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); | 1529 ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0)); |
| 1530 ++seq_no; | 1530 ++seq_no; |
| 1531 timestamp += kSamples; | 1531 timestamp += kSamples; |
| 1532 | 1532 |
| 1533 // Pull audio once. | 1533 // Pull audio once. |
| 1534 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, | 1534 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, |
| 1535 &num_channels, &type)); | 1535 &num_channels, &type)); |
| 1536 ASSERT_EQ(kBlockSize16kHz, out_len); | 1536 ASSERT_EQ(kBlockSize16kHz, out_len); |
| 1537 } | 1537 } |
| 1538 // Verify speech output. | 1538 // Verify speech output. |
| 1539 EXPECT_EQ(kOutputNormal, type); | 1539 EXPECT_EQ(kOutputNormal, type); |
| 1540 } | 1540 } |
| 1541 | 1541 |
| 1542 } // namespace webrtc | 1542 } // namespace webrtc |
| OLD | NEW |