OLD | NEW |
---|---|
(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 void Aec3Fft::ZeroPaddedFft(rtc::ArrayView<const float> x, FftData* X) const { | |
hlundin-webrtc
2017/02/21 16:34:02
Any reason why you are not using an std::array her
peah-webrtc
2017/02/21 23:00:40
I agree. The reason is that it is called at least
| |
20 RTC_DCHECK(X); | |
21 RTC_DCHECK_EQ(kFftLengthBy2, x.size()); | |
22 std::array<float, kFftLength> fft; | |
23 std::fill(fft.begin(), fft.begin() + kFftLengthBy2, 0.f); | |
24 std::copy(x.begin(), x.end(), fft.begin() + kFftLengthBy2); | |
25 ooura_fft_.Fft(fft.data()); | |
hlundin-webrtc
2017/02/21 16:34:02
Why not call Fft(&fft, X), like you do in PaddedFf
peah-webrtc
2017/02/21 23:00:40
Done.
| |
26 X->CopyFromPackedArray(fft); | |
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.size()); | |
hlundin-webrtc
2017/02/21 16:34:02
I guess this should be x_old.size(). Not that it m
peah-webrtc
2017/02/21 23:00:40
Done.
| |
38 std::copy(x.begin(), x.end(), x_old.begin()); | |
39 Fft(&fft, X); | |
40 } | |
41 | |
42 } // namespace webrtc | |
OLD | NEW |