blob: 32f4945acceb2c2e024e33ca1a2524b049f12e07 [file] [log] [blame]
aluebs@webrtc.org37ca7652014-03-24 10:16:11 +00001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef COMMON_AUDIO_FIR_FILTER_SSE_H_
12#define COMMON_AUDIO_FIR_FILTER_SSE_H_
aluebs@webrtc.org37ca7652014-03-24 10:16:11 +000013
Yves Gerey988cc082018-10-23 12:03:01 +020014#include <stddef.h>
Jonas Olssona4d87372019-07-05 19:08:33 +020015
kwibergc2b785d2016-02-24 05:22:32 -080016#include <memory>
17
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "common_audio/fir_filter.h"
Karl Wiberg29e7bee2018-03-22 14:11:52 +010019#include "rtc_base/memory/aligned_malloc.h"
aluebs@webrtc.org37ca7652014-03-24 10:16:11 +000020
21namespace webrtc {
22
23class FIRFilterSSE2 : public FIRFilter {
24 public:
25 FIRFilterSSE2(const float* coefficients,
26 size_t coefficients_length,
27 size_t max_input_length);
Patrik Höglundf715c532017-11-17 11:04:15 +010028 ~FIRFilterSSE2() override;
aluebs@webrtc.org37ca7652014-03-24 10:16:11 +000029
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000030 void Filter(const float* in, size_t length, float* out) override;
aluebs@webrtc.org37ca7652014-03-24 10:16:11 +000031
32 private:
33 size_t coefficients_length_;
34 size_t state_length_;
kwibergc2b785d2016-02-24 05:22:32 -080035 std::unique_ptr<float[], AlignedFreeDeleter> coefficients_;
36 std::unique_ptr<float[], AlignedFreeDeleter> state_;
aluebs@webrtc.org37ca7652014-03-24 10:16:11 +000037};
38
39} // namespace webrtc
40
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020041#endif // COMMON_AUDIO_FIR_FILTER_SSE_H_