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 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 11 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
12 #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h" | 12 #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h" |
13 | 13 |
14 /* Filter coefficicients in Q15. */ | 14 /* Filter coefficicients in Q15. */ |
15 static const int16_t kDampFilter[PITCH_DAMPORDER] = { | 15 static const int16_t kDampFilter[PITCH_DAMPORDER] = { |
16 -2294, 8192, 20972, 8192, -2294 | 16 -2294, 8192, 20972, 8192, -2294 |
17 }; | 17 }; |
18 | 18 |
19 void WebRtcIsacfix_PitchFilterCore(int loopNumber, | 19 void WebRtcIsacfix_PitchFilterCore(int loopNumber, |
20 int16_t gain, | 20 int16_t gain, |
21 int index, | 21 size_t index, |
22 int16_t sign, | 22 int16_t sign, |
23 int16_t* inputState, | 23 int16_t* inputState, |
24 int16_t* outputBuf2, | 24 int16_t* outputBuf2, |
25 const int16_t* coefficient, | 25 const int16_t* coefficient, |
26 int16_t* inputBuf, | 26 int16_t* inputBuf, |
27 int16_t* outputBuf, | 27 int16_t* outputBuf, |
28 int* index2) { | 28 int* index2) { |
29 int i = 0, j = 0; /* Loop counters. */ | 29 int i = 0, j = 0; /* Loop counters. */ |
30 int16_t* ubufQQpos2 = &outputBuf2[PITCH_BUFFSIZE - (index + 2)]; | 30 int16_t* ubufQQpos2 = &outputBuf2[PITCH_BUFFSIZE - (index + 2)]; |
31 int16_t tmpW16 = 0; | 31 int16_t tmpW16 = 0; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 /* Subtract from input and update buffer. */ | 65 /* Subtract from input and update buffer. */ |
66 tmpW32 = inputBuf[*index2] - sign * tmpW16; | 66 tmpW32 = inputBuf[*index2] - sign * tmpW16; |
67 outputBuf[*index2] = WebRtcSpl_SatW32ToW16(tmpW32); | 67 outputBuf[*index2] = WebRtcSpl_SatW32ToW16(tmpW32); |
68 tmpW32 = inputBuf[*index2] + outputBuf[*index2]; | 68 tmpW32 = inputBuf[*index2] + outputBuf[*index2]; |
69 outputBuf2[*index2 + PITCH_BUFFSIZE] = WebRtcSpl_SatW32ToW16(tmpW32); | 69 outputBuf2[*index2 + PITCH_BUFFSIZE] = WebRtcSpl_SatW32ToW16(tmpW32); |
70 | 70 |
71 (*index2)++; | 71 (*index2)++; |
72 } | 72 } |
73 } | 73 } |
OLD | NEW |