OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 | 11 |
12 /* | 12 /* |
13 * This file contains the function WebRtcSpl_FilterAR(). | 13 * This file contains the function WebRtcSpl_FilterAR(). |
14 * The description header can be found in signal_processing_library.h | 14 * The description header can be found in signal_processing_library.h |
15 * | 15 * |
16 */ | 16 */ |
17 | 17 |
18 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 18 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
19 | 19 |
20 int WebRtcSpl_FilterAR(const int16_t* a, | 20 size_t WebRtcSpl_FilterAR(const int16_t* a, |
21 int a_length, | 21 size_t a_length, |
22 const int16_t* x, | 22 const int16_t* x, |
23 int x_length, | 23 size_t x_length, |
24 int16_t* state, | 24 int16_t* state, |
25 int state_length, | 25 size_t state_length, |
26 int16_t* state_low, | 26 int16_t* state_low, |
27 int state_low_length, | 27 size_t state_low_length, |
28 int16_t* filtered, | 28 int16_t* filtered, |
29 int16_t* filtered_low, | 29 int16_t* filtered_low, |
30 int filtered_low_length) | 30 size_t filtered_low_length) |
31 { | 31 { |
32 int32_t o; | 32 int32_t o; |
33 int32_t oLOW; | 33 int32_t oLOW; |
34 int i, j, stop; | 34 size_t i, j, stop; |
35 const int16_t* x_ptr = &x[0]; | 35 const int16_t* x_ptr = &x[0]; |
36 int16_t* filteredFINAL_ptr = filtered; | 36 int16_t* filteredFINAL_ptr = filtered; |
37 int16_t* filteredFINAL_LOW_ptr = filtered_low; | 37 int16_t* filteredFINAL_LOW_ptr = filtered_low; |
38 | 38 |
39 for (i = 0; i < x_length; i++) | 39 for (i = 0; i < x_length; i++) |
40 { | 40 { |
41 // Calculate filtered[i] and filtered_low[i] | 41 // Calculate filtered[i] and filtered_low[i] |
42 const int16_t* a_ptr = &a[1]; | 42 const int16_t* a_ptr = &a[1]; |
43 int16_t* filtered_ptr = &filtered[i - 1]; | 43 int16_t* filtered_ptr = &filtered[i - 1]; |
44 int16_t* filtered_low_ptr = &filtered_low[i - 1]; | 44 int16_t* filtered_low_ptr = &filtered_low[i - 1]; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 for (i = 0; i < x_length; i++) | 81 for (i = 0; i < x_length; i++) |
82 { | 82 { |
83 state[state_length - x_length + i] = filtered[i]; | 83 state[state_length - x_length + i] = filtered[i]; |
84 state[state_length - x_length + i] = filtered_low[i]; | 84 state[state_length - x_length + i] = filtered_low[i]; |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 return x_length; | 88 return x_length; |
89 } | 89 } |
OLD | NEW |