aluebs@webrtc.org | 37ca765 | 2014-03-24 10:16:11 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef COMMON_AUDIO_FIR_FILTER_SSE_H_ |
| 12 | #define COMMON_AUDIO_FIR_FILTER_SSE_H_ |
aluebs@webrtc.org | 37ca765 | 2014-03-24 10:16:11 +0000 | [diff] [blame] | 13 | |
Yves Gerey | 988cc08 | 2018-10-23 12:03:01 +0200 | [diff] [blame] | 14 | #include <stddef.h> |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 15 | |
kwiberg | c2b785d | 2016-02-24 05:22:32 -0800 | [diff] [blame] | 16 | #include <memory> |
| 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "common_audio/fir_filter.h" |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 19 | #include "rtc_base/memory/aligned_malloc.h" |
aluebs@webrtc.org | 37ca765 | 2014-03-24 10:16:11 +0000 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
| 22 | |
| 23 | class FIRFilterSSE2 : public FIRFilter { |
| 24 | public: |
| 25 | FIRFilterSSE2(const float* coefficients, |
| 26 | size_t coefficients_length, |
| 27 | size_t max_input_length); |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 28 | ~FIRFilterSSE2() override; |
aluebs@webrtc.org | 37ca765 | 2014-03-24 10:16:11 +0000 | [diff] [blame] | 29 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 30 | void Filter(const float* in, size_t length, float* out) override; |
aluebs@webrtc.org | 37ca765 | 2014-03-24 10:16:11 +0000 | [diff] [blame] | 31 | |
| 32 | private: |
| 33 | size_t coefficients_length_; |
| 34 | size_t state_length_; |
kwiberg | c2b785d | 2016-02-24 05:22:32 -0800 | [diff] [blame] | 35 | std::unique_ptr<float[], AlignedFreeDeleter> coefficients_; |
| 36 | std::unique_ptr<float[], AlignedFreeDeleter> state_; |
aluebs@webrtc.org | 37ca765 | 2014-03-24 10:16:11 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | } // namespace webrtc |
| 40 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 41 | #endif // COMMON_AUDIO_FIR_FILTER_SSE_H_ |