OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 13 matching lines...) Expand all Loading... |
24 using NativeRate = AudioProcessing::NativeRate; | 24 using NativeRate = AudioProcessing::NativeRate; |
25 const int maximal_frequency = *std::max_element( | 25 const int maximal_frequency = *std::max_element( |
26 preferred_sample_rates.begin(), preferred_sample_rates.end()); | 26 preferred_sample_rates.begin(), preferred_sample_rates.end()); |
27 | 27 |
28 RTC_DCHECK_LE(NativeRate::kSampleRate8kHz, maximal_frequency); | 28 RTC_DCHECK_LE(NativeRate::kSampleRate8kHz, maximal_frequency); |
29 RTC_DCHECK_GE(NativeRate::kSampleRate48kHz, maximal_frequency); | 29 RTC_DCHECK_GE(NativeRate::kSampleRate48kHz, maximal_frequency); |
30 | 30 |
31 static constexpr NativeRate native_rates[] = { | 31 static constexpr NativeRate native_rates[] = { |
32 NativeRate::kSampleRate8kHz, NativeRate::kSampleRate16kHz, | 32 NativeRate::kSampleRate8kHz, NativeRate::kSampleRate16kHz, |
33 NativeRate::kSampleRate32kHz, NativeRate::kSampleRate48kHz}; | 33 NativeRate::kSampleRate32kHz, NativeRate::kSampleRate48kHz}; |
34 const auto rounded_up_index = std::lower_bound( | 34 const auto* rounded_up_index = std::lower_bound( |
35 std::begin(native_rates), std::end(native_rates), maximal_frequency); | 35 std::begin(native_rates), std::end(native_rates), maximal_frequency); |
36 RTC_DCHECK(rounded_up_index != std::end(native_rates)); | 36 RTC_DCHECK(rounded_up_index != std::end(native_rates)); |
37 return *rounded_up_index; | 37 return *rounded_up_index; |
38 } | 38 } |
39 } // namespace webrtc | 39 } // namespace webrtc |
OLD | NEW |