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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_unittest.cc

Issue 1865633005: Don't always downsample to 16kHz in the reverse stream in APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Simplify if-statement Created 4 years, 8 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/modules/audio_processing/audio_processing_impl.cc ('k') | no next file » | 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) 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
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)
57 const int kProcessSampleRates[] = {8000, 16000, 32000, 48000}; 61 const int kProcessSampleRates[] = {8000, 16000, 32000, 48000};
62 #endif
58 63
59 enum StreamDirection { kForward = 0, kReverse }; 64 enum StreamDirection { kForward = 0, kReverse };
60 65
61 void ConvertToFloat(const int16_t* int_data, ChannelBuffer<float>* cb) { 66 void ConvertToFloat(const int16_t* int_data, ChannelBuffer<float>* cb) {
62 ChannelBuffer<int16_t> cb_int(cb->num_frames(), 67 ChannelBuffer<int16_t> cb_int(cb->num_frames(),
63 cb->num_channels()); 68 cb->num_channels());
64 Deinterleave(int_data, 69 Deinterleave(int_data,
65 cb->num_frames(), 70 cb->num_frames(),
66 cb->num_channels(), 71 cb->num_channels(),
67 cb_int.channels()); 72 cb_int.channels());
(...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0), 2690 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0),
2686 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30), 2691 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30),
2687 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20), 2692 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20),
2688 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20), 2693 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20),
2689 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15), 2694 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15),
2690 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15), 2695 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15),
2691 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), 2696 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35),
2692 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), 2697 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0),
2693 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), 2698 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20),
2694 std::tr1::make_tuple(16000, 16000, 48000, 16000, 40, 20), 2699 std::tr1::make_tuple(16000, 16000, 48000, 16000, 40, 20),
2695 std::tr1::make_tuple(16000, 16000, 32000, 16000, 50, 20), 2700 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20),
2696 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); 2701 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0)));
2697 2702
2698 #elif defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) 2703 #elif defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)
2699 INSTANTIATE_TEST_CASE_P( 2704 INSTANTIATE_TEST_CASE_P(
2700 CommonFormats, 2705 CommonFormats,
2701 AudioProcessingTest, 2706 AudioProcessingTest,
2702 testing::Values(std::tr1::make_tuple(48000, 48000, 48000, 48000, 20, 0), 2707 testing::Values(std::tr1::make_tuple(48000, 48000, 48000, 48000, 20, 0),
2703 std::tr1::make_tuple(48000, 48000, 32000, 48000, 20, 30), 2708 std::tr1::make_tuple(48000, 48000, 32000, 48000, 20, 30),
2704 std::tr1::make_tuple(48000, 48000, 16000, 48000, 20, 20), 2709 std::tr1::make_tuple(48000, 48000, 16000, 48000, 20, 20),
2705 std::tr1::make_tuple(48000, 44100, 48000, 44100, 15, 20), 2710 std::tr1::make_tuple(48000, 44100, 48000, 44100, 15, 20),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2741 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0), 2746 std::tr1::make_tuple(16000, 48000, 48000, 48000, 25, 0),
2742 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30), 2747 std::tr1::make_tuple(16000, 48000, 32000, 48000, 25, 30),
2743 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20), 2748 std::tr1::make_tuple(16000, 48000, 16000, 48000, 25, 20),
2744 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20), 2749 std::tr1::make_tuple(16000, 44100, 48000, 44100, 15, 20),
2745 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15), 2750 std::tr1::make_tuple(16000, 44100, 32000, 44100, 15, 15),
2746 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15), 2751 std::tr1::make_tuple(16000, 44100, 16000, 44100, 15, 15),
2747 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35), 2752 std::tr1::make_tuple(16000, 32000, 48000, 32000, 25, 35),
2748 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), 2753 std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0),
2749 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), 2754 std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20),
2750 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), 2755 std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20),
2751 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), 2756 std::tr1::make_tuple(16000, 16000, 32000, 16000, 35, 20),
2752 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); 2757 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0)));
2753 #endif 2758 #endif
2754 2759
2755 } // namespace 2760 } // namespace
2756 } // namespace webrtc 2761 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698