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 |
(...skipping 16 matching lines...) Expand all Loading... |
27 {-367, 1090, -2706, 9945, 10596, -3318, 1626, -781, 287}, | 27 {-367, 1090, -2706, 9945, 10596, -3318, 1626, -781, 287}, |
28 {-325, 953, -2292, 7301, 12963, -3320, 1570, -743, 271}, | 28 {-325, 953, -2292, 7301, 12963, -3320, 1570, -743, 271}, |
29 {-240, 693, -1622, 4634, 14809, -2782, 1262, -587, 212}, | 29 {-240, 693, -1622, 4634, 14809, -2782, 1262, -587, 212}, |
30 {-125, 358, -817, 2144, 15982, -1668, 721, -329, 118}, | 30 {-125, 358, -817, 2144, 15982, -1668, 721, -329, 118}, |
31 { 0, 0, -1, 1, 16380, 1, -1, 0, 0}, | 31 { 0, 0, -1, 1, 16380, 1, -1, 0, 0}, |
32 { 118, -329, 721, -1668, 15982, 2144, -817, 358, -125}, | 32 { 118, -329, 721, -1668, 15982, 2144, -817, 358, -125}, |
33 { 212, -587, 1262, -2782, 14809, 4634, -1622, 693, -240}, | 33 { 212, -587, 1262, -2782, 14809, 4634, -1622, 693, -240}, |
34 { 271, -743, 1570, -3320, 12963, 7301, -2292, 953, -325} | 34 { 271, -743, 1570, -3320, 12963, 7301, -2292, 953, -325} |
35 }; | 35 }; |
36 | 36 |
37 // Function prototype for pitch filtering. | |
38 // TODO(Turaj): Add descriptions of input and output parameters. | |
39 void WebRtcIsacfix_PitchFilterCore(int loopNumber, | |
40 int16_t gain, | |
41 int index, | |
42 int16_t sign, | |
43 int16_t* inputState, | |
44 int16_t* outputBuf2, | |
45 const int16_t* coefficient, | |
46 int16_t* inputBuf, | |
47 int16_t* outputBuf, | |
48 int* index2); | |
49 | |
50 static __inline int32_t CalcLrIntQ(int32_t fixVal, | 37 static __inline int32_t CalcLrIntQ(int32_t fixVal, |
51 int16_t qDomain) { | 38 int16_t qDomain) { |
52 int32_t roundVal = 1 << (qDomain - 1); | 39 int32_t roundVal = 1 << (qDomain - 1); |
53 | 40 |
54 return (fixVal + roundVal) >> qDomain; | 41 return (fixVal + roundVal) >> qDomain; |
55 } | 42 } |
56 | 43 |
57 void WebRtcIsacfix_PitchFilter(int16_t* indatQQ, // Q10 if type is 1 or 4, | 44 void WebRtcIsacfix_PitchFilter(int16_t* indatQQ, // Q10 if type is 1 or 4, |
58 // Q0 if type is 2. | 45 // Q0 if type is 2. |
59 int16_t* outdatQQ, | 46 int16_t* outdatQQ, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 230 } |
244 gainsQ12[k] = (int16_t)WEBRTC_SPL_SAT(PITCH_MAX_GAIN_Q12, tmpW32, 0); | 231 gainsQ12[k] = (int16_t)WEBRTC_SPL_SAT(PITCH_MAX_GAIN_Q12, tmpW32, 0); |
245 } | 232 } |
246 | 233 |
247 // Export buffer and states. | 234 // Export buffer and states. |
248 memcpy(pfp->ubufQQ, ubufQQ + PITCH_FRAME_LEN, sizeof(pfp->ubufQQ)); | 235 memcpy(pfp->ubufQQ, ubufQQ + PITCH_FRAME_LEN, sizeof(pfp->ubufQQ)); |
249 pfp->oldlagQ7 = lagsQ7[PITCH_SUBFRAMES - 1]; | 236 pfp->oldlagQ7 = lagsQ7[PITCH_SUBFRAMES - 1]; |
250 pfp->oldgainQ12 = gainsQ12[PITCH_SUBFRAMES - 1]; | 237 pfp->oldgainQ12 = gainsQ12[PITCH_SUBFRAMES - 1]; |
251 | 238 |
252 } | 239 } |
OLD | NEW |