| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_VAD_POLE_ZERO_FILTER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_VAD_POLE_ZERO_FILTER_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_VAD_POLE_ZERO_FILTER_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_VAD_POLE_ZERO_FILTER_H_ |
| 13 | 13 |
| 14 #include <cstddef> |
| 15 |
| 14 #include "webrtc/typedefs.h" | 16 #include "webrtc/typedefs.h" |
| 15 | 17 |
| 16 namespace webrtc { | 18 namespace webrtc { |
| 17 | 19 |
| 18 class PoleZeroFilter { | 20 class PoleZeroFilter { |
| 19 public: | 21 public: |
| 20 ~PoleZeroFilter() {} | 22 ~PoleZeroFilter() {} |
| 21 | 23 |
| 22 static PoleZeroFilter* Create(const float* numerator_coefficients, | 24 static PoleZeroFilter* Create(const float* numerator_coefficients, |
| 23 int order_numerator, | 25 size_t order_numerator, |
| 24 const float* denominator_coefficients, | 26 const float* denominator_coefficients, |
| 25 int order_denominator); | 27 size_t order_denominator); |
| 26 | 28 |
| 27 int Filter(const int16_t* in, int num_input_samples, float* output); | 29 int Filter(const int16_t* in, size_t num_input_samples, float* output); |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 PoleZeroFilter(const float* numerator_coefficients, | 32 PoleZeroFilter(const float* numerator_coefficients, |
| 31 int order_numerator, | 33 size_t order_numerator, |
| 32 const float* denominator_coefficients, | 34 const float* denominator_coefficients, |
| 33 int order_denominator); | 35 size_t order_denominator); |
| 34 | 36 |
| 35 static const int kMaxFilterOrder = 24; | 37 static const int kMaxFilterOrder = 24; |
| 36 | 38 |
| 37 int16_t past_input_[kMaxFilterOrder * 2]; | 39 int16_t past_input_[kMaxFilterOrder * 2]; |
| 38 float past_output_[kMaxFilterOrder * 2]; | 40 float past_output_[kMaxFilterOrder * 2]; |
| 39 | 41 |
| 40 float numerator_coefficients_[kMaxFilterOrder + 1]; | 42 float numerator_coefficients_[kMaxFilterOrder + 1]; |
| 41 float denominator_coefficients_[kMaxFilterOrder + 1]; | 43 float denominator_coefficients_[kMaxFilterOrder + 1]; |
| 42 | 44 |
| 43 int order_numerator_; | 45 size_t order_numerator_; |
| 44 int order_denominator_; | 46 size_t order_denominator_; |
| 45 int highest_order_; | 47 size_t highest_order_; |
| 46 }; | 48 }; |
| 47 | 49 |
| 48 } // namespace webrtc | 50 } // namespace webrtc |
| 49 | 51 |
| 50 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_VAD_POLE_ZERO_FILTER_H_ | 52 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_VAD_POLE_ZERO_FILTER_H_ |
| OLD | NEW |