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

Side by Side Diff: webrtc/modules/audio_processing/aec3/aec3_fft.cc

Issue 2678423005: Finalization of the first version of EchoCanceller 3 (Closed)
Patch Set: Fixed compilation error Created 3 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
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h"
12
13 #include <algorithm>
14
15 #include "webrtc/base/checks.h"
16
17 namespace webrtc {
18
19 // TODO(peah): Change x to be std::array once the rest of the code allows this.
20 void Aec3Fft::ZeroPaddedFft(rtc::ArrayView<const float> x, FftData* X) const {
21 RTC_DCHECK(X);
22 RTC_DCHECK_EQ(kFftLengthBy2, x.size());
23 std::array<float, kFftLength> fft;
24 std::fill(fft.begin(), fft.begin() + kFftLengthBy2, 0.f);
25 std::copy(x.begin(), x.end(), fft.begin() + kFftLengthBy2);
26 Fft(&fft, X);
27 }
28
29 void Aec3Fft::PaddedFft(rtc::ArrayView<const float> x,
30 rtc::ArrayView<float> x_old,
31 FftData* X) const {
32 RTC_DCHECK(X);
33 RTC_DCHECK_EQ(kFftLengthBy2, x.size());
34 RTC_DCHECK_EQ(kFftLengthBy2, x_old.size());
35 std::array<float, kFftLength> fft;
36 std::copy(x_old.begin(), x_old.end(), fft.begin());
37 std::copy(x.begin(), x.end(), fft.begin() + x_old.size());
38 std::copy(x.begin(), x.end(), x_old.begin());
39 Fft(&fft, X);
40 }
41
42 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698