OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 frame_->num_channels_ = 2; | 1580 frame_->num_channels_ = 2; |
1581 frame_->sample_rate_hz_ = 16000; | 1581 frame_->sample_rate_hz_ = 16000; |
1582 // Enable AEC, which would require the filter in super-wb. We rely on the | 1582 // Enable AEC, which would require the filter in super-wb. We rely on the |
1583 // first few frames of data being unaffected by the AEC. | 1583 // first few frames of data being unaffected by the AEC. |
1584 // TODO(andrew): This test, and the one below, rely rather tenuously on the | 1584 // TODO(andrew): This test, and the one below, rely rather tenuously on the |
1585 // behavior of the AEC. Think of something more robust. | 1585 // behavior of the AEC. Think of something more robust. |
1586 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); | 1586 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); |
1587 // Make sure we have extended filter enabled. This makes sure nothing is | 1587 // Make sure we have extended filter enabled. This makes sure nothing is |
1588 // touched until we have a farend frame. | 1588 // touched until we have a farend frame. |
1589 Config config; | 1589 Config config; |
1590 config.Set<DelayCorrection>(new DelayCorrection(true)); | 1590 config.Set<ExtendedFilter>(new ExtendedFilter(true)); |
1591 apm_->SetExtraOptions(config); | 1591 apm_->SetExtraOptions(config); |
1592 SetFrameTo(frame_, 1000); | 1592 SetFrameTo(frame_, 1000); |
1593 frame_copy.CopyFrom(*frame_); | 1593 frame_copy.CopyFrom(*frame_); |
1594 EXPECT_EQ(apm_->kNoError, apm_->set_stream_delay_ms(0)); | 1594 EXPECT_EQ(apm_->kNoError, apm_->set_stream_delay_ms(0)); |
1595 apm_->echo_cancellation()->set_stream_drift_samples(0); | 1595 apm_->echo_cancellation()->set_stream_drift_samples(0); |
1596 EXPECT_EQ(apm_->kNoError, apm_->ProcessStream(frame_)); | 1596 EXPECT_EQ(apm_->kNoError, apm_->ProcessStream(frame_)); |
1597 EXPECT_EQ(apm_->kNoError, apm_->set_stream_delay_ms(0)); | 1597 EXPECT_EQ(apm_->kNoError, apm_->set_stream_delay_ms(0)); |
1598 apm_->echo_cancellation()->set_stream_drift_samples(0); | 1598 apm_->echo_cancellation()->set_stream_drift_samples(0); |
1599 EXPECT_EQ(apm_->kNoError, apm_->ProcessStream(frame_)); | 1599 EXPECT_EQ(apm_->kNoError, apm_->ProcessStream(frame_)); |
1600 EXPECT_TRUE(FrameDataAreEqual(*frame_, frame_copy)); | 1600 EXPECT_TRUE(FrameDataAreEqual(*frame_, frame_copy)); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 printf("Running test %d of %d...\n", i + 1, ref_data.test_size()); | 1962 printf("Running test %d of %d...\n", i + 1, ref_data.test_size()); |
1963 | 1963 |
1964 audioproc::Test* test = ref_data.mutable_test(i); | 1964 audioproc::Test* test = ref_data.mutable_test(i); |
1965 // TODO(ajm): We no longer allow different input and output channels. Skip | 1965 // TODO(ajm): We no longer allow different input and output channels. Skip |
1966 // these tests for now, but they should be removed from the set. | 1966 // these tests for now, but they should be removed from the set. |
1967 if (test->num_input_channels() != test->num_output_channels()) | 1967 if (test->num_input_channels() != test->num_output_channels()) |
1968 continue; | 1968 continue; |
1969 | 1969 |
1970 Config config; | 1970 Config config; |
1971 config.Set<ExperimentalAgc>(new ExperimentalAgc(false)); | 1971 config.Set<ExperimentalAgc>(new ExperimentalAgc(false)); |
1972 config.Set<DelayCorrection>( | 1972 config.Set<ExtendedFilter>( |
1973 new DelayCorrection(test->use_aec_extended_filter())); | 1973 new ExtendedFilter(test->use_aec_extended_filter())); |
1974 apm_.reset(AudioProcessing::Create(config)); | 1974 apm_.reset(AudioProcessing::Create(config)); |
1975 | 1975 |
1976 EnableAllComponents(); | 1976 EnableAllComponents(); |
1977 | 1977 |
1978 Init(test->sample_rate(), | 1978 Init(test->sample_rate(), |
1979 test->sample_rate(), | 1979 test->sample_rate(), |
1980 test->sample_rate(), | 1980 test->sample_rate(), |
1981 test->num_input_channels(), | 1981 test->num_input_channels(), |
1982 test->num_output_channels(), | 1982 test->num_output_channels(), |
1983 test->num_reverse_channels(), | 1983 test->num_reverse_channels(), |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2620 std::tr1::make_tuple(16000, 16000, 32000, 40), | 2620 std::tr1::make_tuple(16000, 16000, 32000, 40), |
2621 std::tr1::make_tuple(16000, 16000, 16000, 0))); | 2621 std::tr1::make_tuple(16000, 16000, 16000, 0))); |
2622 #endif | 2622 #endif |
2623 | 2623 |
2624 // TODO(henrike): re-implement functionality lost when removing the old main | 2624 // TODO(henrike): re-implement functionality lost when removing the old main |
2625 // function. See | 2625 // function. See |
2626 // https://code.google.com/p/webrtc/issues/detail?id=1981 | 2626 // https://code.google.com/p/webrtc/issues/detail?id=1981 |
2627 | 2627 |
2628 } // namespace | 2628 } // namespace |
2629 } // namespace webrtc | 2629 } // namespace webrtc |
OLD | NEW |