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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // TODO(bjornv): This is not feasible until the functionality has been | 47 // TODO(bjornv): This is not feasible until the functionality has been |
48 // re-implemented; see comment at the bottom of this file. For now, the user has | 48 // re-implemented; see comment at the bottom of this file. For now, the user has |
49 // to hard code the |write_ref_data| value. | 49 // to hard code the |write_ref_data| value. |
50 // When false, this will compare the output data with the results stored to | 50 // When false, this will compare the output data with the results stored to |
51 // file. This is the typical case. When the file should be updated, it can | 51 // file. This is the typical case. When the file should be updated, it can |
52 // be set to true with the command-line switch --write_ref_data. | 52 // be set to true with the command-line switch --write_ref_data. |
53 bool write_ref_data = false; | 53 bool write_ref_data = false; |
54 const google::protobuf::int32 kChannels[] = {1, 2}; | 54 const google::protobuf::int32 kChannels[] = {1, 2}; |
55 const int kSampleRates[] = {8000, 16000, 32000, 48000}; | 55 const int kSampleRates[] = {8000, 16000, 32000, 48000}; |
56 | 56 |
57 #if defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) | |
58 // Android doesn't support 48kHz. | |
59 const int kProcessSampleRates[] = {8000, 16000, 32000}; | |
60 #elif defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE) | |
61 const int kProcessSampleRates[] = {8000, 16000, 32000, 48000}; | 57 const int kProcessSampleRates[] = {8000, 16000, 32000, 48000}; |
62 #endif | |
63 | 58 |
64 enum StreamDirection { kForward = 0, kReverse }; | 59 enum StreamDirection { kForward = 0, kReverse }; |
65 | 60 |
66 void ConvertToFloat(const int16_t* int_data, ChannelBuffer<float>* cb) { | 61 void ConvertToFloat(const int16_t* int_data, ChannelBuffer<float>* cb) { |
67 ChannelBuffer<int16_t> cb_int(cb->num_frames(), | 62 ChannelBuffer<int16_t> cb_int(cb->num_frames(), |
68 cb->num_channels()); | 63 cb->num_channels()); |
69 Deinterleave(int_data, | 64 Deinterleave(int_data, |
70 cb->num_frames(), | 65 cb->num_frames(), |
71 cb->num_channels(), | 66 cb->num_channels(), |
72 cb_int.channels()); | 67 cb_int.channels()); |
(...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2690 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0), | 2685 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0), |
2691 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30), | 2686 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30), |
2692 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20), | 2687 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20), |
2693 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20), | 2688 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20), |
2694 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15), | 2689 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15), |
2695 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15), | 2690 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15), |
2696 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), | 2691 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), |
2697 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), | 2692 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), |
2698 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), | 2693 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), |
2699 std::tr1::make_tuple(16000, 16000, 48000, 16000, 40, 20), | 2694 std::tr1::make_tuple(16000, 16000, 48000, 16000, 40, 20), |
2700 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), | 2695 std::tr1::make_tuple(16000, 16000, 32000, 16000, 50, 20), |
2701 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); | 2696 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); |
2702 | 2697 |
2703 #elif defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) | 2698 #elif defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) |
2704 INSTANTIATE_TEST_CASE_P( | 2699 INSTANTIATE_TEST_CASE_P( |
2705 CommonFormats, | 2700 CommonFormats, |
2706 AudioProcessingTest, | 2701 AudioProcessingTest, |
2707 testing::Values(std::tr1::make_tuple(48000, 48000, 48000, 48000, 20, 0), | 2702 testing::Values(std::tr1::make_tuple(48000, 48000, 48000, 48000, 20, 0), |
2708 std::tr1::make_tuple(48000, 48000, 32000, 48000, 20, 30), | 2703 std::tr1::make_tuple(48000, 48000, 32000, 48000, 20, 30), |
2709 std::tr1::make_tuple(48000, 48000, 16000, 48000, 20, 20), | 2704 std::tr1::make_tuple(48000, 48000, 16000, 48000, 20, 20), |
2710 std::tr1::make_tuple(48000, 44100, 48000, 44100, 15, 20), | 2705 std::tr1::make_tuple(48000, 44100, 48000, 44100, 15, 20), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2746 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0), | 2741 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0), |
2747 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30), | 2742 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30), |
2748 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20), | 2743 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20), |
2749 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20), | 2744 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20), |
2750 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15), | 2745 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15), |
2751 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15), | 2746 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15), |
2752 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), | 2747 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), |
2753 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), | 2748 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), |
2754 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), | 2749 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), |
2755 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), | 2750 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), |
2756 std::tr1::make_tuple(16000, 16000, 32000, 16000, 35, 20), | 2751 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), |
2757 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); | 2752 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); |
2758 #endif | 2753 #endif |
2759 | 2754 |
2760 } // namespace | 2755 } // namespace |
2761 } // namespace webrtc | 2756 } // namespace webrtc |
OLD | NEW |