blob: 74b1261068d409d4f4cf944309f57194da8cdeea [file] [log] [blame]
Per Åhgren8ba58612017-12-01 23:01:44 +01001/*
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 "modules/audio_processing/aec3/vector_buffer.h"
12
Yves Gerey988cc082018-10-23 12:03:01 +020013#include <algorithm>
Per Åhgren8ba58612017-12-01 23:01:44 +010014
15namespace webrtc {
16
Sam Zackrissona81c09d2019-09-05 09:35:10 +020017VectorBuffer::VectorBuffer(size_t size,
18 size_t num_channels,
19 size_t spectrum_length)
Per Åhgrenc59a5762017-12-11 21:34:19 +010020 : size(static_cast<int>(size)),
Sam Zackrissona81c09d2019-09-05 09:35:10 +020021 buffer(size,
22 std::vector<std::vector<float>>(
23 num_channels,
24 std::vector<float>(spectrum_length, 0.f))) {
25 for (auto& channel : buffer) {
26 for (auto& c : channel) {
27 std::fill(c.begin(), c.end(), 0.f);
28 }
Per Åhgren8ba58612017-12-01 23:01:44 +010029 }
30}
31
32VectorBuffer::~VectorBuffer() = default;
33
34} // namespace webrtc