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

Side by Side Diff: webrtc/voice_engine/transmit_mixer.cc

Issue 1781893002: Revert of Drop the 16kHz sample rate restriction on AECM and zero out higher bands (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/test/audio_processing_unittest.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 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 1139
1140 // We want to process at the lowest rate possible without losing information. 1140 // We want to process at the lowest rate possible without losing information.
1141 // Choose the lowest native rate at least equal to the input and codec rates. 1141 // Choose the lowest native rate at least equal to the input and codec rates.
1142 const int min_processing_rate = std::min(sample_rate_hz, codec_rate); 1142 const int min_processing_rate = std::min(sample_rate_hz, codec_rate);
1143 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) { 1143 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) {
1144 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i]; 1144 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i];
1145 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) { 1145 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) {
1146 break; 1146 break;
1147 } 1147 }
1148 } 1148 }
1149 if (audioproc_->echo_control_mobile()->is_enabled()) {
1150 // AECM only supports 8 and 16 kHz.
1151 _audioFrame.sample_rate_hz_ = std::min(
1152 _audioFrame.sample_rate_hz_, AudioProcessing::kMaxAECMSampleRateHz);
1153 }
1149 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels); 1154 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels);
1150 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz, 1155 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz,
1151 &resampler_, &_audioFrame); 1156 &resampler_, &_audioFrame);
1152 } 1157 }
1153 1158
1154 int32_t TransmitMixer::RecordAudioToFile( 1159 int32_t TransmitMixer::RecordAudioToFile(
1155 uint32_t mixingFrequency) 1160 uint32_t mixingFrequency)
1156 { 1161 {
1157 rtc::CritScope cs(&_critSect); 1162 rtc::CritScope cs(&_critSect);
1158 if (_fileRecorderPtr == NULL) 1163 if (_fileRecorderPtr == NULL)
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { 1330 void TransmitMixer::EnableStereoChannelSwapping(bool enable) {
1326 swap_stereo_channels_ = enable; 1331 swap_stereo_channels_ = enable;
1327 } 1332 }
1328 1333
1329 bool TransmitMixer::IsStereoChannelSwappingEnabled() { 1334 bool TransmitMixer::IsStereoChannelSwappingEnabled() {
1330 return swap_stereo_channels_; 1335 return swap_stereo_channels_;
1331 } 1336 }
1332 1337
1333 } // namespace voe 1338 } // namespace voe
1334 } // namespace webrtc 1339 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/test/audio_processing_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698