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

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

Issue 1777093004: Reland: 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: Rebasing 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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 1118
1119 // We want to process at the lowest rate possible without losing information. 1119 // We want to process at the lowest rate possible without losing information.
1120 // Choose the lowest native rate at least equal to the input and codec rates. 1120 // Choose the lowest native rate at least equal to the input and codec rates.
1121 const int min_processing_rate = std::min(sample_rate_hz, codec_rate); 1121 const int min_processing_rate = std::min(sample_rate_hz, codec_rate);
1122 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) { 1122 for (size_t i = 0; i < AudioProcessing::kNumNativeSampleRates; ++i) {
1123 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i]; 1123 _audioFrame.sample_rate_hz_ = AudioProcessing::kNativeSampleRatesHz[i];
1124 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) { 1124 if (_audioFrame.sample_rate_hz_ >= min_processing_rate) {
1125 break; 1125 break;
1126 } 1126 }
1127 } 1127 }
1128 if (audioproc_->echo_control_mobile()->is_enabled()) {
1129 // AECM only supports 8 and 16 kHz.
1130 _audioFrame.sample_rate_hz_ = std::min(
1131 _audioFrame.sample_rate_hz_, AudioProcessing::kMaxAECMSampleRateHz);
1132 }
1133 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels); 1128 _audioFrame.num_channels_ = std::min(num_channels, num_codec_channels);
1134 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz, 1129 RemixAndResample(audio, samples_per_channel, num_channels, sample_rate_hz,
1135 &resampler_, &_audioFrame); 1130 &resampler_, &_audioFrame);
1136 } 1131 }
1137 1132
1138 int32_t TransmitMixer::RecordAudioToFile( 1133 int32_t TransmitMixer::RecordAudioToFile(
1139 uint32_t mixingFrequency) 1134 uint32_t mixingFrequency)
1140 { 1135 {
1141 rtc::CritScope cs(&_critSect); 1136 rtc::CritScope cs(&_critSect);
1142 if (_fileRecorderPtr == NULL) 1137 if (_fileRecorderPtr == NULL)
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 void TransmitMixer::EnableStereoChannelSwapping(bool enable) { 1304 void TransmitMixer::EnableStereoChannelSwapping(bool enable) {
1310 swap_stereo_channels_ = enable; 1305 swap_stereo_channels_ = enable;
1311 } 1306 }
1312 1307
1313 bool TransmitMixer::IsStereoChannelSwappingEnabled() { 1308 bool TransmitMixer::IsStereoChannelSwappingEnabled() {
1314 return swap_stereo_channels_; 1309 return swap_stereo_channels_;
1315 } 1310 }
1316 1311
1317 } // namespace voe 1312 } // namespace voe
1318 } // namespace webrtc 1313 } // 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